@@ -786,20 +786,26 @@ end
786786 @testset " Parameter initialization" begin
787787 function test_parameter (prob, alg, param, val)
788788 integ = init (prob, alg)
789- @test integ. ps[param]≈ val rtol= 1e-6
789+ @test integ. ps[param]≈ val rtol= 1e-5
790+ # some algorithms are a little temperamental
790791 sol = solve (prob, alg)
791- @test sol. ps[param]≈ val rtol= 1e-6
792+ @test sol. ps[param]≈ val rtol= 1e-5
792793 @test SciMLBase. successful_retcode (sol)
793794 end
794- @variables x= 1.0 y= 3.0
795- @parameters p q
796795
797- @named sys = NonlinearSystem (
798- [x + y - p ~ 0 , x - q ~ 0 ]; defaults = [q => missing ],
799- guesses = [q => 1.0 ], initialization_eqs = [p^ 2 + q^ 2 + 2 p * q ~ 0 ])
800- sys = complete (sys)
796+ @parameters p= 2.0 q= missing [guess = 1.0 ] c= 1.0
797+ @variables x= 1.0 y= 2.0 z= 3.0
798+
799+ eqs = [0 ~ p * (y - x),
800+ 0 ~ x * (q - z) - y,
801+ 0 ~ x * y - c * z]
802+ @mtkbuild sys = NonlinearSystem (eqs; initialization_eqs = [p^ 2 + q^ 2 + 2 p * q ~ 0 ])
803+ # @mtkbuild sys = NonlinearSystem(
804+ # [p * x^2 + q * y^3 ~ 0, x - q ~ 0]; defaults = [q => missing],
805+ # guesses = [q => 1.0], initialization_eqs = [p^2 + q^2 + 2p * q ~ 0])
806+
801807 for (probT, algs) in prob_alg_combinations
802- prob = probT (sys, [], [p => 2.0 ] )
808+ prob = probT (sys, [])
803809 @test prob. f. initialization_data != = nothing
804810 @test prob. f. initialization_data. initializeprobmap === nothing
805811 for alg in algs
950956 prob2 = remake (prob; u0 = ForwardDiff. Dual .(prob. u0))
951957 @test eltype (state_values (prob2. f. initialization_data. initializeprob)) < :
952958 ForwardDiff. Dual
953- @test eltype (prob2. f. initialization_data. initializeprob. p. tunable) <: ForwardDiff.Dual
959+ @test eltype (prob2. f. initialization_data. initializeprob. p. tunable) < :
960+ ForwardDiff. Dual
954961 @test state_values (prob2. f. initialization_data. initializeprob) ≈
955962 state_values (prob. f. initialization_data. initializeprob)
956963
0 commit comments