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:
26 Real nominalVoltageAt(UInt terminal) const {
27 return terminal == 0 ? mNominalVoltagePrimary : mNominalVoltageSecondary;
28 }
29
38
39 explicit Transformer(CPS::AttributeList::Ptr attributeList)
40 : mRatedPower(attributeList->create<Real>("S")),
41 mRatio(attributeList->create<Complex>("ratio")),
42 mResistance(attributeList->create<Real>("R")),
43 mInductance(attributeList->create<Real>("L")){};
44
46 void setParameters(Real nomVoltagePrimary, Real nomVoltageSecondary,
47 Real ratioAbs, Real ratioPhase, Real resistance,
48 Real inductance) {
49 mNominalVoltagePrimary = nomVoltagePrimary;
50 mNominalVoltageSecondary = nomVoltageSecondary;
51 **mRatio = std::polar<Real>(ratioAbs, ratioPhase);
52 **mResistance = resistance;
53 **mInductance = inductance;
54 }
55};
56} // namespace Ph1
57} // namespace Base
58} // namespace CPS
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:249
std::shared_ptr< AttributeList > Ptr
const Attribute< Real >::Ptr mRatedPower
Rated Apparent Power [VA].
Transformer(CPS::AttributeList::Ptr attributeList)
const Attribute< Real >::Ptr mInductance
Inductance [H].
void setParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
Real mNominalVoltageSecondary
Nominal voltage of secondary side.
const Attribute< Real >::Ptr mResistance
Resistance [Ohm].
Real mNominalVoltagePrimary
Nominal voltage of primary side.
Real nominalVoltageAt(UInt terminal) const
Nominal voltage of the winding at the given terminal.
const Attribute< Complex >::Ptr mRatio
Complex transformer ratio.
double Real
Definition Definitions.h:60
std::complex< Real > Complex
Definition Definitions.h:61
unsigned int UInt
Definition Definitions.h:58