VeraGridEngine.Simulations.SigmaAnalysis package

Submodules

VeraGridEngine.Simulations.SigmaAnalysis.sigma_analysis_driver module

class VeraGridEngine.Simulations.SigmaAnalysis.sigma_analysis_driver.SigmaAnalysisDriver(grid: MultiCircuit, options: PowerFlowOptions)[source]

Bases: DriverTemplate

cancel()[source]

Cancel the simulation

convergence_reports
get_steps()[source]
Returns:

name = 'Sigma Analysis'
options
run()[source]

Pack run_pf for the QThread :return:

tpe = 'Sigma Analysis'
class VeraGridEngine.Simulations.SigmaAnalysis.sigma_analysis_driver.SigmaAnalysisResults[source]

Bases: ResultsTemplate

CLASS_DATA_VARIABLES = {'Sbus': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'distances': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'lambda_value': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sigma_im': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sigma_re': <VeraGridEngine.Simulations.results_template.ResultsProperty object>}
CLASS_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
Sbus
apply_from_island(results: SigmaAnalysisResults, b_idx)[source]

Apply results from another island circuit to the circuit results represented here.

Arguments:

results: PowerFlowResults

b_idx: bus original indices

elm_idx: branch original indices

bus_names
converged
convergence_reports
distances
elapsed
lambda_value
mdl(result_type: ResultTypes, indices=None, names=None) None | ResultsTable[source]
Parameters:
  • result_type

  • indices

  • names

Returns:

n
plot(fig, ax, n_points=1000)[source]

Plot the sigma analysis :param fig: Matplotlib figure. If None, one will be created :param ax: Matplotlib Axis :param n_points: number of points in the curve

sigma_im
sigma_re
VeraGridEngine.Simulations.SigmaAnalysis.sigma_analysis_driver.multi_island_sigma(multi_circuit: MultiCircuit, options: PowerFlowOptions, logger=<VeraGridEngine.basic_structures.Logger object>) SigmaAnalysisResults[source]

Multiple islands power flow (this is the most generic power flow function) :param multi_circuit: MultiCircuit instance :param options: PowerFlowOptions instance :param logger: list of events to add to :return: PowerFlowResults instance

VeraGridEngine.Simulations.SigmaAnalysis.sigma_analysis_driver.sigma_distance(sigma_real, sigma_imag) ndarray[tuple[Any, ...], dtype[float64]][source]

Distance to the collapse in the sigma space

The boundary curve is given by y = sqrt(1/4 + x)

the distance is d = sqrt((x-a)^2 + (sqrt(1/4+ x) - b)^2)

the derivative of this is d’=(2 (-a + x) + (-b + sqrt(1/4 + x))/sqrt(1/4 + x))/(2 sqrt((-a + x)^2 + (-b + sqrt(1/4 + x))^2))

Making d’=0, and solving for x, we obtain:

x1 = 1/12 (-64 a^3 + 48 a^2
  • 12 sqrt(3) sqrt(-64 a^3 b^2 + 48 a^2 b^2 - 12 a b^2 + 108 b^4 + b^2)

  • 12 a + 216 b^2 + 1)^(1/3) - (-256 a^2 + 128 a - 16)/

(192 (-64 a^3 + 48 a^2
  • 12 sqrt(3) sqrt(-64 a^3 b^2 + 48 a^2 b^2 - 12 a b^2 + 108 b^4 + b^2)

  • 12 a + 216 b^2 + 1)^(1/3)) + 1/12 (8 a - 5)

x2 = 1/12 (-64 a^3 + 48 a^2
  • 12 sqrt(3) sqrt(-64 a^3 b^2 + 48 a^2 b^2 - 12 a b^2 + 108 b^4 + b^2)

  • 12 a + 216 b^2 + 1)^(1/3) - (-256 a^2 + 128 a - 16) /

(192 (-64 a^3 + 48 a^2
  • 12 sqrt(3) sqrt(-64 a^3 b^2 + 48 a^2 b^2 - 12 a b^2 + 108 b^4 + b^2)

  • 12 a + 216 b^2 + 1)^(1/3)) + 1/12 (8 a - 5)

Parameters:
  • sigma_real – Sigma real array

  • sigma_imag – Sigma imag array

Returns:

distance of the sigma point to the curve sqrt(0.25 + x)

Module contents