DPsim
Loading...
Searching...
No Matches
DP_Ph1_PQLoadCS.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
15
16namespace CPS {
17namespace DP {
18namespace Ph1 {
21class PQLoadCS : public CompositePowerComp<Complex>,
22 public SharedFactory<PQLoadCS> {
23protected:
25 std::shared_ptr<DP::Ph1::CurrentSource> mSubCurrentSource;
27 void updateSetPoint();
28 void updateIntfValues();
29
30public:
34
37 Logger::Level logLevel = Logger::Level::off);
39 PQLoadCS(String name, Logger::Level logLevel = Logger::Level::off);
41 PQLoadCS(String name, Real activePower, Real reactivePower, Real volt,
42 Logger::Level logLevel = Logger::Level::off);
44 PQLoadCS(String uid, String name, Real activePower, Real reactivePower,
45 Real nomVolt, Logger::Level logLevel = Logger::Level::off);
46
47 void setParameters(Real activePower, Real reactivePower, Real nomVolt);
49
50 // #### General ####
52 void createSubComponents() override;
54 void initializeParentFromNodesAndTerminals(Real frequency) override;
55
56 // #### MNA section ####
58 void mnaParentPreStep(Real time, Int timeStepCount) override;
59 void mnaParentPostStep(Real time, Int timeStepCount,
60 Attribute<Matrix>::Ptr &leftVector) override;
61
63 AttributeBase::List &prevStepDependencies,
64 AttributeBase::List &attributeDependencies,
65 AttributeBase::List &modifiedAttributes) override;
66 void
68 AttributeBase::List &attributeDependencies,
69 AttributeBase::List &modifiedAttributes,
70 Attribute<Matrix>::Ptr &leftVector) override;
71};
72} // namespace Ph1
73} // namespace DP
74} // 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)
PQLoadCS(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre and post step operations.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
SimPowerComp< Complex >::Ptr clone(String name) override
DEPRECATED: Delete method.
void createSubComponents() override
Constructs and registers MNA subcomponents; idempotent.
void updateSetPoint()
True after createSubComponents() runs; prevents double-construction.
const Attribute< Real >::Ptr mActivePower
std::shared_ptr< DP::Ph1::CurrentSource > mSubCurrentSource
Internal current source.
void setParameters(Real activePower, Real reactivePower, Real nomVolt)
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
const Attribute< Real >::Ptr mReactivePower
const Attribute< Real >::Ptr mNomVoltage
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61