25
25
nl_prob = NonlinearProblem (steady_state_network_1, u0, p)
26
26
27
27
# Solves it using standard algorithm and simulation based algorithm.
28
- sol1 = solve (nl_prob, LevenbergMarquardt () ; abstol= 1e-12 , reltol= 1e-12 ). u
28
+ sol1 = solve (nl_prob; abstol= 1e-12 , reltol= 1e-12 ). u
29
29
sol2 = solve (nl_prob, DynamicSS (Rosenbrock23 (); abstol= 1e-12 , reltol= 1e-12 ); abstol= 1e-12 , reltol= 1e-12 ). u
30
30
31
31
# Tests solutions are correct.
54
54
nl_prob = NonlinearProblem (steady_state_network_2, u0, p)
55
55
56
56
# Solves it using standard algorithm and simulation based algorithm.
57
- sol1 = solve (nl_prob, LevenbergMarquardt () ; abstol= 1e-12 , reltol= 1e-12 ). u
57
+ sol1 = solve (nl_prob; abstol= 1e-12 , reltol= 1e-12 ). u
58
58
sol2 = solve (nl_prob, DynamicSS (Rosenbrock23 (); abstol= 1e-12 , reltol= 1e-12 ); abstol= 1e-12 , reltol= 1e-12 ). u
59
59
60
60
# Computes NonlinearFunction (manually and automatically).
90
90
nl_prob_2 = NonlinearProblem (steady_state_network_3, u0, p)
91
91
92
92
# Solves it using standard algorithm and simulation based algorithm.
93
- sol1 = solve (nl_prob_1, LevenbergMarquardt () ; abstol= 1e-12 , reltol= 1e-12 )
93
+ sol1 = solve (nl_prob_1; abstol= 1e-12 , reltol= 1e-12 )
94
94
sol2 = solve (nl_prob_2, DynamicSS (Rosenbrock23 (); abstol= 1e-12 , reltol= 1e-12 ); abstol= 1e-12 , reltol= 1e-12 )
95
95
96
96
# Checks output using NonlinearFunction.
97
97
nfunc = NonlinearFunction (convert (NonlinearSystem, steady_state_network_3))
98
98
@test isapprox (nfunc ([sol1[X], sol1[Y], sol1[Y2], sol1[XY2]], last .(p)), [0.0 , 0.0 , 0.0 , 0.0 ]; atol= 1e-10 )
99
99
@test isapprox (nfunc ([sol2[X], sol2[Y], sol2[Y2], sol2[XY2]], last .(p)), [0.0 , 0.0 , 0.0 , 0.0 ]; atol= 1e-10 )
100
- end
100
+ end
0 commit comments