sogno-platform / dpsim

Real-time power system simulator including powerflow, (dynamic) phasors and EMT
https://sogno.energy/dpsim/
Mozilla Public License 2.0
67 stars 49 forks source link

Allow initialisation of p_inj and q_inj in SP_NetworkInjection #309

Open martinmoraga opened 2 weeks ago

martinmoraga commented 2 weeks ago

Currently, it is not possible to initialise the active and reactive power of the NetworkInjection class for powerflow simulations.

This could be solved by adding the line:

sol_Q(pv->matrixNodeIndex()) += extnet->attributeTyped<CPS::Real>("q_inj")->get() / mBaseApparentPower;

in https://github.com/sogno-platform/dpsim/blob/ffc508004f0487f33e080da2d28ae64c4e2e7a3e/dpsim/src/PFSolverPowerPolar.cpp#L93