@@ -67,7 +67,8 @@ def f(x):
67
67
68
68
plt .suptitle (f"The heat equation - numerical solution with $M={ M } , N={ N } $" )
69
69
plt .title (
70
- r"$u_t = u_{xx}, u(x, 0) = 2 \pi x + \sin{\left( 2 \pi x\right)}, u_x(0, t) = u_x(1, t) = 0$"
70
+ r"$u_t = u_{xx}, u(x, 0) = 2 \pi x + \sin{\left( 2 \pi x\right)}, "
71
+ "u_x(0, t) = u_x(1, t) = 0$"
71
72
)
72
73
plt .xlabel ("$x$" )
73
74
plt .ylabel ("Time $t$" )
@@ -157,7 +158,8 @@ def f(x):
157
158
158
159
plt .suptitle ("The heat equation - discretization of the boundary conditions" )
159
160
plt .title (
160
- f"Comparison with reference solution with $M^* = { M_star } $ at $t = { T } $. $N = { N } $"
161
+ "Comparison with reference solution with "
162
+ f"$M^* = { M_star } $ at $t = { T } $. $N = { N } $"
161
163
)
162
164
plt .xlabel ("Internal nodes $M$" )
163
165
plt .ylabel (r"Relative $l_2$ error $\frac{\|U-u\|}{\|u\|}$" )
@@ -275,7 +277,8 @@ def task_2bh():
275
277
276
278
plt .suptitle ("The heat equation - $h$-refinement" )
277
279
plt .title (
278
- f"Backwards Euler vs Crank Nicholson with $N={ TASK_2B_PARAMS ['N' ]} $ at $t = { TASK_2B_PARAMS ['T' ]} $"
280
+ "Backwards Euler vs Crank Nicholson with "
281
+ f"$N={ TASK_2B_PARAMS ['N' ]} $ at $t = { TASK_2B_PARAMS ['T' ]} $"
279
282
)
280
283
plt .xlabel ("Internal nodes $M$" )
281
284
plt .ylabel (r"Relative error $\frac{\|U-u\|}{\|u\|}$" )
@@ -315,7 +318,8 @@ def task_2bk():
315
318
316
319
plt .suptitle ("The heat equation - $k$-refinement" )
317
320
plt .title (
318
- f"Backwards Euler vs Crank Nicholson with $M={ TASK_2B_PARAMS ['M' ]} $ at $t = { TASK_2B_PARAMS ['T' ]} $"
321
+ "Backwards Euler vs Crank Nicholson with "
322
+ f"$M={ TASK_2B_PARAMS ['M' ]} $ at $t = { TASK_2B_PARAMS ['T' ]} $"
319
323
)
320
324
plt .xlabel ("Time steps $N$" )
321
325
plt .ylabel (r"Relative error $\frac{\|U-u\|}{\|u\|}$" )
0 commit comments