Skip to content

Commit 588966b

Browse files
Merge pull request #82 from ValentinKaisermayer/doctest
enables doctest for thermal tutorial
2 parents 70ff6ab + ed377c6 commit 588966b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/tutorials/thermal_model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Heat Conduction Model
22

33
This example demonstrates the thermal response of two masses connected by a conducting element.
4-
The two masses have the same heat capacity but different initial temperatures (T1=100 [°C], T2=0 [°C]).
4+
The two masses have the same heat capacity but different initial temperatures (`T1=100 [°C]`, `T2=0 [°C]`).
55
The mass with the higher temperature will cool off while the mass with the lower temperature heats up.
66
They will each asymptotically approach the calculated temperature T_final_K that results
77
from dividing the total initial energy in the system by the sum of the heat capacities of each element.
88

9-
```julia
9+
```@example
1010
using ModelingToolkitStandardLibrary.Thermal, ModelingToolkit, OrdinaryDiffEq, Plots
1111
1212
@parameters t
@@ -36,6 +36,6 @@ T_final_K = sol[(mass1.T * C1 + mass2.T * C2) / (C1 + C2)]
3636
plot(title = "Thermal Conduction Demonstration")
3737
plot!(sol, vars = [mass1.T, mass2.T], labels = ["Mass 1 Temperature" "Mass 2 Temperature"])
3838
plot!(sol.t, T_final_K, label = "Steady-State Temperature")
39-
savefig("thermal_plot.png")
39+
savefig("thermal_plot.png"); nothing # hide
4040
```
41-
![Plot of Temperatures](https://user-images.githubusercontent.com/50108075/173061172-4c7305f5-1193-4b17-9ca4-8f8dcbc0cae7.png)
41+
![Plot of Temperatures](thermal_plot.png)

0 commit comments

Comments
 (0)