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
559c9d16
Commit
559c9d16
authored
May 08, 2017
by
Georg Martin Reinke
Browse files
implement getCurrent for more components
Former-commit-id:
72c90bac
parent
f96576dc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Source/Components/InterfacedInductor.cpp
View file @
559c9d16
...
...
@@ -57,3 +57,6 @@ void InterfacedInductor::postStep(SystemModel& system) {
mVoltageIm
=
vposi
-
vnegi
;
}
Complex
InterfacedInductor
::
getCurrent
(
SystemModel
&
system
)
{
return
Complex
(
mCurrentRe
,
mCurrentIm
);
}
Source/Components/InterfacedInductor.h
View file @
559c9d16
...
...
@@ -24,6 +24,8 @@ namespace DPsim {
void
applyRightSideVectorStamp
(
SystemModel
&
system
)
{
}
void
step
(
SystemModel
&
system
,
Real
time
);
void
postStep
(
SystemModel
&
system
);
Complex
getCurrent
(
SystemModel
&
system
);
};
}
#endif
Source/Components/RxLine.cpp
View file @
559c9d16
...
...
@@ -211,3 +211,7 @@ void RxLine::postStep(SystemModel& system) {
}
}
Complex
RxLine
::
getCurrent
(
SystemModel
&
system
)
{
return
Complex
(
mCurrRe
,
mCurrIm
);
}
Source/Components/RxLine.h
View file @
559c9d16
...
...
@@ -46,7 +46,8 @@ namespace DPsim {
void
applyRightSideVectorStamp
(
SystemModel
&
system
)
{
}
void
step
(
SystemModel
&
system
,
Real
time
);
void
postStep
(
SystemModel
&
system
);
Complex
getCurrent
(
SystemModel
&
system
);
};
}
#endif
\ No newline at end of file
#endif
Source/Components/VoltSourceRes.cpp
View file @
559c9d16
...
...
@@ -44,3 +44,17 @@ void VoltSourceRes::step(SystemModel& system, Real time) {
system
.
addCompToRightSideVector
(
mNode2
,
-
mCurrentr
,
-
mCurrenti
);
}
}
Complex
VoltSourceRes
::
getCurrent
(
SystemModel
&
system
)
{
Real
real
=
mCurrentr
;
Real
imag
=
mCurrenti
;
if
(
mNode1
>=
0
)
{
real
+=
system
.
getRealFromLeftSideVector
(
mNode1
)
*
mConductance
;
imag
+=
system
.
getImagFromLeftSideVector
(
mNode1
)
*
mConductance
;
}
if
(
mNode2
>=
0
)
{
real
-=
system
.
getRealFromLeftSideVector
(
mNode2
)
*
mConductance
;
imag
-=
system
.
getImagFromLeftSideVector
(
mNode2
)
*
mConductance
;
}
return
Complex
(
real
,
imag
);
}
Source/Components/VoltSourceRes.h
View file @
559c9d16
...
...
@@ -48,6 +48,8 @@ namespace DPsim {
void
step
(
SystemModel
&
system
,
Real
time
);
void
postStep
(
SystemModel
&
system
)
{
}
Complex
getCurrent
(
SystemModel
&
system
);
};
}
#endif
Source/Components/VoltSourceResFreq.cpp
View file @
559c9d16
...
...
@@ -42,7 +42,6 @@ void VoltSourceResFreq::applyRightSideVectorStamp(SystemModel& system) {
}
}
void
VoltSourceResFreq
::
step
(
SystemModel
&
system
,
Real
time
)
{
if
(
time
>=
mSwitchTime
&&
time
<
mSwitchTime
+
mRampTime
)
{
Real
fadeInOut
=
0.5
+
0.5
*
sin
((
time
-
mSwitchTime
)
/
mRampTime
*
PI
+
-
PI
/
2
);
...
...
@@ -72,3 +71,17 @@ void VoltSourceResFreq::step(SystemModel& system, Real time) {
system
.
addCompToRightSideVector
(
mNode2
,
-
mCurrentr
,
-
mCurrenti
);
}
}
Complex
VoltSourceResFreq
::
getCurrent
(
SystemModel
&
system
)
{
Real
real
=
mCurrentr
;
Real
imag
=
mCurrenti
;
if
(
mNode1
>=
0
)
{
real
+=
system
.
getRealFromLeftSideVector
(
mNode1
)
*
mConductance
;
imag
+=
system
.
getImagFromLeftSideVector
(
mNode1
)
*
mConductance
;
}
if
(
mNode2
>=
0
)
{
real
-=
system
.
getRealFromLeftSideVector
(
mNode2
)
*
mConductance
;
imag
-=
system
.
getImagFromLeftSideVector
(
mNode2
)
*
mConductance
;
}
return
Complex
(
real
,
imag
);
}
Source/Components/VoltSourceResFreq.h
View file @
559c9d16
...
...
@@ -32,6 +32,7 @@ namespace DPsim {
void
applyRightSideVectorStamp
(
SystemModel
&
system
);
void
step
(
SystemModel
&
system
,
Real
time
);
void
postStep
(
SystemModel
&
system
)
{
}
Complex
getCurrent
(
SystemModel
&
system
);
};
}
...
...
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