File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -151,22 +151,22 @@ end
151
151
@variables x= 0.25 y= 0.125
152
152
a = sin (x^ 2 - 4 x + 1 )
153
153
b = cos (3 log (y) + 4 )
154
- @mtkbuild sys = NonlinearSystem ([(a^ 2 - 4 a * b + 4 b ^ 2 ) / (a - 0.25 ) ~ 0
154
+ @mtkbuild sys = NonlinearSystem ([(a^ 2 - 5 a * b + 6 b ^ 2 ) / (a - 0.25 ) ~ 0
155
155
(a^ 2 - 0.75 a + 0.125 ) ~ 0 ])
156
156
prob = HomotopyContinuationProblem (sys, [])
157
157
@test prob[x] ≈ 0.25
158
158
@test prob[y] ≈ 0.125
159
159
sol = solve (prob, allrootsalg). u[1 ]
160
160
@test SciMLBase. successful_retcode (sol)
161
161
@test sol[a]≈ 0.5 atol= 1e-6
162
- @test sol[b]≈ 0.25 atol= 1e-6
162
+ @test isapprox ( sol[b], 0.25 ; atol = 1e-6 ) || isapprox (sol[b], 0.5 / 3 ; atol = 1e-6 )
163
163
end
164
164
165
165
@testset " Rational functions" begin
166
166
@variables x= 2.0 y= 2.0
167
- @parameters n = 4
167
+ @parameters n = 5
168
168
@mtkbuild sys = NonlinearSystem ([
169
- 0 ~ (x^ 2 - n * x + n ) * (x - 1 ) / (x - 2 ) / (x - 3 )
169
+ 0 ~ (x^ 2 - n * x + 6 ) * (x - 1 ) / (x - 2 ) / (x - 3 )
170
170
])
171
171
prob = HomotopyContinuationProblem (sys, [])
172
172
sol = solve_allroots_closest (prob)
184
184
0 ~ ((y - 3 ) / (y - 4 )) * (n / (y - 5 )) + ((x - 1.5 ) / (x - 5.5 ))^ 2
185
185
],
186
186
[x, y],
187
- [n])
187
+ [n]; defaults = [n => 4 ] )
188
188
sys = complete (sys)
189
189
prob = HomotopyContinuationProblem (sys, [])
190
190
sol = solve (prob, singlerootalg)
You can’t perform that action at this time.
0 commit comments