DPsim
Loading...
Searching...
No Matches
EMT_DC_PiLine.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
10
11namespace CPS {
12namespace EMT {
13namespace DC {
14
20class PiLine final : public CompositePowerComp<Real>,
21 public SharedFactory<PiLine> {
22public:
24
35
36 PiLine(String uid, String name, Logger::Level logLevel = Logger::Level::off);
37 PiLine(String name, Logger::Level logLevel = Logger::Level::off)
38 : PiLine(name, name, logLevel) {}
39
41 void setParameters(Real seriesResistance, Real seriesInductance,
42 Real parallelCapacitance = 0.0,
43 Real parallelConductance = 0.0, Real initialCurrent = 0.0);
44
45 void createSubComponents() override final;
46 void initializeParentFromNodesAndTerminals(Real frequency) override final;
47
48 void mnaCompUpdateVoltage(const Matrix &leftVector) override final;
49 void mnaCompUpdateCurrent(const Matrix &leftVector) override final;
50 void mnaParentPreStep(Real time, Int timeStepCount) override final;
51 void mnaParentPostStep(Real time, Int timeStepCount,
52 Attribute<Matrix>::Ptr &leftVector) override final;
54 AttributeBase::List &prevStepDependencies,
55 AttributeBase::List &attributeDependencies,
56 AttributeBase::List &modifiedAttributes) override final;
58 AttributeBase::List &prevStepDependencies,
59 AttributeBase::List &attributeDependencies,
60 AttributeBase::List &modifiedAttributes,
61 Attribute<Matrix>::Ptr &leftVector) override final;
62
63private:
64 std::shared_ptr<Resistor> mSeriesResistor;
65 std::shared_ptr<Inductor> mSeriesInductor;
66 std::shared_ptr<Resistor> mShuntResistor0;
67 std::shared_ptr<Resistor> mShuntResistor1;
68 std::shared_ptr<Capacitor> mShuntCapacitor0;
69 std::shared_ptr<Capacitor> mShuntCapacitor1;
70
71 void validateDCTerminals() const;
72};
73
74} // namespace DC
75} // namespace EMT
76} // namespace CPS
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
std::shared_ptr< CompositePowerComp< Real > > Ptr
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
Scalar DC capacitor represented as a one-state I-type SSN component.
Scalar DC inductor represented as a one-state V-type SSN component.
const Attribute< Real >::Ptr mSeriesResistance
Series resistance [ohm].
void initializeParentFromNodesAndTerminals(Real frequency) override final
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override final
const Attribute< Real >::Ptr mInitialCurrent
Initial series current from terminal 1 to terminal 0 [A].
void mnaCompUpdateVoltage(const Matrix &leftVector) override final
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override final
const Attribute< Real >::Ptr mParallelCapacitance
Total terminal-to-ground shunt capacitance [F].
const Attribute< Real >::Ptr mSeriesInductance
Series inductance [H].
void createSubComponents() override final
Constructs and registers MNA subcomponents; called before collectVirtualNodes so virtual nodes exist ...
void mnaParentPreStep(Real time, Int timeStepCount) override final
void setParameters(Real seriesResistance, Real seriesInductance, Real parallelCapacitance=0.0, Real parallelConductance=0.0, Real initialCurrent=0.0)
void mnaCompUpdateCurrent(const Matrix &leftVector) override final
const Attribute< Real >::Ptr mParallelConductance
Total terminal-to-ground shunt conductance [S].
SimPowerComp< Real >::Ptr clone(String name) override final
Returns a modified copy of the component with the given suffix added to the name and without.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override final
PiLine(String name, Logger::Level logLevel=Logger::Level::off)
PiLine(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Scalar DC resistor represented as a stateless V-type SSN component.
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
static std::shared_ptr< PiLine > make(Args &&...args)
Definition PtrFactory.h:19
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