@@ -155,35 +155,35 @@ newdaesys = structural_simplify(daesys)
155
155
@test equations (newdaesys) == [D (x) ~ z; 0 ~ y + sin (z) - p * t]
156
156
@test equations (tearing_substitution (newdaesys)) == [D (x) ~ z; 0 ~ x + sin (z) - p * t]
157
157
@test isequal (states (newdaesys), [x, z])
158
- @test_deprecated ODAEProblem (newdaesys, [x => 1.0 ], (0 , 1.0 ), [p => 0.2 ])
159
- prob = ODEProblem (newdaesys, [x => 1.0 ], (0 , 1.0 ), [p => 0.2 ])
160
- du = [0.0 ];
161
- u = [1.0 ];
158
+ @test_deprecated ODAEProblem (newdaesys, [x => 1.0 , z => - 0.5 π ], (0 , 1.0 ), [p => 0.2 ])
159
+ prob = ODEProblem (newdaesys, [x => 1.0 , z => - 0.5 π ], (0 , 1.0 ), [p => 0.2 ])
160
+ du = [0.0 , 0.0 ];
161
+ u = [1.0 , - 0.5 π ];
162
162
pr = 0.2 ;
163
163
tt = 0.1 ;
164
164
@test_skip (@ballocated $ (prob. f)($ du, $ u, $ pr, $ tt)) == 0
165
165
prob. f (du, u, pr, tt)
166
- @test du≈ [ - asin (u[ 1 ] - pr * tt) ] atol= 1e-5
166
+ @test du ≈ [u[ 2 ], u[ 1 ] + sin (u[ 2 ]) - pr * tt] atol= 1e-5
167
167
168
168
# test the initial guess is respected
169
169
@named sys = ODESystem (eqs, t, defaults = Dict (z => Inf ))
170
170
infprob = ODEProblem (structural_simplify (sys), [x => 1.0 ], (0 , 1.0 ), [p => 0.2 ])
171
- @test_throws Any infprob. f (du, u , pr, tt)
171
+ @test_throws Any infprob. f (du, infprob . u0 , pr, tt)
172
172
173
- sol1 = solve (prob, Tsit5 () )
173
+ sol1 = solve (prob, RosShamp4 (), reltol = 8e-7 )
174
174
sol2 = solve (ODEProblem {false} ((u, p, t) -> [- asin (u[1 ] - pr * t)],
175
175
[1.0 ],
176
176
(0 , 1.0 ),
177
177
0.2 ), Tsit5 (), tstops = sol1. t, adaptive = false )
178
- @test Array (sol1)≈ Array (sol2) atol= 1e-5
178
+ @test Array (sol1[x] )≈ Array (sol2[ 1 , :] ) atol= 1e-5
179
179
180
180
@test sol1[x] == first .(sol1. u)
181
181
@test sol1[y] == first .(sol1. u)
182
- @test sin .(sol1[z]) .+ sol1[y]≈ pr[1 ] * sol1. t atol= 1e -5
182
+ @test sin .(sol1[z]) .+ sol1[y]≈ pr[1 ] * sol1. t atol= 5e -5
183
183
@test sol1[sin (z) + y]≈ sin .(sol1[z]) .+ sol1[y] rtol= 1e-12
184
184
185
185
@test sol1[y, :] == sol1[x, :]
186
- @test (@. sin (sol1[z, :]) + sol1[y, :])≈ pr * sol1. t atol= 1e -5
186
+ @test (@. sin (sol1[z, :]) + sol1[y, :])≈ pr * sol1. t atol= 5e -5
187
187
188
188
# 1426
189
189
function Translational_Mass (; name, m = 1.0 )
0 commit comments