Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
condynet
PyPSD
Commits
1bb9b8b9
Commit
1bb9b8b9
authored
Dec 11, 2017
by
Frank Hellmann
Browse files
small bug fixed
parent
6effaf24
Changes
1
Hide whitespace changes
Inline
Side-by-side
PSD/complex_current_and_nodes_test.py
View file @
1bb9b8b9
from
__future__
import
division
import
numpy
as
np
import
complex_current_and_nodes
as
ccn
from
scipy.optimize
import
root
...
...
@@ -44,7 +45,7 @@ if __name__ == "__main__":
# define system of gde
rhs
=
ccn
.
define_network_rhs
(
node_list
,
Y
)
# define system of algebraic equations for usage in root (fixed point) finding algorithm
root_rhs
=
ccn
.
define_root_rhs_omega
(
len
(
node_list
)
,
rhs
)
# omega
root_rhs
=
ccn
.
define_root_rhs_omega
(
node_list
,
rhs
)
# omega
# find fixed point using scipy.root
# Attention! For these systems the .success flag fails to accurately reflect the algorithms success use instead:
# the indicator used here.
...
...
@@ -68,7 +69,7 @@ if __name__ == "__main__":
# perturb system to
# - check stability of fixed point (i.e. see if it will return to fixed point)
# - check dynamic behaviour of Nodes (i.e. check for error in calculations or bug in code)
perturbation
=
(
np
.
random
.
rand
(
len
(
node_list
)
*
3
)
-
0.5
)
/
10
0
*
0
perturbation
=
(
np
.
random
.
rand
(
len
(
node_list
)
*
3
)
-
0.5
)
/
10
print
(
'
\n
Causing perturbation:
\n
{}'
.
format
(
perturbation
))
# solve system dynamics
...
...
Write
Preview
Markdown
is supported
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