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
379267e9
Commit
379267e9
authored
Jan 15, 2020
by
Felix Wege
Browse files
added setParameters flag
parent
ab23bcf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dependencies/libcps/Include/cps/PowerComponent.h
View file @
379267e9
...
...
@@ -51,6 +51,9 @@ namespace CPS {
/// "Cached" flags for whether the connected nodes are grounded
std
::
vector
<
bool
>
mSimNodeIsGround
;
/// Flag indicating that parameters are set via setParameters() function
bool
parametersSet
=
false
;
public:
typedef
VarType
Type
;
typedef
std
::
shared_ptr
<
PowerComponent
<
VarType
>>
Ptr
;
...
...
Dependencies/libcps/Source/DP/DP_Ph1_RXLoad.cpp
View file @
379267e9
...
...
@@ -32,6 +32,7 @@ DP::Ph1::RXLoad::RXLoad(String uid, String name,
addAttribute
<
Real
>
(
"P"
,
&
mActivePower
,
Flags
::
read
|
Flags
::
write
);
addAttribute
<
Real
>
(
"Q"
,
&
mReactivePower
,
Flags
::
read
|
Flags
::
write
);
addAttribute
<
Real
>
(
"V_nom"
,
&
mNomVoltage
,
Flags
::
read
|
Flags
::
write
);
}
DP
::
Ph1
::
RXLoad
::
RXLoad
(
String
name
,
...
...
@@ -64,11 +65,12 @@ void DP::Ph1::RXLoad::initialize(Matrix frequencies) {
void
DP
::
Ph1
::
RXLoad
::
initializeFromPowerflow
(
Real
frequency
)
{
checkForUnconnectedTerminals
();
mActivePower
=
mTerminals
[
0
]
->
singleActivePower
();
mReactivePower
=
mTerminals
[
0
]
->
singleReactivePower
();
mPower
=
{
mActivePower
,
mReactivePower
};
mNomVoltage
=
std
::
abs
(
mTerminals
[
0
]
->
initialSingleVoltage
());
if
(
!
parametersSet
){
mActivePower
=
mTerminals
[
0
]
->
singleActivePower
();
mReactivePower
=
mTerminals
[
0
]
->
singleReactivePower
();
mPower
=
{
mActivePower
,
mReactivePower
};
mNomVoltage
=
std
::
abs
(
mTerminals
[
0
]
->
initialSingleVoltage
());
}
if
(
mActivePower
!=
0
)
{
mResistance
=
std
::
pow
(
mNomVoltage
,
2
)
/
mActivePower
;
...
...
@@ -122,6 +124,8 @@ void DP::Ph1::RXLoad::setParameters(Real activePower, Real reactivePower, Real v
mReactivePower
=
reactivePower
;
mPower
=
{
mActivePower
,
mReactivePower
};
mNomVoltage
=
volt
;
parametersSet
=
true
;
}
...
...
Felix Wege
@felix.wege
mentioned in commit
23da7fb8
·
Feb 13, 2020
mentioned in commit
23da7fb8
mentioned in commit 23da7fb85d4311e4a2361e79e946cad395738fa6
Toggle commit list
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