Skip to content

Commit 38da2cc

Browse files
test: workaround for SciML/NonlinearSolve.jl#586
1 parent 4d2b9c5 commit 38da2cc

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/initializationsystem.jl

+11-6
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,17 @@ end
801801
end
802802

803803
@parameters p=2.0 q=missing [guess = 1.0] c=1.0
804-
@variables x=1.0 y=2.0 z=3.0
805-
806-
eqs = [0 ~ p * (y - x),
807-
0 ~ x * (q - z) - y,
808-
0 ~ x * y - c * z]
809-
@mtkbuild sys = NonlinearSystem(eqs; initialization_eqs = [p^2 + q^2 + 2p * q ~ 0])
804+
@variables x=1.0 z=3.0
805+
806+
# eqs = [0 ~ p * (y - x),
807+
# 0 ~ x * (q - z) - y,
808+
# 0 ~ x * y - c * z]
809+
# specifically written this way due to
810+
# https://github.com/SciML/NonlinearSolve.jl/issues/586
811+
eqs = [0 ~ -c * z + (q - z) * (x^2)
812+
0 ~ p * (-x + (q - z) * x)]
813+
@named sys = NonlinearSystem(eqs; initialization_eqs = [p^2 + q^2 + 2p * q ~ 0])
814+
sys = complete(sys)
810815
# @mtkbuild sys = NonlinearSystem(
811816
# [p * x^2 + q * y^3 ~ 0, x - q ~ 0]; defaults = [q => missing],
812817
# guesses = [q => 1.0], initialization_eqs = [p^2 + q^2 + 2p * q ~ 0])

0 commit comments

Comments
 (0)