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 +228,7 @@ In this problem, we have a mass, spring, and damper which are connected to a fix
228
228
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
249
250
250
```@example connections
251
-
@named bv = TV.Mass(m = 1, v = 1)
251
+
@named bv = TV.Mass(m = 1)
252
252
@named bp = TP.Mass(m = 1, v = 1, s = 3)
253
253
nothing # hide
254
254
```
@@ -270,7 +270,7 @@ As can be seen, the position-based domain requires more initial condition inform
270
270
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
271
272
272
```@example connections
273
-
function simplify_and_solve(damping, spring, body, ground)
273
+
function simplify_and_solve(damping, spring, body, ground; initialization_eqs = Equation[])
@@ -346,12 +351,11 @@ By definition, the spring stretch is
346
351
\Delta s = s - s_{b_0} - l
347
352
```
348
353
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.
354
+
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