Commit 61a59f64 authored by Jan Dinkelbach's avatar Jan Dinkelbach Committed by Markus Mirz
Browse files

renaming externalGridInjection to NetworkInjection in SP

parent dcb29ecd
......@@ -102,8 +102,8 @@ int main(int argc, char** argv){
logger->addAttribute(line->name() + "." + node->name() + ".Q", line->attribute<Real>(q_branch));
lines.push_back(line);
}
else if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet =
std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp))
else if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet =
std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp))
{
logger->addAttribute(node->name() + ".Pinj", extnet->attribute<Real>("p_inj"));
logger->addAttribute(node->name() + ".Qinj", extnet->attribute<Real>("q_inj"));
......
......@@ -50,7 +50,7 @@ int main(int argc, char* argv[]) {
auto n1PF = SimNode<Complex>::make("n1", PhaseType::Single);
auto n2PF = SimNode<Complex>::make("n2", PhaseType::Single);
auto extnetPF = SP::Ph1::externalGridInjection::make("Slack", Logger::Level::debug);
auto extnetPF = SP::Ph1::NetworkInjection::make("Slack", Logger::Level::debug);
extnetPF->setParameters(Vnom);
extnetPF->setBaseVoltage(Vnom);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
......
......@@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
auto n1PF = SimNode<Complex>::make("n1", PhaseType::Single);
auto n2PF = SimNode<Complex>::make("n2", PhaseType::Single);
auto extnetPF = SP::Ph1::externalGridInjection::make("Slack", Logger::Level::debug);
auto extnetPF = SP::Ph1::NetworkInjection::make("Slack", Logger::Level::debug);
extnetPF->setParameters(scenario.systemNominalVoltage);
extnetPF->setBaseVoltage(scenario.systemNominalVoltage);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
......
......@@ -50,7 +50,7 @@ int main(int argc, char* argv[]) {
auto n1PF = SimNode<Complex>::make("n1", PhaseType::Single);
auto n2PF = SimNode<Complex>::make("n2", PhaseType::Single);
auto extnetPF = SP::Ph1::externalGridInjection::make("Slack", Logger::Level::debug);
auto extnetPF = SP::Ph1::NetworkInjection::make("Slack", Logger::Level::debug);
extnetPF->setParameters(Vnom);
extnetPF->setBaseVoltage(Vnom);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
......
......@@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
auto n1PF = SimNode<Complex>::make("n1", PhaseType::Single);
auto n2PF = SimNode<Complex>::make("n2", PhaseType::Single);
auto extnetPF = SP::Ph1::externalGridInjection::make("Slack", Logger::Level::debug);
auto extnetPF = SP::Ph1::NetworkInjection::make("Slack", Logger::Level::debug);
extnetPF->setParameters(scenario.systemNominalVoltage);
extnetPF->setBaseVoltage(scenario.systemNominalVoltage);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
......
......@@ -37,7 +37,7 @@ int main(int argc, char* argv[]) {
auto n1 = SimNode<Complex>::make("n1", PhaseType::Single);
auto n2 = SimNode<Complex>::make("n2", PhaseType::Single);
auto extnetPF = SP::Ph1::externalGridInjection::make("Slack", Logger::Level::debug);
auto extnetPF = SP::Ph1::NetworkInjection::make("Slack", Logger::Level::debug);
extnetPF->setParameters(Vnom);
extnetPF->setBaseVoltage(Vnom);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
......
......@@ -68,7 +68,7 @@ namespace DPsim {
/// Vector of shunt components
std::vector<std::shared_ptr<CPS::SP::Ph1::Shunt>> mShunts;
/// Vector of external grid components
std::vector<std::shared_ptr<CPS::SP::Ph1::externalGridInjection>> mExternalGrids;
std::vector<std::shared_ptr<CPS::SP::Ph1::NetworkInjection>> mExternalGrids;
/// Vector of average voltage source inverters
std::vector<std::shared_ptr<CPS::SP::Ph1::AvVoltageSourceInverterDQ>> mAverageVoltageSourceInverters;
......
......@@ -35,7 +35,7 @@ void PFSolver::initialize(){
mTransformers.push_back(trafo);
else if (std::shared_ptr<CPS::SP::Ph1::PiLine> line = std::dynamic_pointer_cast<CPS::SP::Ph1::PiLine>(comp))
mLines.push_back(line);
else if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp))
else if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp))
mExternalGrids.push_back(extnet);
else if (std::shared_ptr<CPS::SP::Ph1::Shunt> shunt = std::dynamic_pointer_cast<CPS::SP::Ph1::Shunt>(comp))
mShunts.push_back(shunt);
......@@ -155,7 +155,7 @@ void PFSolver::determinePFBusType() {
connectedVD = true;
}
}
else if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp)) {
else if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp)) {
if (extnet->mPowerflowBusType == CPS::PowerflowBusType::VD) {
connectedVD = true;
}
......@@ -250,7 +250,7 @@ void PFSolver::setVDNode(CPS::String name) {
void PFSolver::modifyPowerFlowBusComponent(CPS::String name, CPS::PowerflowBusType powerFlowBusType) {
for (auto comp : mSystem.mComponents) {
if (comp->name() == name) {
if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp))
if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp))
extnet->modifyPowerFlowBusType(powerFlowBusType);
else if(std::shared_ptr<CPS::SP::Ph1::SynchronGenerator> gen = std::dynamic_pointer_cast<CPS::SP::Ph1::SynchronGenerator>(comp))
gen->modifyPowerFlowBusType(powerFlowBusType);
......
......@@ -77,8 +77,8 @@ void PFSolverPowerPolar::generateInitialSolution(Real time, bool keep_last_solut
std::dynamic_pointer_cast<CPS::SP::Ph1::AvVoltageSourceInverterDQ>(comp)) {
sol_P(pv->matrixNodeIndex()) += vsi->attribute<CPS::Real>("P_ref")->get() / mBaseApparentPower;
}
else if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet =
std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp)) {
else if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet =
std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp)) {
sol_P(pv->matrixNodeIndex()) += extnet->attribute<CPS::Real>("p_inj")->get() / mBaseApparentPower;
sol_V(pv->matrixNodeIndex()) = extnet->attribute<CPS::Real>("V_set_pu")->get();
}
......@@ -95,7 +95,7 @@ void PFSolverPowerPolar::generateInitialSolution(Real time, bool keep_last_solut
// if external injection at VD bus, reset the voltage to injection's voltage set-point
for (auto comp : mSystem.mComponentsAtNode[vd]) {
if (std::shared_ptr<CPS::SP::Ph1::externalGridInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::externalGridInjection>(comp)) {
if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet = std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp)) {
sol_V(vd->matrixNodeIndex()) = extnet->attribute<CPS::Real>("V_set_pu")->get();
}
}
......
......@@ -88,7 +88,7 @@ static PyMethodDef dpsimModuleMethods[] = {
// Component::constructorDef<CPS::EMT::Ph3::SynchronGeneratorVBRStandalone>("_emt_ph3_SynchronGeneratorVBRStandalone"),
// Static Phasor (SP)
Component::constructorDef<CPS::SP::Ph1::externalGridInjection>("_sp_ph1_externalGridInjection"),
Component::constructorDef<CPS::SP::Ph1::NetworkInjection>("_sp_ph1_externalGridInjection"),
Component::constructorDef<CPS::SP::Ph1::Load>("_sp_ph1_Load"),
Component::constructorDef<CPS::SP::Ph1::PiLine>("_sp_ph1_PiLine"),
Component::constructorDef<CPS::SP::Ph1::PQNode>("_sp_ph1_PQNode"),
......
/* Copyright 2017-2020 Institute for Automation of Complex Power Systems,
* EONERC, RWTH Aachen University
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*********************************************************************************/
#pragma once
#include <cps/SimPowerComp.h>
#include <cps/Solver/PFSolverInterfaceBus.h>
#include <cps/Solver/MNAInterface.h>
#include <cps/Solver/DAEInterface.h>
namespace CPS {
namespace SP {
namespace Ph1 {
///
class NetworkInjection:
public SimPowerComp<Complex>,
public SharedFactory<NetworkInjection>,
public PFSolverInterfaceBus,
public MNAInterface,
public DAEInterface {
private:
// #### MNA ####
///
void updateVoltage(Real time);
///
Attribute<Complex>::Ptr mVoltageRef;
///
Attribute<Real>::Ptr mSrcFreq;
// #### Powerflow section ####
/// Voltage set point [V]
Real mVoltageSetPoint;
/// Apparent Power Injection [VA]
Complex mPowerInjection;
/// Active Power Injection [W]
Real mActivePowerInjection;
/// Reactive Power Injection [Var]
Real mReactivePowerInjection;
/// Base voltage [V]
Real mBaseVoltage;
/// Voltage set point [pu]
Real mVoltageSetPointPerUnit=1.0;
public:
// #### General ####
/// Defines UID, name and logging level
NetworkInjection(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name and logging level
NetworkInjection(String name, Logger::Level logLevel = Logger::Level::off)
: NetworkInjection(name, name, logLevel) { }
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency) override;
///
void setSourceValue(Complex voltage);
///
void setParameters(Real vSetPointPerUnit);
///
SimPowerComp<Complex>::Ptr clone(String name) override;
// #### Powerflow section ####
/// Set base voltage
void setBaseVoltage(Real baseVoltage);
/// Calculates component's parameters in specified per-unit system
void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega);
/// Modify powerflow bus type
void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override;
/// Update power injection
void updatePowerInjection(Complex powerInj);
// #### MNA Section ####
/// Set parameters relevant for MNA solver
void setParameters(Complex voltageRef, Real srcFreq = -1);
/// Initializes internal variables of the component
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) override;
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix) override;
/// Stamps right side (source) vector
void mnaApplyRightSideVectorStamp(Matrix& rightVector) override;
/// Returns current through the component
void mnaUpdateCurrent(const Matrix& leftVector) override;
class MnaPreStep : public Task {
public:
MnaPreStep(NetworkInjection& networkInjection) :
Task(networkInjection.mName + ".MnaPreStep"), mNetworkInjection(networkInjection) {
mAttributeDependencies.push_back(mNetworkInjection.attribute("V_ref"));
mModifiedAttributes.push_back(mNetworkInjection.attribute("right_vector"));
mModifiedAttributes.push_back(mNetworkInjection.attribute("v_intf"));
}
void execute(Real time, Int timeStepCount);
private:
NetworkInjection& mNetworkInjection;
};
class MnaPostStep : public Task {
public:
MnaPostStep(NetworkInjection& networkInjection, Attribute<Matrix>::Ptr leftVector) :
Task(networkInjection.mName + ".MnaPostStep"),
mNetworkInjection(networkInjection), mLeftVector(leftVector) {
mAttributeDependencies.push_back(mLeftVector);
mModifiedAttributes.push_back(mNetworkInjection.attribute("i_intf"));
}
void execute(Real time, Int timeStepCount);
private:
NetworkInjection& mNetworkInjection;
Attribute<Matrix>::Ptr mLeftVector;
};
// #### DAE Section ####
/// Residual function for DAE Solver
void daeResidual(double ttime, const double state[], const double dstate_dt[], double resid[], std::vector<int>& off) override;
///Voltage Getter
Complex daeInitialize() override;
};
}
}
}
......@@ -17,9 +17,9 @@ namespace CPS {
namespace SP {
namespace Ph1 {
///
class externalGridInjection:
class NetworkInjection:
public SimPowerComp<Complex>,
public SharedFactory<externalGridInjection>,
public SharedFactory<NetworkInjection>,
public PFSolverInterfaceBus,
public MNAInterface,
public DAEInterface {
......@@ -53,10 +53,10 @@ namespace Ph1 {
public:
// #### General ####
/// Defines UID, name and logging level
externalGridInjection(String uid, String name, Logger::Level logLevel = Logger::Level::off);
NetworkInjection(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name and logging level
externalGridInjection(String name, Logger::Level logLevel = Logger::Level::off)
: externalGridInjection(name, name, logLevel) { }
NetworkInjection(String name, Logger::Level logLevel = Logger::Level::off)
: NetworkInjection(name, name, logLevel) { }
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency) override;
///
......@@ -90,28 +90,28 @@ namespace Ph1 {
class MnaPreStep : public Task {
public:
MnaPreStep(externalGridInjection& externalGridInjection) :
Task(externalGridInjection.mName + ".MnaPreStep"), mExternalGridInjection(externalGridInjection) {
mAttributeDependencies.push_back(externalGridInjection.attribute("V_ref"));
mModifiedAttributes.push_back(mExternalGridInjection.attribute("right_vector"));
mModifiedAttributes.push_back(mExternalGridInjection.attribute("v_intf"));
MnaPreStep(NetworkInjection& networkInjection) :
Task(networkInjection.mName + ".MnaPreStep"), mNetworkInjection(networkInjection) {
mAttributeDependencies.push_back(mNetworkInjection.attribute("V_ref"));
mModifiedAttributes.push_back(mNetworkInjection.attribute("right_vector"));
mModifiedAttributes.push_back(mNetworkInjection.attribute("v_intf"));
}
void execute(Real time, Int timeStepCount);
private:
externalGridInjection& mExternalGridInjection;
NetworkInjection& mNetworkInjection;
};
class MnaPostStep : public Task {
public:
MnaPostStep(externalGridInjection& externalGridInjection, Attribute<Matrix>::Ptr leftVector) :
Task(externalGridInjection.mName + ".MnaPostStep"),
mExternalGridInjection(externalGridInjection), mLeftVector(leftVector) {
MnaPostStep(NetworkInjection& networkInjection, Attribute<Matrix>::Ptr leftVector) :
Task(networkInjection.mName + ".MnaPostStep"),
mNetworkInjection(networkInjection), mLeftVector(leftVector) {
mAttributeDependencies.push_back(mLeftVector);
mModifiedAttributes.push_back(mExternalGridInjection.attribute("i_intf"));
mModifiedAttributes.push_back(mNetworkInjection.attribute("i_intf"));
}
void execute(Real time, Int timeStepCount);
private:
externalGridInjection& mExternalGridInjection;
NetworkInjection& mNetworkInjection;
Attribute<Matrix>::Ptr mLeftVector;
};
......
......@@ -616,7 +616,7 @@ TopologicalPowerComp::Ptr Reader::mapExternalNetworkInjection(CIMPP::ExternalNet
}
} else if(mDomain == Domain::SP) {
if (mPhase == PhaseType::Single) {
auto cpsextnet = std::make_shared<SP::Ph1::externalGridInjection>(extnet->mRID, extnet->name, mComponentLogLevel);
auto cpsextnet = std::make_shared<SP::Ph1::NetworkInjection>(extnet->mRID, extnet->name, mComponentLogLevel);
cpsextnet->modifyPowerFlowBusType(PowerflowBusType::VD); // for powerflow solver set as VD component as default
cpsextnet->setBaseVoltage(baseVoltage);
if(extnet->RegulatingControl){
......
......@@ -11,7 +11,7 @@
using namespace CPS;
SP::Ph1::externalGridInjection::externalGridInjection(String uid, String name,
SP::Ph1::NetworkInjection::NetworkInjection(String uid, String name,
Logger::Level logLevel) : SimPowerComp<Complex>(uid, name, logLevel) {
mSLog->info("Create {} of type {}", mName, this->type());
......@@ -33,7 +33,7 @@ SP::Ph1::externalGridInjection::externalGridInjection(String uid, String name,
// #### Powerflow section ####
void SP::Ph1::externalGridInjection::setParameters(Real voltageSetPoint) {
void SP::Ph1::NetworkInjection::setParameters(Real voltageSetPoint) {
mVoltageSetPoint = voltageSetPoint;
mSLog->info("Voltage Set-Point ={} [V]", mVoltageSetPoint);
......@@ -42,11 +42,11 @@ void SP::Ph1::externalGridInjection::setParameters(Real voltageSetPoint) {
mParametersSet = true;
}
void SP::Ph1::externalGridInjection::setBaseVoltage(Real baseVoltage) {
void SP::Ph1::NetworkInjection::setBaseVoltage(Real baseVoltage) {
mBaseVoltage = baseVoltage;
}
void SP::Ph1::externalGridInjection::calculatePerUnitParameters(Real baseApparentPower, Real baseOmega) {
void SP::Ph1::NetworkInjection::calculatePerUnitParameters(Real baseApparentPower, Real baseOmega) {
mSLog->info("#### Calculate Per Unit Parameters for {}", mName);
mSLog->info("Base Voltage={} [V]", mBaseVoltage);
......@@ -56,30 +56,30 @@ void SP::Ph1::externalGridInjection::calculatePerUnitParameters(Real baseApparen
mSLog->flush();
}
void SP::Ph1::externalGridInjection::modifyPowerFlowBusType(PowerflowBusType powerflowBusType) {
void SP::Ph1::NetworkInjection::modifyPowerFlowBusType(PowerflowBusType powerflowBusType) {
mPowerflowBusType = powerflowBusType;
}
void SP::Ph1::externalGridInjection::updatePowerInjection(Complex powerInj) {
void SP::Ph1::NetworkInjection::updatePowerInjection(Complex powerInj) {
mActivePowerInjection = powerInj.real();
mReactivePowerInjection = powerInj.imag();
}
// #### MNA Section ####
void SP::Ph1::externalGridInjection::setParameters(Complex voltageRef, Real srcFreq) {
void SP::Ph1::NetworkInjection::setParameters(Complex voltageRef, Real srcFreq) {
attribute<Complex>("V_ref")->set(voltageRef);
attribute<Real>("f_src")->set(srcFreq);
mParametersSet = true;
}
SimPowerComp<Complex>::Ptr SP::Ph1::externalGridInjection::clone(String name) {
auto copy = externalGridInjection::make(name, mLogLevel);
SimPowerComp<Complex>::Ptr SP::Ph1::NetworkInjection::clone(String name) {
auto copy = NetworkInjection::make(name, mLogLevel);
copy->setParameters(attribute<Complex>("V_ref")->get());
return copy;
}
void SP::Ph1::externalGridInjection::initializeFromNodesAndTerminals(Real frequency) {
void SP::Ph1::NetworkInjection::initializeFromNodesAndTerminals(Real frequency) {
mVoltageRef = attribute<Complex>("V_ref");
mSrcFreq = attribute<Real>("f_src");
if (mVoltageRef->get() == Complex(0, 0))
......@@ -96,7 +96,7 @@ void SP::Ph1::externalGridInjection::initializeFromNodesAndTerminals(Real freque
// #### MNA functions ####
void SP::Ph1::externalGridInjection::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
void SP::Ph1::NetworkInjection::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
MNAInterface::mnaInitialize(omega, timeStep);
updateMatrixNodeIndices();
......@@ -106,7 +106,7 @@ void SP::Ph1::externalGridInjection::mnaInitialize(Real omega, Real timeStep, At
mRightVector = Matrix::Zero(leftVector->get().rows(), 1);
}
void SP::Ph1::externalGridInjection::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
void SP::Ph1::NetworkInjection::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
Math::setMatrixElement(systemMatrix, mVirtualNodes[0]->matrixNodeIndex(), matrixNodeIndex(0), Complex(1, 0));
Math::setMatrixElement(systemMatrix, matrixNodeIndex(0), mVirtualNodes[0]->matrixNodeIndex(), Complex(1, 0));
mSLog->info("-- Matrix Stamp ---");
......@@ -115,14 +115,14 @@ void SP::Ph1::externalGridInjection::mnaApplySystemMatrixStamp(Matrix& systemMat
}
void SP::Ph1::externalGridInjection::mnaApplyRightSideVectorStamp(Matrix& rightVector) {
void SP::Ph1::NetworkInjection::mnaApplyRightSideVectorStamp(Matrix& rightVector) {
// TODO: Is this correct with two nodes not gnd?
Math::setVectorElement(rightVector, mVirtualNodes[0]->matrixNodeIndex(), mIntfVoltage(0, 0));
SPDLOG_LOGGER_DEBUG(mSLog, "Add {:s} to source vector at {:d}",
Logger::complexToString(mIntfVoltage(0, 0)), mVirtualNodes[0]->matrixNodeIndex());
}
void SP::Ph1::externalGridInjection::updateVoltage(Real time) {
void SP::Ph1::NetworkInjection::updateVoltage(Real time) {
if (mSrcFreq->get() < 0) {
mIntfVoltage(0, 0) = mVoltageRef->get();
}
......@@ -133,21 +133,21 @@ void SP::Ph1::externalGridInjection::updateVoltage(Real time) {
}
}
void SP::Ph1::externalGridInjection::MnaPreStep::execute(Real time, Int timeStepCount) {
mExternalGridInjection.updateVoltage(time);
mExternalGridInjection.mnaApplyRightSideVectorStamp(mExternalGridInjection.mRightVector);
void SP::Ph1::NetworkInjection::MnaPreStep::execute(Real time, Int timeStepCount) {
mNetworkInjection.updateVoltage(time);
mNetworkInjection.mnaApplyRightSideVectorStamp(mNetworkInjection.mRightVector);
}
void SP::Ph1::externalGridInjection::MnaPostStep::execute(Real time, Int timeStepCount) {
mExternalGridInjection.mnaUpdateCurrent(*mLeftVector);
void SP::Ph1::NetworkInjection::MnaPostStep::execute(Real time, Int timeStepCount) {
mNetworkInjection.mnaUpdateCurrent(*mLeftVector);
}
void SP::Ph1::externalGridInjection::mnaUpdateCurrent(const Matrix& leftVector) {
void SP::Ph1::NetworkInjection::mnaUpdateCurrent(const Matrix& leftVector) {
mIntfCurrent(0, 0) = Math::complexFromVectorElement(leftVector, mVirtualNodes[0]->matrixNodeIndex());
}
void SP::Ph1::externalGridInjection::daeResidual(double ttime, const double state[], const double dstate_dt[], double resid[], std::vector<int>& off) {
void SP::Ph1::NetworkInjection::daeResidual(double ttime, const double state[], const double dstate_dt[], double resid[], std::vector<int>& off) {
/* new state vector definintion:
state[0]=node0_voltage
state[1]=node1_voltage
......@@ -172,7 +172,7 @@ void SP::Ph1::externalGridInjection::daeResidual(double ttime, const double stat
off[1] += 1;
}
Complex SP::Ph1::externalGridInjection::daeInitialize() {
Complex SP::Ph1::NetworkInjection::daeInitialize() {
mIntfVoltage(0, 0) = mVoltageRef->get();
return mVoltageRef->get();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment