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
f86f0520
Commit
f86f0520
authored
Sep 18, 2018
by
Steffen Vogel
🎅🏼
Browse files
examples: fix attribute names
parent
f7d82e7b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Examples/Cxx/Shmem/ShmemControllableSource.cpp
View file @
f86f0520
...
@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
...
@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
ecs
->
connect
({
Node
::
GND
,
n1
});
ecs
->
connect
({
Node
::
GND
,
n1
});
r1
->
connect
({
Node
::
GND
,
n1
});
r1
->
connect
({
Node
::
GND
,
n1
});
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
i
_ref"
),
0
);
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
I
_ref"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
n1
},
SystemComponentList
{
ecs
,
r1
});
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
n1
},
SystemComponentList
{
ecs
,
r1
});
...
...
Examples/Cxx/Shmem/ShmemDistributedDirect.cpp
View file @
f86f0520
...
@@ -76,7 +76,7 @@ int main(int argc, char *argv[]) {
...
@@ -76,7 +76,7 @@ int main(int argc, char *argv[]) {
vs1
->
connect
({
Node
::
GND
,
n1
});
vs1
->
connect
({
Node
::
GND
,
n1
});
r01
->
connect
({
n1
,
n2
});
r01
->
connect
({
n1
,
n2
});
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
v
_ref"
),
0
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
V
_ref"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
n1
,
n2
},
SystemComponentList
{
evs
,
vs1
,
r01
});
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
n1
,
n2
},
SystemComponentList
{
evs
,
vs1
,
r01
});
...
@@ -99,7 +99,7 @@ int main(int argc, char *argv[]) {
...
@@ -99,7 +99,7 @@ int main(int argc, char *argv[]) {
//auto ecs_switch = CurrentSource::make("i_switch", GND, 1, Complex(0, 0));
//auto ecs_switch = CurrentSource::make("i_switch", GND, 1, Complex(0, 0));
//auto r01 = Resistor::make("r_0_1", 0, 1, 1);
//auto r01 = Resistor::make("r_0_1", 0, 1, 1);
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
i
_ref"
),
0
);
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
I
_ref"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
//intf.addImport(ecs_switch->attribute('CurrentRef'), 1);
//intf.addImport(ecs_switch->attribute('CurrentRef'), 1);
...
...
Examples/Cxx/Shmem/ShmemDistributedVillas.cpp
View file @
f86f0520
...
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
...
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
comps
=
SystemComponentList
{
evs
,
vs
,
l1
,
r1
};
comps
=
SystemComponentList
{
evs
,
vs
,
l1
,
r1
};
nodes
=
SystemNodeList
{
Node
::
GND
,
n1
,
n2
,
n3
};
nodes
=
SystemNodeList
{
Node
::
GND
,
n1
,
n2
,
n3
};
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
v
_ref"
),
0
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
V
_ref"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
}
}
else
if
(
String
(
argv
[
1
])
==
"1"
)
{
else
if
(
String
(
argv
[
1
])
==
"1"
)
{
...
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
...
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
comps
=
SystemComponentList
{
ecs
,
sw
,
r2A
,
r2B
};
comps
=
SystemComponentList
{
ecs
,
sw
,
r2A
,
r2B
};
nodes
=
SystemNodeList
{
Node
::
GND
,
n4
,
n5
};
nodes
=
SystemNodeList
{
Node
::
GND
,
n4
,
n5
};
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
i
_ref"
),
0
);
intf
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
I
_ref"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
intf
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
}
}
else
{
else
{
...
...
Examples/Cxx/Shmem/ShmemExample.cpp
View file @
f86f0520
...
@@ -60,7 +60,7 @@ int main(int argc, char* argv[])
...
@@ -60,7 +60,7 @@ int main(int argc, char* argv[])
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
Node
::
GND
,
n1
,
n2
,
n3
,
n4
},
SystemComponentList
{
evs
,
rs
,
rl
,
ll
,
rL
});
auto
sys
=
SystemTopology
(
50
,
SystemNodeList
{
Node
::
GND
,
n1
,
n2
,
n3
,
n4
},
SystemComponentList
{
evs
,
rs
,
rl
,
ll
,
rL
});
auto
intf
=
Interface
(
"/villas1-in"
,
"/villas1-out"
);
auto
intf
=
Interface
(
"/villas1-in"
,
"/villas1-out"
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
v
_ref"
),
0
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
V
_ref"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
Real
timeStep
=
0.001
;
Real
timeStep
=
0.001
;
...
...
Examples/Cxx/Shmem/ShmemRealTime.cpp
View file @
f86f0520
...
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
...
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
auto
intf
=
Interface
(
"/villas1-in"
,
"/villas1-out"
,
&
conf
);
auto
intf
=
Interface
(
"/villas1-in"
,
"/villas1-out"
,
&
conf
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
v
_ref"
),
0
);
intf
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
V
_ref"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
intf
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
Real
timeStep
=
0.001
;
Real
timeStep
=
0.001
;
...
...
Examples/Cxx/Shmem/Shmem_WSCC-9bus_CtrlDist.cpp
View file @
f86f0520
...
@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
...
@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
sys
.
mComponents
.
push_back
(
filtP_profile
);
sys
.
mComponents
.
push_back
(
filtP_profile
);
// Register interface current source and voltage drop
// Register interface current source and voltage drop
intf1
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
i
_ref"
),
0
);
intf1
.
addImport
(
ecs
->
attribute
<
Complex
>
(
"
I
_ref"
),
0
);
intf1
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
intf1
.
addExport
(
ecs
->
attribute
<
Complex
>
(
"v_comp"
),
0
);
// TODO: gain by 20e8
// TODO: gain by 20e8
...
@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) {
...
@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) {
// Register voltage source reference and current flowing through source
// Register voltage source reference and current flowing through source
// multiply with -1 to consider passive sign convention
// multiply with -1 to consider passive sign convention
intf1
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
v
_ref"
),
0
);
intf1
.
addImport
(
evs
->
attribute
<
Complex
>
(
"
V
_ref"
),
0
);
// TODO: invalid sign
// TODO: invalid sign
intf1
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
0
);
intf1
.
addExport
(
evs
->
attribute
<
Complex
>
(
"i_comp"
),
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