Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Dec 31, 2023
1 parent 8f25700 commit 6b3f5f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The symbolic indexing interface has 2 levels:
## Example

```julia
# Use ModelingToolkit to make a solution

using ModelingToolkit, OrdinaryDiffEq, SymbolicIndexingInterface, Plots

@parameters σ ρ β
Expand All @@ -43,5 +45,20 @@ eqs = [D(D(x)) ~ σ * (y - x),
@named sys = ODESystem(eqs)
sys = structural_simplify(sys)

u0 = [D(x) => 2.0,
x => 1.0,
y => 0.0,
z => 0.0]

p ==> 28.0,
ρ => 10.0,
β => 8 / 3]

tspan = (0.0, 100.0)
prob = ODEProblem(sys, u0, tspan, p, jac = true)
sol = solve(prob, Tsit5())

# Now index it symbolically

sol[x]
```

0 comments on commit 6b3f5f2

Please sign in to comment.