Commit 1bb9b8b9 authored by Frank Hellmann's avatar Frank Hellmann
Browse files

small bug fixed

parent 6effaf24
from __future__ import division
import numpy as np import numpy as np
import complex_current_and_nodes as ccn import complex_current_and_nodes as ccn
from scipy.optimize import root from scipy.optimize import root
...@@ -44,7 +45,7 @@ if __name__ == "__main__": ...@@ -44,7 +45,7 @@ if __name__ == "__main__":
# define system of gde # define system of gde
rhs = ccn.define_network_rhs(node_list,Y) rhs = ccn.define_network_rhs(node_list,Y)
# define system of algebraic equations for usage in root (fixed point) finding algorithm # 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 # find fixed point using scipy.root
# Attention! For these systems the .success flag fails to accurately reflect the algorithms success use instead: # Attention! For these systems the .success flag fails to accurately reflect the algorithms success use instead:
# the indicator used here. # the indicator used here.
...@@ -68,7 +69,7 @@ if __name__ == "__main__": ...@@ -68,7 +69,7 @@ if __name__ == "__main__":
# perturb system to # perturb system to
# - check stability of fixed point (i.e. see if it will return to fixed point) # - 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) # - 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 ) / 100 * 0 perturbation = (np.random.rand(len(node_list) * 3) - 0.5 ) / 10
print('\nCausing perturbation:\n{}'.format(perturbation)) print('\nCausing perturbation:\n{}'.format(perturbation))
# solve system dynamics # solve system dynamics
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment