File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 + 2 z + 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
You can’t perform that action at this time.
0 commit comments