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
The diagram here shows the similarity of problems in different physical domains.
@@ -65,13 +65,13 @@ Now, if we choose *position* for the across variable, a similar relationship can
65
65
- Energy Dissipation:
66
66
67
67
```math
68
-
\partial^2 {\color{blue}{position}} / \partial t^2 \cdot mass = {\color{green}{force}}
68
+
\partial^2 {\color{blue}{position}} / \partial t^2 \cdot mass = {\color{green}{force}}
69
69
```
70
70
71
71
- Flow:
72
72
73
73
```math
74
-
{\color{green}{force}} \cdot (1/damping) = \partial {\color{blue}{position}} / \partial t
74
+
{\color{green}{force}} \cdot (1/damping) = \partial {\color{blue}{position}} / \partial t
75
75
```
76
76
77
77
As can be seen, we must now establish a higher order derivative to define the Energy Dissipation and Flow equations, requiring an extra equation, as will be shown in the example below.
@@ -134,8 +134,8 @@ Now using the Translational library based on velocity, we can see the same relat
134
134
using ModelingToolkitStandardLibrary
135
135
const TV = ModelingToolkitStandardLibrary.Mechanical.Translational
136
136
137
-
@named damping = TV.Damper(d = 1, v_a_0 = 1)
138
-
@named body = TV.Mass(m = 1, v_0 = 1)
137
+
@named damping = TV.Damper(d = 1, flange_a.v = 1)
138
+
@named body = TV.Mass(m = 1, v = 1)
139
139
@named ground = TV.Fixed()
140
140
141
141
eqs = [connect(damping.flange_a, body.flange)
@@ -167,8 +167,8 @@ Now, let's consider the position-based approach. We can build the same model wi
The question then arises, can the position be plotted when using the Mechanical Translational Domain based on the Velocity Across variable? Yes, we can! There are 2 solutions:
199
199
200
-
1. the `Mass` component will add the position variable when the `s_0` parameter is used to set an initial position. Otherwise, the component does not track the position.
200
+
1. the `Mass` component will add the position variable when the `s` parameter is used to set an initial position. Otherwise, the component does not track the position.
201
201
202
202
```julia
203
-
@named body = TV.Mass(m =1, v_0=1, s_0=0)
203
+
@named body = TV.Mass(m =1, v=1, s=0)
204
204
```
205
205
206
206
2. implement a `PositionSensor`
@@ -220,31 +220,31 @@ In this problem, we have a mass, spring, and damper which are connected to a fix
220
220
221
221
#### Damper
222
222
223
-
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 `v_a_0=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`.
223
+
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 `v_a_0` and initial spring stretch `delta_s_0`. The position domain instead needs the initial positions for `flange_a` and `flange_b` and the natural spring length `l`.
233
+
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_0=1`. Like the damper, the position domain requires the position initial conditions set as well.
243
+
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.
0 commit comments