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

added setParameters function and new constructor


Former-commit-id: ab23bcf6
parent a70ae26e
......@@ -86,6 +86,8 @@ namespace Ph1 {
void initialize(Matrix frequencies);
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
/// Sets model specific parameters
void setParameters(Real activePower, Real ReactivePower, Real volt);
// #### MNA section ####
/// Initializes internal variables of the component
......
......@@ -50,8 +50,12 @@ DP::Ph1::RXLoad::RXLoad(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
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) {
......@@ -113,6 +117,14 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) {
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) {
MNAInterface::mnaInitialize(omega, timeStep);
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