Skip to content

Commit 495c701

Browse files
Merge pull request #57 from kanav99/docstrings
Fix latex in docstrings
2 parents b5a7a3f + 407318e commit 495c701

File tree

8 files changed

+311
-253
lines changed

8 files changed

+311
-253
lines changed

src/dde/ddetst.jl

Lines changed: 82 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ const prob_dde_DDETST_A1 =
4545
Delay differential equation model of chronic granulocytic leukemia, given by
4646
4747
```math
48-
\begin{align*}
49-
u_1'(t) &= \frac{1.1}{1 + \sqrt{10} u_1(t - 20)^{5/4}} - \frac{10 u_1(t)}{1 + 40 u_2(t)}, \\
50-
u_2'(t) &= \frac{100 u_1(t)}{1 + 40 u_2(t)} - 2.43 u_2(t),
51-
\end{align*}
48+
u_1'(t) = \frac{1.1}{1 + \sqrt{10} u_1(t - 20)^{5/4}} - \frac{10 u_1(t)}{1 + 40 u_2(t)},
49+
```
50+
```math
51+
u_2'(t) = \frac{100 u_1(t)}{1 + 40 u_2(t)} - 2.43 u_2(t),
5252
```
5353
5454
for ``t \in [0, 100]`` and history function
5555
5656
```math
57-
\begin{align*}
58-
\phi_1(t) &= 1.05767027/3, \\
59-
\phi_2(t) &= 1.030713491/3,
60-
\end{align*}
57+
\phi_1(t) = 1.05767027/3,
58+
```
59+
```math
60+
\phi_2(t) = 1.030713491/3,
6161
```
6262
6363
for ``t \leq 0``.
@@ -246,19 +246,19 @@ const prob_dde_DDETST_C1 =
246246
Delay differential equation
247247
248248
```math
249-
\begin{align*}
250-
u_1'(t) &= - 2 u_1(t - u_2(t)), \\
251-
u_₂'(t) &= \frac{|u_1(t - u_2(t))| - |u_1(t)|}{1 + |u_1(t - u_2(t))|},
252-
\end{align*}
249+
u_1'(t) = - 2 u_1(t - u_2(t)),
250+
```
251+
```math
252+
u_₂'(t) = \frac{|u_1(t - u_2(t))| - |u_1(t)|}{1 + |u_1(t - u_2(t))|},
253253
```
254254
255255
for ``t \in [0, 40]`` with history function
256256
257257
```math
258-
\begin{align*}
259-
\phi_1(t) &= 1, \\
260-
\phi_2(t) &= 0.5,
261-
\end{align*}
258+
\phi_1(t) = 1,
259+
```
260+
```math
261+
\phi_2(t) = 0.5,
262262
```
263263
264264
for ``t \leq 0``.
@@ -305,11 +305,13 @@ const prob_dde_DDETST_C2 =
305305
Delay differential equation model of hematopoiesis, given by
306306
307307
```math
308-
\begin{align*}
309-
u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q,\\
310-
u_2'(t) &= f(u_1(t)) - k u_2(t),\\
311-
u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))},
312-
\end{align*}
308+
u_1'(t) = \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q,
309+
```
310+
```math
311+
u_2'(t) = f(u_1(t)) - k u_2(t),
312+
```
313+
```math
314+
u_3'(t) = 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))},
313315
```
314316
315317
for ``t \in [0, 300]`` with history function ``\phi_1(0) = 3.325``, ``\phi_3(0) = 120``, and
@@ -367,17 +369,19 @@ Delay differential equation model of hematopoiesis, given by the same delay diff
367369
equation as [`prob_dde_DDETST_C3`](@ref)
368370
369371
```math
370-
\begin{align*}
371-
u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q,\\
372-
u_2'(t) &= f(u_1(t)) - k u_2(t),\\
373-
u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))},
374-
\end{align*}
372+
u_1'(t) = \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q,
373+
```
374+
```math
375+
u_2'(t) = f(u_1(t)) - k u_2(t),
376+
```
377+
```math
378+
u_3'(t) = 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))},
375379
```
376380
377381
for ``t \in [0, 100]`` with history function
378382
``\phi_1(0) = 3.5``, ``\phi_3(0) = 50``, and ``\phi_2(t) = 10`` for ``t \leq 0``, where
379383
``f(y) = a / (1 + K y^r)``, ``\hat{s}_0 = 0.00372``, ``T_1 = 3``, ``\gamma = 0.1``,
380-
``Q = 0.00178``, ``k = 6.65`, ``a = 15600``, ``K = 0.0382``, and ``r = 6.96``.
384+
``Q = 0.00178``, ``k = 6.65``, ``a = 15600``, ``K = 0.0382``, and ``r = 6.96``.
381385
382386
# References
383387
@@ -421,19 +425,19 @@ const prob_dde_DDETST_C4 =
421425
Delay differential equation
422426
423427
```math
424-
\begin{align*}
425-
u_1'(t) &= u_2(t), \\
426-
u_2'(t) &= - u_2(\exp(1 - u_2(t))) u_2(t)^2 \exp(1 - u_2(t)),
427-
\end{align*}
428+
u_1'(t) = u_2(t),
429+
```
430+
```math
431+
u_2'(t) = - u_2(\exp(1 - u_2(t))) u_2(t)^2 \exp(1 - u_2(t)),
428432
```
429433
430434
for ``t \in [0.1, 5]`` with history function
431435
432436
```math
433-
\begin{align*}
434-
\phi_1(t) &= \log t, \\
435-
\phi_2(t) &= 1 / t,
436-
\end{align*}
437+
\phi_1(t) = \log t,
438+
```
439+
```math
440+
\phi_2(t) = 1 / t,
437441
```
438442
439443
for ``t \in (0, 0.1]``.
@@ -443,10 +447,10 @@ for ``t \in (0, 0.1]``.
443447
The analytical solution for ``t \in [0.1, 5]`` is
444448
445449
```math
446-
\begin{align*}
447-
u_1(t) &= \log t, \\
448-
u_2(t) &= 1 / t.
449-
\end{align*}
450+
u_1(t) = \log t,
451+
```
452+
```math
453+
u_2(t) = 1 / t.
450454
```
451455
452456
# References
@@ -498,23 +502,31 @@ const prob_dde_DDETST_D1 =
498502
Delay differential equation model of antigen antibody dynamics with fading memory, given by
499503
500504
```math
501-
\begin{align*}
502-
u_1'(t) &= - r_1 u_1(t) u_2(t) + r_2 u_3(t), \\
503-
u_2'(t) &= - r_1 u_1(t) u_2(t) + \alpha r_1 u_1(t - u_4(t)) u_2(t - u_4(t)), \\
504-
u_3'(t) &= r_1 u_1(t) u_2(t) - r_2 u_3(t), \\
505-
u_4'(t) &= 1 + \frac{3 \delta - u_1(t) u_2(t) - u_3(t)}{u_1(t - u_4(t)) u_2(t - u_4(t)) + u_3(t - u_4(t))} \exp(\delta u_4(t)),
506-
\end{align*}
505+
u_1'(t) = - r_1 u_1(t) u_2(t) + r_2 u_3(t),
506+
```
507+
```math
508+
u_2'(t) = - r_1 u_1(t) u_2(t) + \alpha r_1 u_1(t - u_4(t)) u_2(t - u_4(t)),
509+
```
510+
```math
511+
u_3'(t) = r_1 u_1(t) u_2(t) - r_2 u_3(t),
512+
```
513+
```math
514+
u_4'(t) = 1 + \frac{3 \delta - u_1(t) u_2(t) - u_3(t)}{u_1(t - u_4(t)) u_2(t - u_4(t)) + u_3(t - u_4(t))} \exp(\delta u_4(t)),
507515
```
508516
509517
for ``t \in [0, 40]`` with history function
510518
511519
```math
512-
\begin{align*}
513-
\phi_1(t) &= 5, \\
514-
\phi_2(t) &= 0.1, \\
515-
\phi_3(t) &= 0, \\
516-
\phi_4(t) &= 0,
517-
\end{align*}
520+
\phi_1(t) = 5,
521+
```
522+
```math
523+
\phi_2(t) = 0.1,
524+
```
525+
```math
526+
\phi_3(t) = 0,
527+
```
528+
```math
529+
\phi_4(t) = 0,
518530
```
519531
520532
for ``t \leq 0``, where ``r_1 = 0.02``, ``r_2 = 0.005``, ``\alpha = 3``, and ``\delta = 0.01``.
@@ -598,19 +610,19 @@ const prob_dde_DDETST_E1 =
598610
Delay differential equation model of a logistic Gauss-type predator-prey system, given by
599611
600612
```math
601-
\begin{align*}
602-
u_1'(t) &= u_1(t) (1 - u_1(t - \tau) - \rho u_1'(t - \tau)) - \frac{u_2(t) u_1(t)^2}{u_1(t)^2 + 1}, \\
603-
u_2'(t) &= u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - \alpha\right),
604-
\end{align*}
613+
u_1'(t) = u_1(t) (1 - u_1(t - \tau) - \rho u_1'(t - \tau)) - \frac{u_2(t) u_1(t)^2}{u_1(t)^2 + 1},
614+
```
615+
```math
616+
u_2'(t) = u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - \alpha\right),
605617
```
606618
607619
for ``t \in [0, 2]`` with history function
608620
609621
```math
610-
\begin{align*}
611-
\phi_1(t) &= 0.33 - t / 10, \\
612-
\phi_2(t) &= 2.22 + t / 10,
613-
\end{align*}
622+
\phi_1(t) = 0.33 - t / 10,
623+
```
624+
```math
625+
\phi_2(t) = 2.22 + t / 10,
614626
```
615627
616628
for ``t \leq 0``, where ``\alpha = 0.1``, ``\rho = 2.9``, and ``\tau = 0.42``.
@@ -742,19 +754,23 @@ for ``t \in [0.25, 0.499]`` with history function ``\phi(t) = \exp(-t^2)`` and
742754
743755
The analytical solution for ``t \in [0.25, 0.499]`` is
744756
745-
``math
757+
```math
746758
u(t) = u_i(t) = \exp(-4^i t^2 + B_i t + C_i) / 2^i + K_i
747759
```
748760
749761
if ``t \in [x_i, x_{i + 1}]``, where
750762
751763
```math
752-
\begin{align*}
753-
x_i &= (1 - 2^{-i}) / 2, \\
754-
B_i &= 2 (4^{i-1} + B_{i-1}), \\
755-
C_i &= - 4^{i-2} - B_{i-1} / 2 + C_{i-1}, \\
756-
K_i &= - \exp(-4^i x_i^2 + B_i x_i + C_i) / 2^i + u_{i-1}(x_i),
757-
\end{align*}
764+
x_i = (1 - 2^{-i}) / 2,
765+
```
766+
```math
767+
B_i = 2 (4^{i-1} + B_{i-1}),
768+
```
769+
```math
770+
C_i = - 4^{i-2} - B_{i-1} / 2 + C_{i-1},
771+
```
772+
```math
773+
K_i = - \exp(-4^i x_i^2 + B_i x_i + C_i) / 2^i + u_{i-1}(x_i),
758774
```
759775
760776
and ``B_0 = C_0 = K_0 = 0``.

src/dde/radar5.jl

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ http://www.unige.ch/~hairer/radar5-v2.1.tar
1111
Delay differential equation model from chemical kinetics, given by
1212
1313
```math
14-
\begin{align*}
15-
u_1'(t) &= - k_1 A u_2(t) - k_2 u_1(t) u_2(t - \tau) + k_3 B u_1(t) - 2 k_4 u_1(t)^2, \\
16-
u_2'(t) &= - k_1 A u_2(t) - k_2 u_1(t) u_2(t - \tau) + f k_3 B u_1(t),
17-
\end{align*}
14+
u_1'(t) = - k_1 A u_2(t) - k_2 u_1(t) u_2(t - \tau) + k_3 B u_1(t) - 2 k_4 u_1(t)^2,
15+
```
16+
```math
17+
u_2'(t) = - k_1 A u_2(t) - k_2 u_1(t) u_2(t - \tau) + f k_3 B u_1(t),
1818
```
1919
2020
for ``t \in [0, 100.5]`` with history function
2121
2222
```math
23-
\begin{align*}
24-
\phi_1(t) &= 1e-10, \\
25-
\phi_2(t) &= 1e-5,
26-
\end{align*}
23+
\phi_1(t) = 1e-10,
24+
```
25+
```math
26+
\phi_2(t) = 1e-5,
2727
```
2828
2929
for ``t \leq 0``, where ``k_1 = 1.34``, ``k_2 = 1.6e9``, ``k_3 = 8000``, ``k_4 = 4e7``,
@@ -74,11 +74,13 @@ Delay differential equation model of a chemical reaction with steady state solut
7474
by
7575
7676
```math
77-
\begin{align*}
78-
u_1'(t) &= - a u_1(t) + b u_2(t - \tau) u_3(t), \\
79-
u_2'(t) &= a u_1(t) - b u_2(t - \tau) u_3(t) - c u_2(t)^2, \\
80-
u_3'(t) &= c u_2(t)^2,
81-
\end{align*}
77+
u_1'(t) = - a u_1(t) + b u_2(t - \tau) u_3(t),
78+
```
79+
```math
80+
u_2'(t) = a u_1(t) - b u_2(t - \tau) u_3(t) - c u_2(t)^2,
81+
```
82+
```math
83+
u_3'(t) = c u_2(t)^2,
8284
```
8385
8486
for ``t \in [0, 10e10]`` with history function ``\phi_1(0) = 1``, ``\phi_2(t) = 0`` for
@@ -130,27 +132,42 @@ const prob_dde_RADAR5_robertson =
130132
Delay differential equation model of antibody production, given by
131133
132134
```math
133-
\begin{align*}
134-
u_1'(t) &= - r u_1(t) u_2(t) - s u_1(t) u_4(t), \\
135-
u_2'(t) &= - r u_1(t) u_2(t) + \alpha r u_1(u_5(t)) u_2(u_5(t)) [t \geq t_0], \\
136-
u_3'(t) &= r u_1(t) u_2(t), \\
137-
u_4'(t) &= - s u_1(t) u_4(t) - \gamma u_4(t) + \beta r u_1(u_6(t)) u_2(u_6(t)) [t > t_1], \\
138-
u_5'(t) &= [t \geq t_0] \frac{u_1(t) u_2(t) + u_3(t)}{u_1(u_5(t)) u_2(u_5(t)) + u_3(u_5(t))}, \\
139-
u_6'(t) &= [t \geq t_1] \frac{1e-12 + u_2(t) + u_3(t)}{1e-12 + u_2(u_6(t)) + u_3(u_6(t))},
140-
\end{align*}
135+
u_1'(t) = - r u_1(t) u_2(t) - s u_1(t) u_4(t),
136+
```
137+
```math
138+
u_2'(t) = - r u_1(t) u_2(t) + \alpha r u_1(u_5(t)) u_2(u_5(t)) [t \geq t_0],
139+
```
140+
```math
141+
u_3'(t) = r u_1(t) u_2(t),
142+
```
143+
```math
144+
u_4'(t) = - s u_1(t) u_4(t) - \gamma u_4(t) + \beta r u_1(u_6(t)) u_2(u_6(t)) [t > t_1],
145+
```
146+
```math
147+
u_5'(t) = [t \geq t_0] \frac{u_1(t) u_2(t) + u_3(t)}{u_1(u_5(t)) u_2(u_5(t)) + u_3(u_5(t))},
148+
```
149+
```math
150+
u_6'(t) = [t \geq t_1] \frac{1e-12 + u_2(t) + u_3(t)}{1e-12 + u_2(u_6(t)) + u_3(u_6(t))},
141151
```
142152
143153
for ``t \in [0, 300]`` with history function
144154
145155
```math
146-
\begin{align*}
147-
\phi_1(t) &= \phi_0, \\
148-
\phi_2(t) &= 1e-15, \\
149-
\phi_3(t) &= 0, \\
150-
\phi_4(t) &= 0, \\
151-
\phi_5(t) &= 0, \\
152-
\phi_6(t) &= 0,
153-
\end{align*}
156+
\phi_1(t) = \phi_0,
157+
```
158+
```math
159+
\phi_2(t) = 1e-15,
160+
```
161+
```math
162+
\phi_3(t) = 0,
163+
```
164+
```math
165+
\phi_4(t) = 0,
166+
```
167+
```math \phi_5(t) = 0,
168+
```
169+
```math
170+
\phi_6(t) = 0,
154171
```
155172
156173
for ``t \leq 0``, where ``\alpha = 1.8``, ``\beta = 20``, ``\gamma = 0.002``, ``r = 5e4``,

0 commit comments

Comments
 (0)