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
2c68534c
Commit
2c68534c
authored
Sep 17, 2018
by
Markus Mirz
Browse files
update emt ideal vs rl1 example
Former-commit-id:
5c5afa05
parent
189c69b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Examples/Cxx/Circuits/EMT_IdealVS_RL1.cpp
View file @
2c68534c
...
...
@@ -34,9 +34,11 @@ int main(int argc, char* argv[]) {
auto
vs
=
VoltageSource
::
make
(
"vs"
);
vs
->
setParameters
(
Complex
(
10
,
0
),
50
);
vs
->
connect
(
Node
::
List
{
Node
::
GND
,
n1
});
auto
r1
=
Resistor
::
make
(
"r_1"
);
r1
->
setParameters
(
5
);
r1
->
connect
(
Node
::
List
{
n1
,
n2
});
auto
l1
=
Inductor
::
make
(
"l_1"
);
l1
->
setParameters
(
0.02
);
l1
->
connect
(
Node
::
List
{
n2
,
Node
::
GND
});
...
...
@@ -49,7 +51,15 @@ int main(int argc, char* argv[]) {
Real
finalTime
=
0.1
;
String
simName
=
"EMT_IdealVS_RL1"
;
// Logger
auto
logger
=
DataLogger
::
make
(
simName
);
logger
->
addAttribute
(
"v1"
,
n1
->
attribute
(
"voltage"
));
logger
->
addAttribute
(
"v2"
,
n2
->
attribute
(
"voltage"
));
logger
->
addAttribute
(
"i1"
,
r1
->
attribute
(
"i_comp"
));
Simulation
sim
(
simName
,
sys
,
timeStep
,
finalTime
,
Domain
::
EMT
);
sim
.
addLogger
(
logger
);
sim
.
run
();
return
0
;
...
...
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