Skip to content

Commit

Permalink
Update find_root.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Mar 30, 2024
1 parent 74e710c commit 36eb200
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/getting_started/find_root.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using ModelingToolkit, NonlinearSolve
eqs = [0 ~ σ * (y - x),
0 ~ x * (ρ - z) - y,
0 ~ x * y - β * z]
@named ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
@mtkbuild ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
# Convert the symbolic system into a numerical system
prob = NonlinearProblem(ns, [])
Expand All @@ -56,7 +56,7 @@ prob = NonlinearProblem(ns, [])
sol = solve(prob, NewtonRaphson())
# Analyze the solution
@show sol.u, prob.f(sol.u, prob.p)
@show sol[[x,y,z]], sol.resid
```

## Step-by-Step Solution
Expand Down Expand Up @@ -122,7 +122,7 @@ Finally, we bring these pieces together, the equation along with its states and
define our `NonlinearSystem`:

```@example first_rootfind
@named ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
@mtkbuild ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
```

### Step 3: Convert the Symbolic Problem to a Numerical Problem
Expand Down Expand Up @@ -178,5 +178,5 @@ We can check it as follows:

```@example first_rootfind
# Analyze the solution
@show sol.u, sol.resid
@show sol[[x,y,z]], sol.resid
```

0 comments on commit 36eb200

Please sign in to comment.