Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Simulation and Optimization
DPsim
DPsim
Commits
1ed5bb31
Commit
1ed5bb31
authored
Feb 19, 2020
by
Markus Mirz
Browse files
add powerflow cim example
parent
f93d6a62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Examples/Cxx/CIM/powerflow-cim.cpp
0 → 100644
View file @
1ed5bb31
/**
* @author Jan Dinkelbach <jdinkelbach@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
*
* DPsim
*
* 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 <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include
"cps/CIM/Reader.h"
#include
<DPsim.h>
using
namespace
std
;
using
namespace
DPsim
;
using
namespace
CPS
;
using
namespace
CPS
::
CIM
;
/*
* This example runs the powerflow for the CIGRE MV benchmark system (neglecting the tap changers of the transformers)
*/
int
main
(
int
argc
,
char
**
argv
){
// Find CIM files
std
::
list
<
fs
::
path
>
filenames
;
filenames
=
std
::
list
<
fs
::
path
>
(
argv
+
2
,
argv
+
argc
);
String
simName
=
argv
[
1
];
CPS
::
Real
system_freq
=
50
;
CIM
::
Reader
reader
(
simName
,
Logger
::
Level
::
info
,
Logger
::
Level
::
off
);
SystemTopology
system
=
reader
.
loadCIM
(
system_freq
,
filenames
,
CPS
::
Domain
::
SP
);
auto
logger
=
DPsim
::
DataLogger
::
make
(
simName
);
for
(
auto
node
:
system
.
mNodes
)
{
logger
->
addAttribute
(
node
->
name
()
+
".V"
,
node
->
attribute
(
"v"
));
}
Simulation
sim
(
simName
,
system
,
1
,
1
,
Domain
::
SP
,
Solver
::
Type
::
NRP
,
Logger
::
Level
::
debug
,
true
);
sim
.
addLogger
(
logger
);
sim
.
run
();
return
0
;
}
Examples/Cxx/CMakeLists.txt
View file @
1ed5bb31
...
...
@@ -105,7 +105,8 @@ if(WITH_CIM)
CIM/case145.cpp
CIM/case300.cpp
CIM/case9.cpp
CIM/case14.cpp
CIM/case14.cpp
CIM/powerflow-cim.cpp
CIM/WSCC_9bus_mult_decoupled.cpp
CIM/WSCC_9bus_mult_coupled.cpp
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment