PowerFlowCore 0.12.1
See the version list below for details.
dotnet add package PowerFlowCore --version 0.12.1
NuGet\Install-Package PowerFlowCore -Version 0.12.1
<PackageReference Include="PowerFlowCore" Version="0.12.1" />
paket add PowerFlowCore --version 0.12.1
#r "nuget: PowerFlowCore, 0.12.1"
// Install PowerFlowCore as a Cake Addin #addin nuget:?package=PowerFlowCore&version=0.12.1 // Install PowerFlowCore as a Cake Tool #tool nuget:?package=PowerFlowCore&version=0.12.1
PowerFlowCore
Features:
- Three-phase AC mode grids calculations
- Flexible system to set up configuration of calculations
Newton-Raphson
andGauss-Seidel
solversLoad models
with variant structure- Algorithms on graphs (connectivity etc.)
- Network operational limits control
- Parallel calculations from box
Samples are presented in PowerFlowCore.Samples project. Library benchmarking is presented in PowerFlowCore.Benchmark project.
Quick example
Next example assumes that Node
and Branch
classes inherits INode
and IBranch
interfaces respectively.
More examples can be found in PowerFlowCore.Samples project.
Create grid:
using PowerFlowCore;
using PowerFlowCore.Data;
using PowerFlowCore.Solvers;
var nodes = new List<INode>() // Create collection of Nodes
{
new Node(){Num = 1, Type = NodeType.PQ, Unom=115, Vpre = 0, S_load = new Complex(10, 15)},
new Node(){Num = 2, Type = NodeType.PQ, Unom=230, Vpre = 0, S_load = new Complex(10, 40)},
new Node(){Num = 3, Type = NodeType.PV, Unom=10.5, Vpre = 10.6, S_load = new Complex(10, 25), S_gen = new Complex(50, 0), Q_min=-15, Q_max=60},
new Node(){Num = 4, Type = NodeType.Slack, Unom=115, Vpre = 115}
};
var branches = new List<IBranch>() // Create collection of Branches
{
new Branch(){Start=2, End=1, Y=1/(new Complex(0.5, 10)), Ktr=Complex.FromPolarCoordinates(0.495, 15 * Math.PI/180), Ysh = new Complex(0, -55.06e-6)},
new Branch(){Start=2, End=3, Y=1/(new Complex(10, 20)), Ktr=Complex.FromPolarCoordinates(0.045652, 0 * Math.PI/180), Ysh = new Complex(0, 0)},
new Branch(){Start=1, End=4, Y=1/(new Complex(8, 15)), Ktr=1},
new Branch(){Start=1, End=4, Y=1/(new Complex(20, 40)), Ktr=1}
};
var grid = new Grid(nodes, branches); // Create Grid object
Inspect connectivity:
bool connected = grid.IsConnected();
Calculate grid (for more details look Calculate() methods):
bool success = false; // To save calculation result
grid.Calculate(); // Default calculation
// or
// Calculation with options and saving results
(grid, success) = grid.Calculate(new CalculationOptions() { IterationsCount = 5 }});
// or
// Calculate with result short saving
grid.Calculate(out success);
// or
// Apply multiple solvers
grid.ApplySolver(SolverType.GaussSeidel, new CalculationOptions() { IterationsCount = 3 })
.ApplySolver(SolverType.NewtonRaphson)
.Calculate(out success);
Basic concepts
Namespaces
Provided tools are located in several namespaces:
using PowerFlowCore;
using PowerFlowCore.Data;
using PowerFlowCore.Solvers;
using PowerFlowCore.Algebra;
Components
INode, IBranch
INode
and IBranch
interfaces encapsulate properties to work with internal solver. These interfaces should be inherited by custom class or struct to use in solver. Being passed to the solver are converted to the original interface.
Grid
Central term is Grid
object from PowerFlowCore.Data
namespace.
To create Grid
object collections of INode
and IBranch
should be explicitly given to the constructor:
public Grid(IEnumerable<INode> nodes, IEnumerable<IBranch> branches) { ... }
Another way to create Grid
is to use IConverter
object that encapsulated collection of INode
and IBranch
:
public Grid(IConverter converter) { ... }
Besides collections of nodes and branches Grid
contains:
- Admittance matrix - Y
- Vector of nodes nominal voltages - Unominal
- Vector of nodes initial voltages (for calculations) - Uinit
- Vector of nodes calculated voltages - Ucalc
- Vector of nodes power injections (=generation-load) - S
- Collection of load models - LoadModels
- Description:
- Load nodes count - PQ_Count
- Generator nodes count - PV_Count
- Slack bus nodes count - Slack_Count
License
Published under MIT license
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.