You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Import the packagesusing ModelingToolkit, NonlinearSolve
# Define the nonlinear system@variables x=1.0 y=0.0 z=0.0@parameters σ=10.0 ρ=26.0 β=8/3
eqs = [0~ σ * (y - x),
0~ x * (ρ - z) - y,
0~ x * y - β * z]
@mtkbuild ns =NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
# Convert the symbolic system into a numerical system
prob =NonlinearProblem(ns, [])
# Solve the numerical problem
sol =solve(prob, NewtonRaphson())
# Analyze the solution@show sol[[x, y, z]], sol.resid
Error & Stacktrace ⚠️
julia># Import the packagesusing ModelingToolkit, NonlinearSolve
julia>@variables x=1.0 y=0.0 z=0.03-element Vector{Num}:
x
y
z
julia>@parameters σ=10.0 ρ=26.0 β=8/33-element Vector{Num}:
σ
ρ
β
julia> eqs = [0~ σ * (y - x),
0~ x * (ρ - z) - y,
0~ x * y - β * z]
3-element Vector{Equation}:0~ (-x + y)*σ
0~-y + x*(-z + ρ)
0~ x*y - z*β
julia>@mtkbuild ns =NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
# Convert the symbolic system into a numerical system
Model ns:
Equations (2):2 standard: see equations(ns)
Unknowns (2): see unknowns(ns)
x [defaults to 1.0]
z [defaults to 0.0]
Parameters (3): see parameters(ns)
ρ [defaults to 26.0]
β [defaults to 2.66667]
σ [defaults to 10.0]
Observed (1): see observed(ns)
julia> prob =NonlinearProblem(ns, [])
# Solve the numerical problem
┌ Warning: Initialization system is overdetermined. 1 equations for0 unknowns. Initialization will default to using least squares. `SCCNonlinearProblem` can only be used for initialization of fully determined systems and hence will not be used here. To suppress this warning pass warn_initialize_determined =false. To make this warning into an error, pass fully_determined =true
└ @ ModelingToolkit ~/.julia/packages/ModelingToolkit/iQ7So/src/systems/diffeqs/abstractodesystem.jl:1349
NonlinearProblem with uType Vector{Float64}. In-place:true
u0:2-element Vector{Float64}:1.00.0
julia> sol =solve(prob, NewtonRaphson())
# Analyze the solution
retcode: InitialFailure
u:2-element Vector{Float64}:1.00.0
julia>@show sol[[x, y, z]], sol.resid
(sol[[x, y, z]], sol.resid) = ([1.0, 26.0, 0.0], [250.0, 26.0])
([1.0, 26.0, 0.0], [250.0, 26.0])
Environment (please complete the following information):
Output of using Pkg; Pkg.status()
(test) pkg> st
Status `~/Documents/Work/Demos/test/Project.toml`
[961ee093] ModelingToolkit v9.60.0
[8913a72c] NonlinearSolve v4.3.0
Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Describe the bug 🐞
This SciML tutorial fails with
InitialError
.Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: