Skip to content

Commit dcd6bee

Browse files
committed
docs: update docs
1 parent c2411b2 commit dcd6bee

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/src/connectors/connections.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Now, let's consider the position-based approach. We can build the same model wi
172172
const TP = ModelingToolkitStandardLibrary.Mechanical.TranslationalPosition
173173
174174
systems = @named begin
175-
damping = TP.Damper(d = 1, va = 1, vb = 0.0)
175+
damping = TP.Damper(d = 1)
176176
body = TP.Mass(m = 1, v = 1)
177177
ground = TP.Fixed(s_0 = 0)
178178
end
@@ -191,7 +191,7 @@ nothing # hide
191191
As can be seen, we get exactly the same result. The only difference here is that we are solving an extra equation, which allows us to plot the body position as well.
192192

193193
```@example connections
194-
prob = ODEProblem(sys, [], (0, 10.0), [])
194+
prob = ODEProblem(sys, [], (0, 10.0), [], fully_determined=true)
195195
sol_p = solve(prob)
196196
197197
p1 = plot(sol_p, idxs = [body.v])
@@ -226,21 +226,21 @@ In this problem, we have a mass, spring, and damper which are connected to a fix
226226

227227
#### Damper
228228

229-
The damper will connect the flange/flange 1 (`flange_a`) to the mass, and flange/flange 2 (`flange_b`) to the fixed point. For both position- and velocity-based domains, we set the damping constant `d=1` and `va=1` and leave the default for `v_b_0` at 0. For the position domain, we also need to set the initial positions for `flange_a` and `flange_b`.
229+
The damper will connect the flange/flange 1 (`flange_a`) to the mass, and flange/flange 2 (`flange_b`) to the fixed point. For both position- and velocity-based domains, we set the damping constant `d=1` and `va=1` and leave the default for `v_b_0` at 0.
230230

231231
```@example connections
232232
@named dv = TV.Damper(d = 1)
233-
@named dp = TP.Damper(d = 1, va = 1, vb = 0.0, flange_a__s = 3, flange_b__s = 1)
233+
@named dp = TP.Damper(d = 1)
234234
nothing # hide
235235
```
236236

237237
#### Spring
238238

239-
The spring will connect the flange/flange 1 (`flange_a`) to the mass, and flange/flange 2 (`flange_b`) to the fixed point. For both position- and velocity-based domains, we set the spring constant `k=1`. The velocity domain then requires the initial velocity `va` and initial spring stretch `delta_s`. The position domain instead needs the initial positions for `flange_a` and `flange_b` and the natural spring length `l`.
239+
The spring will connect the flange/flange 1 (`flange_a`) to the mass, and flange/flange 2 (`flange_b`) to the fixed point. For both position- and velocity-based domains, we set the spring constant `k=1`. The velocity domain then requires the initial velocity `va` and initial spring stretch `delta_s`. The position domain instead needs the natural spring length `l`.
240240

241241
```@example connections
242242
@named sv = TV.Spring(k = 1)
243-
@named sp = TP.Spring(k = 1, flange_a__s = 3, flange_b__s = 1, l = 1)
243+
@named sp = TP.Spring(k = 1, l = 1)
244244
nothing # hide
245245
```
246246

@@ -281,7 +281,7 @@ function simplify_and_solve(damping, spring, body, ground; initialization_eqs =
281281
282282
println.(full_equations(sys))
283283
284-
prob = ODEProblem(sys, [], (0, 10.0), []; initialization_eqs)
284+
prob = ODEProblem(sys, [], (0, 10.0), []; initialization_eqs, fully_determined=true)
285285
sol = solve(prob; abstol = 1e-9, reltol = 1e-9)
286286
287287
return sol

0 commit comments

Comments
 (0)