You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -228,7 +229,7 @@ In this problem, we have a mass, spring, and damper which are connected to a fix
228
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`.
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`.
For both position- and velocity-based domains, we set the mass `m=1` and initial velocity `v=1`. Like the damper, the position domain requires the position initial conditions set as well.
249
250
250
251
```@example connections
251
-
@named bv = TV.Mass(m = 1, v = 1)
252
+
@named bv = TV.Mass(m = 1)
252
253
@named bp = TP.Mass(m = 1, v = 1, s = 3)
253
254
nothing # hide
254
255
```
@@ -270,7 +271,7 @@ As can be seen, the position-based domain requires more initial condition inform
270
271
Let's define a quick function to simplify and solve the 2 different systems. Note, we will solve with a fixed time step and a set tolerance to compare the numerical differences.
271
272
272
273
```@example connections
273
-
function simplify_and_solve(damping, spring, body, ground)
274
+
function simplify_and_solve(damping, spring, body, ground; initialization_eqs = Equation[])
@@ -346,12 +350,11 @@ By definition, the spring stretch is
346
350
\Delta s = s - s_{b_0} - l
347
351
```
348
352
349
-
Which means both systems are actually solving the same exact system. We can plot the numerical difference between the 2 systems and see the result is negligible.
353
+
Which means both systems are actually solving the same exact system. We can plot the numerical difference between the 2 systems and see the result is negligible (much less than the tolerance of 1e-9).
0 commit comments