Skip to content

Commit

Permalink
fixup! refactor: add new *_symbols methods, corresponding singletons,…
Browse files Browse the repository at this point in the history
… update tests
  • Loading branch information
AayushSabharwal committed Dec 27, 2023
1 parent 492fb01 commit ae50f9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"

[compat]
Expand Down
10 changes: 7 additions & 3 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial will cover ways to use the interface for types that implement it.
Consider the following example:

```@example Usage
using ModelingToolkit, OrdinaryDiffEq, SymbolicIndexingInterface
using ModelingToolkit, OrdinaryDiffEq, SymbolicIndexingInterface, Plots
@parameters σ ρ β
@variables t x(t) y(t) z(t) w(t)
Expand Down Expand Up @@ -46,7 +46,7 @@ sol[x]
```

This also works for arrays or tuples of variables, including observed quantities and
independent variables, and for interpolating solutions:
independent variables, for interpolating solutions, and plotting:
```@example Usage
sol[[x, y]]
```
Expand All @@ -60,13 +60,17 @@ sol(1.3, idxs=x)
```

```@example Usage
sol(1.3, idxs=[x, w]) # cannot use tuples of variables for interpolation
sol(1.3, idxs=[x, w])
```

```@example Usage
sol(1.3, idxs=[:y, :z])
```

```@example Usage
plot(sol, idxs=x)
```

If necessary, `Symbol`s can be used to refer to variables. This is only valid for
symbolic variables for which [`hasname`](@ref) returns `true`. The `Symbol` used must
match the one returned by [`getname`](@ref) for the variable.
Expand Down

0 comments on commit ae50f9d

Please sign in to comment.