Skip to content

Commit a26b4d4

Browse files
committed
strict links
1 parent 4bd89f1 commit a26b4d4

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

docs/make.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ makedocs(sitename = "ModelingToolkitStandardLibrary.jl",
1818
authors = "Julia Computing",
1919
clean = true,
2020
doctest = false,
21+
linkcheck = true,
2122
strict = [
23+
:linkcheck,
2224
:doctest,
2325
:example_block,
2426
],

docs/src/connectors/connections.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,8 @@ sol = solve(prob)
118118
p1 = plot(sol, idxs = [capacitor.v])
119119
p2 = plot(sol, idxs = [resistor.i])
120120
plot(p1, p2)
121-
savefig("electrical.png");
122-
nothing; # hide
123121
```
124122

125-
![Plot of Electrical Example](electrical.png)
126-
127123
### Mechanical Translational Domain
128124

129125
#### Across Variable = velocity
@@ -162,12 +158,8 @@ sol_v = solve(prob)
162158
p1 = plot(sol_v, idxs = [body.v])
163159
p2 = plot(sol_v, idxs = [damping.f])
164160
plot(p1, p2)
165-
savefig("mechanical_velocity.png");
166-
nothing; # hide
167161
```
168162

169-
![Plot of Mechanical (Velocity Based) Example](mechanical_velocity.png)
170-
171163
#### Across Variable = position
172164

173165
Now, let's consider the position based approach. We can build the same model with the same components. As can be seen, we now end of up with 2 equations, because we need to relate the lower derivative (position) to force (with acceleration).
@@ -201,12 +193,8 @@ p2 = plot(sol_p, idxs = [damping.f])
201193
p3 = plot(sol_p, idxs = [body.s])
202194
203195
plot(p1, p2, p3)
204-
savefig("mechanical_position.png");
205-
nothing; # hide
206196
```
207197

208-
![Plot of Mechanical (Velocity Based) Example](mechanical_position.png)
209-
210198
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:
211199

212200
1. the `Mass` component will add the position variable when the `s_0` parameter is used to set an initial position. Otherwise the position is not tracked by the component.
@@ -315,24 +303,16 @@ Now we can plot the comparison of the 2 models and see they give the same result
315303
plot(ylabel = "mass velocity [m/s]")
316304
plot!(solv, idxs = [bv.v])
317305
plot!(solp, idxs = [bp.v])
318-
savefig("mass_velocity.png");
319-
nothing; # hide
320306
```
321307

322-
![Mass Velocity Comparison](mass_velocity.png)
323-
324308
But, what if we wanted to plot the mass position? This is easy for the position based domain, we have the state `bp₊s(t)`, but for the velocity based domain we have `sv₊delta_s(t)` which is the spring stretch. To get the absolute position we add the spring natrual length (1m) and the fixed position (1m). As can be seen, we then get the same result.
325309

326310
```@example connections
327311
plot(ylabel = "mass position [m]")
328312
plot!(solv, idxs = [sv.delta_s + 1 + 1])
329313
plot!(solp, idxs = [bp.s])
330-
savefig("mass_position.png");
331-
nothing; # hide
332314
```
333315

334-
![Mass Position Comparison](mass_position.png)
335-
336316
So in conclusion, the position based domain gives easier access to absolute position information, but requires more initial condition information.
337317

338318
## Acuracy
@@ -369,8 +349,4 @@ plot(title = "numerical difference: vel. vs. pos. domain", xlabel = "time [s]",
369349
time = 0:0.1:10
370350
plot!(time, (solv(time)[bv.v] .- solp(time)[bp.v]), label = "")
371351
Plots.ylims!(-1e-15, 1e-15)
372-
savefig("err.png");
373-
nothing; # hide
374352
```
375-
376-
![Accuracy Comparison](err.png)

0 commit comments

Comments
 (0)