Skip to content

Commit 98f2c02

Browse files
committed
Explicitly bracket \frac
1 parent 65b2df7 commit 98f2c02

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

tasks/advection_diffusion.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ def u(x, t):
117117
ndofs,
118118
6e0 * np.divide(1, ndofs ** (2 / 3)),
119119
linestyle="dashed",
120-
label=r"$O\left(N_{dof}^{-\frac23}\right)$",
120+
label=r"$O\left(N_{dof}^{-\frac{2}{3}}\right)$",
121121
)
122122

123-
plt.suptitle(r"Periodic advection diffusion - 2nd order space, $\theta = \frac12$")
123+
plt.suptitle(
124+
r"Periodic advection diffusion - 2nd order space, $\theta = \frac{1}{2}$"
125+
)
124126
plt.title(
125127
fr"Refinement with constant $r=\frac{{k}}{{h^2}}={r}$, $c={c}, d={d}, t={T}$"
126128
)
@@ -236,7 +238,7 @@ def u(x, t):
236238
ndofs,
237239
6e0 * np.divide(1, ndofs ** (2 / 3)),
238240
linestyle="dashed",
239-
label=r"$O\left(N_{dof}^{-\frac23}\right)$",
241+
label=r"$O\left(N_{dof}^{-\frac{2}{3}}\right)$",
240242
)
241243

242244
plt.title(f"Error at $t={T}$ (log-log)")
@@ -301,7 +303,7 @@ def u(x, t):
301303
ndofs,
302304
1.5e2 * np.divide(1, ndofs ** (4 / 3)),
303305
linestyle="dashed",
304-
label=r"$O\left(N_{dof}^{-\frac43}\right)$",
306+
label=r"$O\left(N_{dof}^{-\frac{4}{3}}\right)$",
305307
)
306308

307309
plt.suptitle("Periodic advection diffusion - 4th order spacial discretization")
@@ -490,7 +492,7 @@ def ux(x, t):
490492
ndofs,
491493
1e0 * np.divide(1, ndofs ** (2 / 3)),
492494
linestyle="dashed",
493-
label=r"$O\left(N_{dof}^{-\frac23}\right)$",
495+
label=r"$O\left(N_{dof}^{-\frac{2}{3}}\right)$",
494496
)
495497

496498
plt.suptitle("Aperiodic advection diffusion - Neumann - Neumann")
@@ -551,7 +553,7 @@ def u(x, t):
551553
ndofs,
552554
4e0 * np.divide(1, ndofs ** (1 / 2)),
553555
linestyle="dashed",
554-
label=r"$O\left(N_{dof}^{-\frac12}\right)$",
556+
label=r"$O\left(N_{dof}^{-\frac{1}{2}}\right)$",
555557
)
556558

557559
plt.suptitle("Periodic advection diffusion - 1st order spacial discretization")

tasks/fem_poisson.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def task_5d_afem_solution():
232232
"u": lambda x: x ** (2 / 3),
233233
"a": 0,
234234
"b": 1,
235-
"u_text": r"x^{\frac23}",
235+
"u_text": r"x^{\frac{2}{3}}",
236236
}
237237

238238

tasks/heat_eqn.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def task_2bc():
354354
ndofs,
355355
1e0 * np.divide(1, ndofs ** (1 / 2)),
356356
linestyle="dashed",
357-
label=r"$O\left(N_{dof}^{-\frac12}\right)$",
357+
label=r"$O\left(N_{dof}^{-\frac{1}{2}}\right)$",
358358
)
359359

360360
plt.grid()
@@ -388,7 +388,7 @@ def task_2br():
388388
ndofs,
389389
1e0 * np.divide(1, ndofs ** (2 / 3)),
390390
linestyle="dashed",
391-
label=r"$O\left(N_{dof}^{-\frac23}\right)$",
391+
label=r"$O\left(N_{dof}^{-\frac{2}{3}}\right)$",
392392
)
393393

394394
plt.grid()

tasks/poisson_1D.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def f(x):
332332
plt.suptitle("Poisson's equation - Adaptive mesh refinement")
333333
plt.title(
334334
r"$u\left(x\right) = "
335-
r"\exp{-\frac{1}{\epsilon} \left(x - \frac12\right)^2},"
335+
r"\exp{-\frac{1}{\epsilon} \left(x - \frac{1}{2}\right)^2},"
336336
fr"\epsilon = \num{{{eps:.2e}}}$"
337337
)
338338
plt.xlabel("Internal nodes $M$")
@@ -401,7 +401,7 @@ def f(x):
401401
plt.suptitle("Poisson's equation - Adaptive vs uniform mesh refinement")
402402
plt.title(
403403
r"$u\left(x\right) = "
404-
r"\exp{-\frac{1}{\epsilon} \left(x - \frac12\right)^2},"
404+
r"\exp{-\frac{1}{\epsilon} \left(x - \frac{1}{2}\right)^2},"
405405
fr"\epsilon = \num{{{eps:.2e}}}$"
406406
)
407407
plt.xlabel("Internal nodes $M$")

0 commit comments

Comments
 (0)