DPsim
Loading...
Searching...
No Matches
DP_Ph1_RxLine.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 {
20
21class RxLine : public CompositePowerComp<Complex>,
22 public Base::Ph1::PiLine,
23 public SharedFactory<RxLine> {
24protected:
26 std::shared_ptr<Inductor> mSubInductor;
28 std::shared_ptr<Resistor> mSubResistor;
30 std::shared_ptr<Resistor> mInitialResistor;
32
33public:
35 RxLine(String uid, String name, Logger::Level logLevel = Logger::Level::off);
37 RxLine(String name, Logger::Level logLevel = Logger::Level::off)
38 : RxLine(name, name, logLevel) {}
39
41
42 // #### General ####
44 void createSubComponents() override;
46 void initializeParentFromNodesAndTerminals(Real frequency) override;
47
48 // #### MNA section ####
49 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
50 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
52 AttributeBase::List &prevStepDependencies,
53 AttributeBase::List &attributeDependencies,
54 AttributeBase::List &modifiedAttributes) override;
55 void
57 AttributeBase::List &attributeDependencies,
58 AttributeBase::List &modifiedAttributes,
59 Attribute<Matrix>::Ptr &leftVector) override;
60
62 void mnaParentPreStep(Real time, Int timeStepCount) override;
63 void mnaParentPostStep(Real time, Int timeStepCount,
64 Attribute<Matrix>::Ptr &leftVector) override;
65};
66} // namespace Ph1
67} // namespace DP
68} // 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)
void mnaCompUpdateVoltage(const Matrix &leftVector) override
void initializeParentFromNodesAndTerminals(Real frequency) override
Derives values from power flow data and pushes them to subcomponents.
RxLine(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
std::shared_ptr< Resistor > mSubResistor
Resistor submodel.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
SimPowerComp< Complex >::Ptr clone(String name) override
DEPRECATED: Delete method.
std::shared_ptr< Inductor > mSubInductor
Inductance submodel.
std::shared_ptr< Resistor > mInitialResistor
Inductor end to ground resistor to facilitate initialization.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre and post step operations.
void createSubComponents() override
Constructs and registers MNA subcomponents; idempotent.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
RxLine(String uid, String name, Logger::Level logLevel=Logger::Level::off)
True after createSubComponents() runs; prevents double-construction.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
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