Skip to content

Commit b233315

Browse files
committed
rm outputs
1 parent 52c7862 commit b233315

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

docs/src/tutorials/spring_mass.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ eqs = [
132132

133133
Finally, we can build the model using these equations and components.
134134

135-
```julia
135+
```@example component
136136
@named _model = ODESystem(eqs, t, [spring.x; spring.dir; mass.pos], [])
137137
@named model = compose(_model, mass, spring)
138138
```
@@ -162,25 +162,14 @@ This system can be solved directly as a DAE using [one of the DAE solvers from D
162162
```@example component
163163
sys = structural_simplify(model)
164164
equations(sys)
165-
166-
4-element Vector{Equation}:
167-
Differential(t)(mass₊v[1](t)) ~ (-spring₊k*(spring₊x(t) - spring₊l)*mass₊pos[1](t)) / (mass₊m*spring₊x(t))
168-
Differential(t)(mass₊v[2](t)) ~ (-spring₊k*(spring₊x(t) - spring₊l)*mass₊pos[2](t)) / (mass₊m*spring₊x(t)) - 9.81
169-
Differential(t)(mass₊pos[1](t)) ~ mass₊v[1](t)
170-
Differential(t)(mass₊pos[2](t)) ~ mass₊v[2](t)
171165
```
172166

173167
We are left with only 4 equations involving 4 state variables (`mass.pos[1]`,
174168
`mass.pos[2]`, `mass.v[1]`, `mass.v[2]`). We can solve the system by converting
175169
it to an `ODEProblem`. Some observed variables are not expanded by default. To
176170
view the complete equations, one can do
177-
```julia
178-
julia> full_equations(sys)
179-
4-element Vector{Equation}:
180-
Differential(t)(mass₊v[1](t)) ~ (-spring₊k*(sqrt(abs2(mass₊pos[1](t)) + abs2(mass₊pos[2](t))) - spring₊l)*mass₊pos[1](t)) / (mass₊m*sqrt(abs2(mass₊pos[1](t)) + abs2(mass₊pos[2](t))))
181-
Differential(t)(mass₊v[2](t)) ~ (-spring₊k*(sqrt(abs2(mass₊pos[1](t)) + abs2(mass₊pos[2](t))) - spring₊l)*mass₊pos[2](t)) / (mass₊m*sqrt(abs2(mass₊pos[1](t)) + abs2(mass₊pos[2](t)))) - 9.81
182-
Differential(t)(mass₊pos[1](t)) ~ mass₊v[1](t)
183-
Differential(t)(mass₊pos[2](t)) ~ mass₊v[2](t)
171+
```@example component
172+
full_equations(sys)
184173
```
185174

186175
This is done as follows:

0 commit comments

Comments
 (0)