Commit 4c272ecc authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

support previous version of PV attribute logging for unchanged EMT examples

parent 5f8ba81b
......@@ -90,7 +90,7 @@ int main(int argc, char** argv){
// log output of PV connected at N11
String pv_name = "pv_N11";
auto pv = systemDP.component<CPS::SimPowerComp<Complex>>(pv_name);
Examples::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVDecomposedAttributes(logger, pv);
Simulation sim(simName, systemDP, timeStep, finalTime, Domain::DP, Solver::Type::MNA, Logger::Level::debug, true);
......
......@@ -87,7 +87,7 @@ int main(int argc, char** argv){
// log output of PV connected at N11
String pv_name = "pv_N11";
auto pv = systemDP.component<CPS::SimPowerComp<Complex>>(pv_name);
Examples::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVDecomposedAttributes(logger, pv);
// // load step sized relative to nominal load at N11
// std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("N11", 2-timeStep, 5*systemPF.component<CPS::SP::Ph1::Load>("LOAD-H-11")->attribute<CPS::Real>("P")->get(), systemDP, Domain::DP, logger);
......
......@@ -122,7 +122,7 @@ int main(int argc, char* argv[]) {
loggerDP->addAttribute("v1", n1DP->attribute("v"));
loggerDP->addAttribute("v2", n2DP->attribute("v"));
Examples::CIGREMV::logPVAttributes(loggerDP, pv);
Examples::CIGREMV::logPVDecomposedAttributes(loggerDP, pv);
// load step sized in absolute terms
std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("n2", 1-timeStepDP, 100.0e3, systemDP, Domain::DP, loggerDP);
......
......@@ -157,6 +157,29 @@ namespace CIGREMV {
}
void logPVAttributes(DPsim::DataLogger::Ptr logger, CPS::TopologicalPowerComp::Ptr pv) {
// state variables
logger->addAttribute(pv->name() + "_state_" + "theta", pv->attribute("theta"));
logger->addAttribute(pv->name() + "_state_" + "phipll", pv->attribute("phipll"));
logger->addAttribute(pv->name() + "_state_" + "p", pv->attribute("p"));
logger->addAttribute(pv->name() + "_state_" + "q", pv->attribute("q"));
logger->addAttribute(pv->name() + "_state_" + "phid", pv->attribute("phid"));
logger->addAttribute(pv->name() + "_state_" + "phiq", pv->attribute("phiq"));
logger->addAttribute(pv->name() + "_state_" + "gammad", pv->attribute("gammad"));
logger->addAttribute(pv->name() + "_state_" + "gammaq", pv->attribute("gammaq"));
// input variables
logger->addAttribute(pv->name() + "_input_" + "Vcdq", pv->attribute("Vcdq"));
logger->addAttribute(pv->name() + "_input_" + "Ircdq", pv->attribute("Ircdq"));
// output variables
logger->addAttribute(pv->name() + "_output_" + "Vsdq", pv->attribute("Vsdq"));
// interface variables
logger->addAttribute(pv->name() + "_v_intf", pv->attribute("v_intf"));
logger->addAttribute(pv->name() + "_i_intf", pv->attribute("i_intf"));
}
void logPVDecomposedAttributes(DPsim::DataLogger::Ptr logger, CPS::TopologicalPowerComp::Ptr pv) {
// power controller
std::vector<String> inputNames = { pv->name() + "_powerctrl_input_pref", pv->name() + "_powerctrl_input_qref",
......
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