From 6b3f5f2dc1a3c6834d036996486d5027a5cc022d Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 31 Dec 2023 09:05:45 -0500 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e58d3d0b..d32d0c0b 100644 --- a/README.md +++ b/README.md @@ -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 σ ρ β @@ -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] ```