Skip to content

Commit 7062937

Browse files
Fix typos
1 parent ea69f90 commit 7062937

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/tutorials/spring_mass.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ plot(sol)
5757

5858
## Explanation
5959
### Building the components
60-
For each component we use a Julia function that returns an `ODESystem`. At the top, we define the fundamental properties of a `Mass`: it has a mass `m`, a position `pos` and a velocity `vel`. We also define that the velocity is the rate of change of position with respect to time.
60+
For each component we use a Julia function that returns an `ODESystem`. At the top, we define the fundamental properties of a `Mass`: it has a mass `m`, a position `pos` and a velocity `v`. We also define that the velocity is the rate of change of position with respect to time.
6161

6262
```julia
6363
function Mass(; name, m = 1.0, xy = [0., 0.], u = [0., 0.])
@@ -68,7 +68,7 @@ function Mass(; name, m = 1.0, xy = [0., 0.], u = [0., 0.])
6868
end
6969
```
7070

71-
Note that this is an incompletely specified `ODESystem`. It cannot be simulated on its own since the equations for `pos[1:2](t)` are unknown. Notice the addition of a `name` keyword. This allows us to generate different masses with different names. A `Mass` can now be constructed as:
71+
Note that this is an incompletely specified `ODESystem`. It cannot be simulated on its own since the equations for the velocity `v[1:2](t)` are unknown. Notice the addition of a `name` keyword. This allows us to generate different masses with different names. A `Mass` can now be constructed as:
7272

7373
```julia
7474
Mass(name = :mass1)
@@ -195,7 +195,7 @@ equations(sys)
195195
Differential(t)(mass₊pos[2](t)) ~ mass₊v[2](t)
196196
```
197197

198-
We are left with only 4 equations involving 4 state variables (`mass.pos[1]`, `mass.pos[2]`, `mass.vel[1]`, `mass.vel[2]`). We can solve the system by converting it to an `ODEProblem` in mass matrix form and solving with an [`ODEProblem` mass matrix solver](https://diffeq.sciml.ai/stable/solvers/dae_solve/#OrdinaryDiffEq.jl-(Mass-Matrix)). This is done as follows:
198+
We are left with only 4 equations involving 4 state variables (`mass.pos[1]`, `mass.pos[2]`, `mass.v[1]`, `mass.v[2]`). We can solve the system by converting it to an `ODEProblem` in mass matrix form and solving with an [`ODEProblem` mass matrix solver](https://diffeq.sciml.ai/stable/solvers/dae_solve/#OrdinaryDiffEq.jl-(Mass-Matrix)). This is done as follows:
199199

200200
```julia
201201
prob = ODEProblem(sys, [], (0., 3.))

0 commit comments

Comments
 (0)