Skip to content

Commit 37727d0

Browse files
committed
adding some plots
1 parent 62ffe51 commit 37727d0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lessons/hand_coded_heat/lesson.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ model _heat_ conduction through a wall as pictured here ...
3737

3838
|[<img src="problem_setup.png" width="400">](problem_setup.png)|[<img src="spikes_animated.gif" width="400">](spikes_animated.gif)
3939

40+
where the initial condition is two _spikes_ of heat at two, non-symmetrically
41+
positioned points in _x_.
42+
4043
### Governing Equations
4144

4245
In general, heat [conduction](https://en.wikipedia.org/wiki/Thermal_conduction) is governed
4346
by the partial differential (PDE)...
4447

45-
|![](http://latex.codecogs.com/gif.latex?%5Cfrac%7B%5Cpartial%20u%7D%7B%5Cpartial%20t%7D%20-%20%5Cnabla%20%5Ccdot%20%5Calpha%20%5Cnabla%20u%20%3D+0)|(1)|
48+
|![](http://latex.codecogs.com/gif.latex?%5Cfrac%7B%5Cpartial%20u%7D%7B%5Cpartial%20t%7D%20-%20%5Cnabla%20%5Ccdot%20%5Calpha%20%5Cnabla%20u%20%3D%200)|(1)|
4649

4750
where _u_ is the temperature within the wall at spatial positions, _x_, and times, _t_,
4851
![](http://latex.codecogs.com/gif.latex?%5Calpha) is the _thermal diffusivity_
@@ -114,6 +117,11 @@ the next time, _k+1_, from temperatures at the current time, _k_, as
114117
|![](http://latex.codecogs.com/gif.latex?u_i%5E%7Bk%2B1%7D%20%3D%20ru_%7Bi%2B1%7D%5Ek%2B%281-2r%29u_i%5Ek%2Bru_%7Bi-1%7D%5Ek)|(5)|
115118

116119
where ![](http://latex.codecogs.com/gif.latex?r%3D%5Calpha%5Cfrac%7B%5CDelta%20t%7D%7B%5CDelta%20x%5E2%7D)
120+
121+
> **Is there anything in the discrete form of the PDE that looks like a _mesh_?**
122+
123+
|<font color="white">In the process of discretizing the PDE, we have defined a fixed spacing in x and a fixed spacing in t. This is essentially a uniform mesh. Later lessons here address more sophisticated discretizations in space and in time which depart from these all too inflexible fixed spacings.</font>|
124+
117125
Note that this equation now defines the solution at spatial position _i_ and time _k+1_
118126
in terms of values of u at time _k_ . This is an
119127
[_explicit_](https://en.wikipedia.org/wiki/Explicit_and_implicit_methods)
@@ -210,7 +218,12 @@ Memory used = 194 bytes
210218
```
211219
212220
Take note of number of flops and memory used so we can compare these
213-
metrics to other runs later.
221+
metrics to other runs later. The solution is plotted below for some
222+
key timesteps.
223+
224+
|Time 0| Time 0.1| Time 0.5|
225+
|:---:|:---:|:---:|
226+
|[<img src="spikes0000.png" width="400">](spikes0000.png)|[<img src="spikes0001.png" width="400">](spikes0001.png)|[<img src="spikes0003.png" width="400">](spikes0003.png)|
214227
215228
> **Are the results correct? How would we assess that?**
216229

0 commit comments

Comments
 (0)