DPsim
Loading...
Searching...
No Matches
Base_Ph1_Transformer.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
13
14namespace CPS {
15namespace Base {
16namespace Ph1 {
18protected:
23
24public:
33
34 explicit Transformer(CPS::AttributeList::Ptr attributeList)
35 : mRatedPower(attributeList->create<Real>("S")),
36 mRatio(attributeList->create<Complex>("ratio")),
37 mResistance(attributeList->create<Real>("R")),
38 mInductance(attributeList->create<Real>("L")){};
39
41 void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratioAbs,
42 Real ratioPhase, Real resistance, Real inductance) {
43 mNominalVoltageEnd1 = nomVoltageEnd1;
44 mNominalVoltageEnd2 = nomVoltageEnd2;
45 **mRatio = std::polar<Real>(ratioAbs, ratioPhase);
46 **mResistance = resistance;
47 **mInductance = inductance;
48 }
49};
50} // namespace Ph1
51} // namespace Base
52} // namespace CPS
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
std::shared_ptr< AttributeList > Ptr
const Attribute< Real >::Ptr mRatedPower
Rated Apparent Power [VA].
Real mNominalVoltageEnd2
Nominal voltage of secondary side.
Transformer(CPS::AttributeList::Ptr attributeList)
Real mNominalVoltageEnd1
Nominal voltage of primary side.
const Attribute< Real >::Ptr mInductance
Inductance [H].
void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
const Attribute< Real >::Ptr mResistance
Resistance [Ohm].
const Attribute< Complex >::Ptr mRatio
Complex transformer ratio.
double Real
Definition Definitions.h:62
std::complex< Real > Complex
Definition Definitions.h:63