Skip to content

Commit

Permalink
Stage 1.0.05 - Solver NR development. Part 7. Stable NR power flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ealux committed May 6, 2022
2 parents 1a62c98 + d8e0a81 commit 4fbb0e8
Show file tree
Hide file tree
Showing 5 changed files with 386 additions and 162 deletions.
5 changes: 1 addition & 4 deletions PowerFlowCore/Engine/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ public void Calculate()
{
//this.Grid.SolverGS(this.Grid.Uinit, this.Options);

//this.Grid.SolverGS(this.Grid.Uinit, new CalculationOptions() { IterationsCount = 10 }).SolverNR(this.Grid.Ucalc, this.Options);
//this.Grid.SolverGS(this.Grid.Uinit, new CalculationOptions() { IterationsCount = 15 }).SolverNR(this.Grid.Ucalc, this.Options);
this.Grid.SolverNR(this.Grid.Uinit, this.Options);

//this.Grid.SolverNR2(this.Grid.Uinit, this.Options);
//this.Grid.SolverGS(this.Grid.Uinit, new CalculationOptions() { IterationsCount = 5}).SolverNR2(this.Grid.Ucalc, this.Options);


this.Grid.CalculatePowerMatrix();
this.NeedsToCalc = false;
Expand Down
4 changes: 2 additions & 2 deletions PowerFlowCore/Options/CalculationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class CalculationOptions
/// Gauss-Seidel: Voltage step defference;
/// Newton-Raphson: Power residual tolerance.
/// </summary>
public double Accuracy { get; set; } = 1e-6;
public double Accuracy { get; set; } = 1e-8;


/// <summary>
Expand All @@ -32,7 +32,7 @@ public sealed class CalculationOptions
/// <summary>
/// Voltage convergence criteria (Newton-Raphson method only)
/// </summary>
public double VoltageConvergence { get; set; } = 1e-6;
public double VoltageConvergence { get; set; } = 1e-8;


/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions PowerFlowCore/Solvers/SolverGS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ public static Grid SolverGS(this Grid grid,
for (int n = 0; n < grid.Nodes.Count; n++)
grid.Nodes[n].U = U[n];


// !!!!!
// TODO:
// 1. (Not)Success logic
// 2. Voltage restrictions
// 3. Angle restrictions in branches
// !!!!!

return grid;
}

Expand Down
Loading

0 comments on commit 4fbb0e8

Please sign in to comment.