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
a6602c4d
Commit
a6602c4d
authored
May 08, 2017
by
Georg Martin Reinke
Browse files
adjust VILLAS example
parent
acfcd68e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Examples/VillasTest.cpp
View file @
a6602c4d
...
...
@@ -11,18 +11,19 @@ void DPsim::villasExample()
Logger
log
,
llog
,
rlog
;
std
::
vector
<
BaseComponent
*>
comps
;
ExternalVoltageSource
*
evs
=
new
ExternalVoltageSource
(
"v
1
"
,
1
,
0
,
1
);
ExternalVoltageSource
*
evs
=
new
ExternalVoltageSource
(
"v
_s
"
,
1
,
0
,
1
);
comps
.
push_back
(
evs
);
comps
.
push_back
(
new
LinearResistor
(
"r1"
,
1
,
2
,
1
));
LinearResistor
*
r2
=
new
LinearResistor
(
"r2"
,
2
,
0
,
1
);
comps
.
push_back
(
r2
);
comps
.
push_back
(
new
LinearResistor
(
"r_s"
,
1
,
2
,
1
));
comps
.
push_back
(
new
LinearResistor
(
"r_line"
,
2
,
3
,
1
));
comps
.
push_back
(
new
Inductor
(
"l_line"
,
3
,
4
,
1
));
comps
.
push_back
(
new
LinearResistor
(
"r_load"
,
4
,
0
,
1000
));
VillasInterface
*
villas
=
new
VillasInterface
(
"/villas1"
);
villas
->
registerVoltageSource
(
evs
,
0
,
1
);
villas
->
registerExportedCurrent
(
evs
,
0
,
1
);
// Set up simulation
Real
timeStep
=
0.01
;
Simulation
newSim
(
comps
,
2.0
*
M_PI
*
50.0
,
timeStep
,
0.
1
,
log
);
Real
timeStep
=
0.
0
01
;
Simulation
newSim
(
comps
,
2.0
*
M_PI
*
50.0
,
timeStep
,
0.
3
,
log
);
newSim
.
addExternalInterface
(
villas
);
// Main Simulation Loop
...
...
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