Commit df8fed89 authored by Markus Mirz's avatar Markus Mirz
Browse files

Merge branch 'development' into 'shared-factory'

# Conflicts:
#   Examples/Cxx/Circuits/DP_IdealVS_PILine1.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_R1.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_R2.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_RLC1.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_RXLine1.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_RXLine2.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_Trafo.cpp
#   Examples/Cxx/Circuits/DP_IdealVS_TrafoIdeal.cpp
#   Examples/Cxx/Circuits/DP_ResVS_PILine1.cpp
#   Examples/Cxx/Circuits/DP_ResVS_RL1.cpp
#   Examples/Cxx/Circuits/DP_ResVS_RL2.cpp
#   Examples/Cxx/Circuits/DP_ResVS_RLC1.cpp
#   Examples/Cxx/Circuits/DP_ResVS_RXLine1.cpp
#   Examples/Cxx/Circuits/EMT_IdealVS_R1.cpp
#   Examples/Cxx/Circuits/EMT_ResVS_RXLine_Switch1.cpp
#   Examples/Cxx/VariableTimeStep/RXLine_LoadStep_FreqStep_1.cpp
#   Examples/Cxx/VariableTimeStep/RXLine_LoadStep_FreqStep_2.cpp
parents 9b2cae5e 6e58914b
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "PiLine1_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", 1, 0, Complex(345, 0)),
Resistor::make("r1", 1, 2, 5),
Capacitor::make("c_1", 2, 0, 0.002),
......@@ -44,7 +44,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "IdealVS1_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_in", 1, 2, Complex(10, 0)),
Resistor::make("r_1", 1, 0, 1),
Resistor::make("r_2", 2, 0, 1),
......@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "IdealVS3_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", 1, 0, Complex(10, 0)),
Resistor::make("r_1", 1, 2, 1),
Resistor::make("r_2", 2, 0, 1),
......@@ -44,7 +44,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "IdealVS2_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_in", 1, 0, Complex(10, 0)),
Resistor::make("r_1", 1, 2, 1),
Capacitor::make("c_1", 2, 3, 0.001),
......@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -32,15 +32,15 @@ int main(int argc, char* argv[])
Real omega = 2.0*M_PI*50.0;
Real finalTime = 0.3;
String simName = "RxLine1_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", 1, 0, Complex(10, 0)),
RxLine::make("Line_1", 1, 2, 0.1, 0.001),
Resistor::make("r_1", 2, 0, 20)
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "RxLine2_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", 1, 0, Complex(10, 0)),
Inductor::make("l_L", 2, 3, 0.001),
Resistor::make("r_L", 1, 2, 0.1),
......@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,14 +33,14 @@ int main(int argc, char* argv[])
Real finalTime = 0.2;
String simName = "IdealVS_Trafo_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", -1, 0, Complex(100, 0), Logger::Level::DEBUG, false),
Transformer::make("trafo_1", 0, 1, 10, 0, 0, 0.001, Logger::Level::DEBUG, false),
Resistor::make("r_1", 1, -1, 1, Logger::Level::DEBUG, false)
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,14 +33,14 @@ int tmpmain(int argc, char* argv[])
Real finalTime = 0.2;
String simName = "IdealVS_TrafoIdeal_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_1", 0, 1, Complex(10, 0)),
TransformerIdeal::make("trafo_1", 1, 2, 10, 0),
Resistor::make("r_1", 2, 0, 1)
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "PiLine2_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSource::make("v_in", 1, 0, Complex(10, 0), 1),
Inductor::make("l_1", 1, 2, 0.02),
Inductor::make("l_2", 2, 0, 0.1),
......@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "Example1_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSource::make("v_in", 1, 0, Complex(10, 0), 1),
Inductor::make("l_1", 1, 2, 0.02),
Inductor::make("l_2", 2, 0, 0.1),
......@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,14 +33,14 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "Example2_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSource::make("v_in", 1, 0, Complex(10, 0), 1),
Inductor::make("l_1", 1, 2, 0.02),
Inductor::make("l_2", 2, 0, 0.1)
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "Example3_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSource::make("v_in", 1, 0, Complex(10, 0), 1),
Capacitor::make("c_1", 1, 2, 0.001),
Inductor::make("l_1", 2, 0, 0.001),
......@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime);
Simulation newSim(simName, comps, omega, timeStep, finalTime);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,20 +33,20 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "RxLineResLoad_" + std::to_string(timeStep);
Components::Base::List circElements0 = {
Components::Base::List comps = {
VoltageSource::make("v_s", 1, 0, Complex(10000, 0), 1),
Resistor::make("r_line", 1, 2, 1),
Inductor::make("l_line", 2, 3, 1)
};
Components::Base::List circElements1 = circElements0;
Components::Base::List circElements2 = circElements0;
circElements1.push_back(std::make_shared<Components::DP::Resistor>("r_load", 3, 0, 1000));
circElements2.push_back(std::make_shared<Components::DP::Resistor>("r_load", 3, 0, 800));
Components::Base::List comps1 = comps0;
Components::Base::List comps2 = comps0;
comps1.push_back(Resistor::make("r_load", 3, 0, 1000));
comps2.push_back(Resistor::make("r_load", 3, 0, 800));
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements1, omega, timeStep, finalTime);
newSim.addSystemTopology(circElements2);
Simulation newSim(simName, comps1, omega, timeStep, finalTime);
newSim.addSystemTopology(comps2);
newSim.setSwitchTime(0.1, 1);
std::cout << "Start simulation." << std::endl;
......
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "IdealVS_EMT_" + std::to_string(timeStep);
Components::Base::List circElements = {
Components::Base::List comps = {
VoltageSourceIdeal::make("v_in", 1, 2, 10),
Resistor::make("r_1", 1, 0, 5),
Resistor::make("r_2", 2, 0, 10),
......@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
};
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements, omega, timeStep, finalTime, Logger::Level::INFO, SimulationType::EMT);
Simulation newSim(simName, comps, omega, timeStep, finalTime, Logger::Level::INFO, SimulationType::EMT);
std::cout << "Start simulation." << std::endl;
newSim.run();
......
......@@ -33,20 +33,20 @@ int main(int argc, char* argv[])
Real finalTime = 0.3;
String simName = "RxLineResLoad_EMT_" + std::to_string(timeStep);
Components::Base::List circElements0 = {
Components::Base::List comps0 = {
VoltageSource::make("v_s", 1, 0, Complex(10000, 0), 1),
Resistor::make("r_line", 1, 2, 1),
Inductor::make("l_line", 2, 3, 1)
};
Components::Base::List circElements1 = circElements0;
Components::Base::List circElements2 = circElements0;
circElements1.push_back(Resistor::make("r_load", 3, 0, 1000));
circElements2.push_back(Resistor::make("r_load", 3, 0, 800));
Components::Base::List comps1 = comps0;
Components::Base::List comps2 = comps0;
comps1.push_back(Resistor::make("r_load", 3, 0, 1000));
comps2.push_back(Resistor::make("r_load", 3, 0, 800));
// Set up simulation and start main simulation loop
Simulation newSim(simName, circElements1, omega, timeStep, finalTime, Logger::Level::INFO, SimulationType::EMT);
newSim.addSystemTopology(circElements2);
Simulation newSim(simName, comps1, omega, timeStep, finalTime, Logger::Level::INFO, SimulationType::EMT);
newSim.addSystemTopology(comps2);
newSim.setSwitchTime(0.1, 1);
std::cout << "Start simulation." << std::endl;
......
......@@ -64,14 +64,14 @@ int main(int argc, char* argv[])
Components::Base::Ptr r2 = Resistor::make("r2", 0, 2, loadRes);
Components::Base::Ptr r3 = Resistor::make("r3", 0, 3, loadRes);
Components::Base::List circElements = { gen, r1, r2, r3 };
Components::Base::List comps = { gen, r1, r2, r3 };
// Set up simulation
Real tf, dt, t;
Real om = 2.0*M_PI*60.0;
tf = 0.1; dt = 0.000001; t = 0;
Int downSampling = 50;
Simulation newSim("SynGen_BalancedResLoad", circElements, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
Simulation newSim("SynGen_BalancedResLoad", comps, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
newSim.setNumericalMethod(NumericalMethod::Trapezoidal_flux);
// Initialize generator
......
......@@ -87,7 +87,7 @@ int main(int argc, char* argv[])
Components::Base::Ptr r2 = Resistor::make("r2", 2, 0, loadRes);
Components::Base::Ptr r3 = Resistor::make("r3", 3, 0, loadRes);
Components::Base::List circElements = { gen, r1, r2, r3 };
Components::Base::List comps = { gen, r1, r2, r3 };
// Declare circuit components for resistance change
Real breakerRes = 1037.8378;
......@@ -95,17 +95,17 @@ int main(int argc, char* argv[])
Components::Base::Ptr rBreaker2 = Resistor::make("rbreak2", 2, 0, breakerRes);
Components::Base::Ptr rBreaker3 = Resistor::make("rbreak3", 3, 0, breakerRes);
Components::Base::List circElementsBreakerOn = { gen, rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
Components::Base::List compsBreakerOn = { gen, rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
// Set up simulation
Real tf, dt, t;
Real om = 2.0*M_PI*60.0;
tf = 10; dt = 0.0001; t = 0;
Int downSampling = 1;
Simulation newSim("DP_SynchronGenerator_ExciterTurbine", circElements, om, dt, tf,
Simulation newSim("DP_SynchronGenerator_ExciterTurbine", comps, om, dt, tf,
Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
newSim.setNumericalMethod(NumericalMethod::Trapezoidal_flux);
newSim.addSystemTopology(circElementsBreakerOn);
newSim.addSystemTopology(compsBreakerOn);
newSim.switchSystemMatrix(0);
// Initialize generator
......
......@@ -75,7 +75,7 @@ int main(int argc, char* argv[])
Components::Base::Ptr r2 = Resistor::make("r2", 2, 0, loadRes);
Components::Base::Ptr r3 = Resistor::make("r3", 3, 0, loadRes);
Components::Base::List circElements = { gen, r1, r2, r3 };
Components::Base::List comps = { gen, r1, r2, r3 };
// Declare circuit components for resistance change
Real breakerRes = 0.001;
......@@ -83,16 +83,16 @@ int main(int argc, char* argv[])
Components::Base::Ptr rBreaker2 = Resistor::make("rbreak2", 2, 0, breakerRes);
Components::Base::Ptr rBreaker3 = Resistor::make("rbreak3", 3, 0, breakerRes);
Components::Base::List circElementsBreakerOn = { gen, rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
Components::Base::List compsBreakerOn = { gen, rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
// Set up simulation
Real tf, dt, t;
Real om = 2.0*M_PI*60.0;
tf = 0.3; dt = 0.000001; t = 0;
Int downSampling = 50;
Simulation newSim("DP_SynGen_SimpThreePhaseFault", circElements, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
Simulation newSim("DP_SynGen_SimpThreePhaseFault", comps, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
newSim.setNumericalMethod(NumericalMethod::Trapezoidal_flux);
newSim.addSystemTopology(circElementsBreakerOn);
newSim.addSystemTopology(compsBreakerOn);
newSim.switchSystemMatrix(0);
// Initialize generator
......
......@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
Components::Base::Ptr r2 = Resistor::make("r2", 2, 0, loadRes);
Components::Base::Ptr r3 = Resistor::make("r3", 3, 0, loadRes);
Components::Base::List circElements = { gen, r1, r2, r3 };
Components::Base::List comps = { gen, r1, r2, r3 };
// Declare circuit components for resistance change
Real breakerRes = 0.001;
......@@ -74,16 +74,16 @@ int main(int argc, char* argv[])
Components::Base::Ptr rBreaker2 = Resistor::make("rbreak2", 2, 0, breakerRes);
Components::Base::Ptr rBreaker3 = Resistor::make("rbreak3", 3, 0, breakerRes);
Components::Base::List circElementsBreakerOn = { rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
Components::Base::List compsBreakerOn = { rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
// Set up simulation
Real tf, dt, t;
Real om = 2.0*M_PI*60.0;
tf = 0.3; dt = 0.000001; t = 0;
Int downSampling = 50;
Simulation newSim("DP_SynGen_ThreePhaseFault", circElements, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
Simulation newSim("DP_SynGen_ThreePhaseFault", comps, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
newSim.setNumericalMethod(NumericalMethod::Trapezoidal_flux);
newSim.addSystemTopology(circElementsBreakerOn);
newSim.addSystemTopology(compsBreakerOn);
newSim.switchSystemMatrix(0);
// Initialize generator
......
......@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
Components::Base::Ptr r2 = Resistor::make("r2", 2, 0, loadRes);
Components::Base::Ptr r3 = Resistor::make("r3", 3, 0, loadRes);
Components::Base::List circElements = { gen, r1, r2, r3 };
Components::Base::List comps = { gen, r1, r2, r3 };
// Declare circuit components for resistance change
Real breakerRes = 0.001;
......@@ -74,16 +74,16 @@ int main(int argc, char* argv[])
Components::Base::Ptr rBreaker2 = Resistor::make("rbreak2", 2, 0, breakerRes);
Components::Base::Ptr rBreaker3 = Resistor::make("rbreak3", 3, 0, breakerRes);
Components::Base::List circElementsBreakerOn = { rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
Components::Base::List compsBreakerOn = { rBreaker1, rBreaker2, rBreaker3, r1, r2, r3 };
// Set up simulation
Real tf, dt, t;
Real om = 2.0*M_PI*60.0;
tf = 0.3; dt = 0.0001; t = 0;
Int downSampling = 1;
Simulation newSim("DP_SynGen_VBR", circElements, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
Simulation newSim("DP_SynGen_VBR", comps, om, dt, tf, Logger::Level::INFO, SimulationType::DynPhasor, downSampling);
newSim.setNumericalMethod(NumericalMethod::Trapezoidal_flux);
newSim.addSystemTopology(circElementsBreakerOn);
newSim.addSystemTopology(compsBreakerOn);
newSim.switchSystemMatrix(0);
// Initialize generator
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment