DPsim
Loading...
Searching...
No Matches
DP_Ph1_RXLoad.h
Go to the documentation of this file.
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
16
17namespace CPS {
18namespace DP {
19namespace Ph1 {
21class RXLoad : public CompositePowerComp<Complex>,
22 public SharedFactory<RXLoad> {
23protected:
34 std::shared_ptr<DP::Ph1::Inductor> mSubInductor;
36 std::shared_ptr<DP::Ph1::Capacitor> mSubCapacitor;
38 std::shared_ptr<DP::Ph1::Resistor> mSubResistor;
40 std::vector<const Matrix *> mRightVectorStamps;
42
43public:
51 RXLoad(String uid, String name, Logger::Level logLevel = Logger::Level::off);
53 RXLoad(String name, Logger::Level logLevel = Logger::Level::off);
54
56
57 // #### General ####
59 void createSubComponents() override;
61 void initializeParentFromNodesAndTerminals(Real frequency) override;
63 void setParameters(Real activePower, Real ReactivePower, Real volt);
64
65 // #### MNA section ####
67 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
69 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
71 void mnaParentPreStep(Real time, Int timeStepCount) override;
73 void mnaParentPostStep(Real time, Int timeStepCount,
74 Attribute<Matrix>::Ptr &leftVector) override;
77 AttributeBase::List &prevStepDependencies,
78 AttributeBase::List &attributeDependencies,
79 AttributeBase::List &modifiedAttributes) override;
81 void
83 AttributeBase::List &attributeDependencies,
84 AttributeBase::List &modifiedAttributes,
85 Attribute<Matrix>::Ptr &leftVector) override;
86};
87} // namespace Ph1
88} // namespace DP
89} // namespace CPS
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
std::shared_ptr< DP::Ph1::Inductor > mSubInductor
Internal inductor.
RXLoad(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
SimPowerComp< Complex >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
Real mInductance
Inductance [H].
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
const Attribute< Real >::Ptr mActivePower
True after createSubComponents() runs; prevents double-construction.
Real mReactance
Reactance [Ohm].
const Attribute< Real >::Ptr mReactivePower
Reactive power [VAr].
Real mCapacitance
Capacitance [F].
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
std::shared_ptr< DP::Ph1::Capacitor > mSubCapacitor
Internal capacitor.
std::vector< const Matrix * > mRightVectorStamps
Right side vectors of subcomponents.
const Attribute< Real >::Ptr mNomVoltage
Nominal voltage [V].
void setParameters(Real activePower, Real ReactivePower, Real volt)
Set model specific parameters.
std::shared_ptr< DP::Ph1::Resistor > mSubResistor
Internal resistance.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void initializeParentFromNodesAndTerminals(Real frequency) override
Derives values from power flow data and pushes them to subcomponents.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system result.
void createSubComponents() override
Constructs and registers MNA subcomponents; idempotent.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system result.
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:81
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61