Commit 811f480b by Markus Mirz

### Merge branch 'merge-jzh-comps' into 'master'

Merge jzh comps

See merge request !72
parents 6ac46f08 d9fa8e8e
 ... ... @@ -31,6 +31,7 @@ \include{content/introduction} \include{content/dynamic_phasors} \include{content/nodal_analysis} \include{content/powerflow} \chapter{Models} \include{content/branches} ... ...
 \chapter{Appendix} \section{Implementatory Aspects} \begin{itemize} \item Pre-Step \begin{itemize} \item To calculate from the solutions of $k$ (e.g. $V_L(k)$ and $I_L(k)$), values required for $k+1$ (e.g. $A_L(k+1)$) \end{itemize} \item Step \begin{itemize} \item Calculate the system solution for $k+1$ \end{itemize} \item Post-Step \begin{itemize} \item To deduce from the $k+1$ solution (e.g. $V_L(k+1)$) further $k+1$ quantities (e.g. $I_L(k+1)$) \item Note: no update of $A_L$ yet, as it remains set to the value on which the $k+1$ solution is based \end{itemize} \end{itemize} \section{Per Unit System} The per unit system is defined by the power rating $S_{base}$, voltage $V_{base}$ and nominal frequency $f_{base}$. It should be noted that the power rating could be defined for three-phase or single-phase and the voltage could be peak or RMS and phase-to-neutral or phase-to-phase. ... ...
This diff is collapsed.
 ... ... @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) { Reader reader("cimviz", Logger::Level::info); std::list filenames; std::list filenames; for (i = 0; gvc->input_filenames[i]; i++) { filenames.emplace_back(gvc->input_filenames[i]); } ... ...
 ... ... @@ -404,6 +404,24 @@ namespace Flags { }; return Attribute::make(get, mFlags, shared_from_this()); } Attribute::Ptr coeffMag(Index row, Index col) { Attribute::Getter get = [this, row, col]() -> Real { return Math::abs(this->get()(row,col)); }; return Attribute::make(get, mFlags, shared_from_this()); //Complex *ptr = &mValue->data()[mValue->cols() * row + col]; // Column major //Real *realPart = &reinterpret_cast(ptr)[0]; //return Attribute::make(&realPart, mFlags, shared_from_this()); } Attribute::Ptr coeffPhase(Index row, Index col) { Attribute::Getter get = [this, row, col]() -> Real { return Math::phase(this->get()(row,col)); }; return Attribute::make(get, mFlags, shared_from_this()); } }; template<> ... ...
 /** * @file * @author Markus Mirz * @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC * * CPowerSystems * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . *********************************************************************************/ #pragma once #include namespace CPS { namespace Base { namespace Ph3 { class PiLine { protected: /// Resistance along the line [ohms] Matrix mSeriesRes; /// Conductance along the line [S] Matrix mSeriesCond; /// Inductance along the line [H] Matrix mSeriesInd; /// Resistance in parallel to the line [ohms] Matrix mParallelRes; /// Conductance in parallel to the line [S] Matrix mParallelCond; /// Capacitance in parallel to the line [F] Matrix mParallelCap; public: /// void setParameters(Matrix seriesResistance, Matrix seriesInductance, Matrix parallelCapacitance = Matrix::Zero(3,3), Matrix parallelConductance = Matrix::Zero(3,3)) { mSeriesRes = seriesResistance; mSeriesCond = mSeriesRes.inverse(); mSeriesInd = seriesInductance; mParallelCond = parallelConductance; mParallelRes = mParallelCond.inverse(); mParallelCap = parallelCapacitance; } }; } } }
 ... ... @@ -40,7 +40,7 @@ namespace Ph3 { void setParameters(Matrix openResistance, Matrix closedResistance, Bool closed = false) { mOpenResistance = openResistance; mClosedResistance = closedResistance; mIsClosed = closed; mSwitchClosed = closed; } void closeSwitch() { mSwitchClosed = true; } void openSwitch() { mSwitchClosed = false; } ... ...
 /** * @file * @author Markus Mirz * @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC * * CPowerSystems * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . *********************************************************************************/ #pragma once #include namespace CPS { namespace Base { namespace Ph3 { class Transformer { protected: /// Transformer ratio Complex mRatio; /// Resistance [Ohm] Matrix mResistance; /// Inductance [H] Matrix mInductance; public: /// void setParameters(Real ratioAbs, Real ratioPhase, Matrix resistance, Matrix inductance) { mRatio = std::polar(ratioAbs, ratioPhase); mResistance = resistance; mInductance = inductance; } }; } } }
 ... ... @@ -24,8 +24,6 @@ #include #include #include namespace fs = std::experimental::filesystem; #include #include #include ... ... @@ -63,6 +61,9 @@ namespace IEC61970 { class EnergyConsumer; class PowerTransformer; }; namespace Equivalents { class EquivalentShunt; } namespace Topology { class TopologicalNode; }; ... ... @@ -107,6 +108,8 @@ namespace CIM { /// Resolves unit multipliers. static Real unitValue(Real value, IEC61970::Base::Domain::UnitMultiplier mult); /// Matrix singlePhaseParameterToThreePhase(Real parameter); /// void processSvVoltage(IEC61970::Base::StateVariables::SvVoltage* volt); /// void processSvPowerFlow(IEC61970::Base::StateVariables::SvPowerFlow* flow); ... ... @@ -114,9 +117,9 @@ namespace CIM { template void processTopologicalNode(IEC61970::Base::Topology::TopologicalNode* topNode); /// void addFiles(const fs::path &filename); void addFiles(const std::experimental::filesystem::path &filename); /// Adds CIM files to list of files to be parsed. void addFiles(const std::list &filenames); void addFiles(const std::list &filenames); /// First, go through all topological nodes and collect them in a list. /// Since all nodes have references to the equipment connected to them (via Terminals), but not /// the other way around (which we need for instantiating the components), we collect that information here as well. ... ... @@ -148,6 +151,8 @@ namespace CIM { /// Returns an external grid injection. Component::Ptr mapExternalNetworkInjection(IEC61970::Base::Wires::ExternalNetworkInjection* extnet); /// Returns a shunt Component::Ptr mapEquivalentShunt(IEC61970::Base::Equivalents::EquivalentShunt *shunt); public: /// enum GeneratorType{Static, Transient}; ... ... @@ -161,9 +166,9 @@ namespace CIM { /// virtual ~Reader(); /// Parses data from CIM files into the CPS data structure SystemTopology loadCIM(Real systemFrequency, const fs::path &filename, Domain domain = Domain::DP, PhaseType phase = PhaseType::Single); SystemTopology loadCIM(Real systemFrequency, const std::experimental::filesystem::path &filename, Domain domain = Domain::DP, PhaseType phase = PhaseType::Single); /// Parses data from CIM files into the CPS data structure SystemTopology loadCIM(Real systemFrequency, const std::list &filenames, Domain domain = Domain::DP, PhaseType phase = PhaseType::Single); SystemTopology loadCIM(Real systemFrequency, const std::list &filenames, Domain domain = Domain::DP, PhaseType phase = PhaseType::Single); /// writing state variable voltage of nodes from the another SystemTopology, which has the same topology but modeled in different domain void writeSvVoltageFromStaticSysTopology(SystemTopology& sysStatic, SystemTopology& sysDynamic); }; ... ...