Skip to content

Commit 4909677

Browse files
test: update test with new simplification result
1 parent ffd73ae commit 4909677

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/nonlinearsystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ sys = structural_simplify(ns; conservative = true)
296296
# system that contains a chain of observed variables when simplified
297297
@variables x y z
298298
eqs = [0 ~ x^2 + 2z + y, z ~ y, y ~ x] # analytical solution x = y = z = 0 or -3
299-
@mtkbuild ns = System(eqs) # solve for y with observed chain z -> x -> y
300-
@test isequal(expand.(calculate_jacobian(ns)), [3 // 2 + y;;])
301-
@test isequal(calculate_hessian(ns), [[1;;]])
299+
@mtkbuild ns = System(eqs) # solve for y with observed chain z -> y -> x
300+
@test isequal(expand.(calculate_jacobian(ns)), [-3 // 2 - x;;])
301+
@test isequal(calculate_hessian(ns), [[-1;;]])
302302
prob = NonlinearProblem(ns, unknowns(ns) .=> -4.0) # give guess < -3 to reach -3
303303
sol = solve(prob, NewtonRaphson())
304304
@test sol[x] sol[y] sol[z] -3

0 commit comments

Comments
 (0)