Commit ab23bcf6 authored by Felix Wege's avatar Felix Wege
Browse files

added setParameters function and new constructor

parent 0de66b0a
...@@ -86,6 +86,8 @@ namespace Ph1 { ...@@ -86,6 +86,8 @@ namespace Ph1 {
void initialize(Matrix frequencies); void initialize(Matrix frequencies);
/// Initializes component from power flow data /// Initializes component from power flow data
void initializeFromPowerflow(Real frequency); void initializeFromPowerflow(Real frequency);
/// Sets model specific parameters
void setParameters(Real activePower, Real ReactivePower, Real volt);
// #### MNA section #### // #### MNA section ####
/// Initializes internal variables of the component /// Initializes internal variables of the component
......
...@@ -50,8 +50,12 @@ DP::Ph1::RXLoad::RXLoad(String name, ...@@ -50,8 +50,12 @@ DP::Ph1::RXLoad::RXLoad(String name,
} }
PowerComponent<Complex>::Ptr DP::Ph1::RXLoad::clone(String name) { PowerComponent<Complex>::Ptr DP::Ph1::RXLoad::clone(String name) {
// TODO: Is this change is needed when "everything set by initializePOwerflow"??
// everything set by initializeFromPowerflow // everything set by initializeFromPowerflow
return RXLoad::make(name, mLogLevel); //return RXLoad::make(name, mLogLevel);
auto copy = RXLoad::make(name, mLogLevel);
copy->setParameters(mActivePower, mReactivePower, mNomVoltage);
return copy;
} }
void DP::Ph1::RXLoad::initialize(Matrix frequencies) { void DP::Ph1::RXLoad::initialize(Matrix frequencies) {
...@@ -113,6 +117,14 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) { ...@@ -113,6 +117,14 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) {
Logger::phasorToString(initialSingleVoltage(0))); Logger::phasorToString(initialSingleVoltage(0)));
} }
void DP::Ph1::RXLoad::setParameters(Real activePower, Real reactivePower, Real volt){
mActivePower = activePower;
mReactivePower = reactivePower;
mPower = { mActivePower, mReactivePower};
mNomVoltage = volt;
}
void DP::Ph1::RXLoad::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) { void DP::Ph1::RXLoad::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
MNAInterface::mnaInitialize(omega, timeStep); MNAInterface::mnaInitialize(omega, timeStep);
updateSimNodes(); updateSimNodes();
......
Supports Markdown
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