From 53ceed620610a5c5cd1d3800541d28eec3b988ad Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sun, 7 Sep 2025 22:23:57 -0400 Subject: [PATCH 01/10] Use `align*` LaTeX environment to group equations --- lib/BVProblemLibrary/src/BVProblemLibrary.jl | 187 ++++------- lib/BVProblemLibrary/src/linear.jl | 303 +++++++++--------- lib/BVProblemLibrary/src/nonlinear.jl | 192 +++++------ .../src/DAEProblemLibrary.jl | 12 +- lib/DDEProblemLibrary/src/ddetst.jl | 142 ++++---- lib/DDEProblemLibrary/src/radar5.jl | 76 ++--- lib/ODEProblemLibrary/src/brusselator_prob.jl | 46 +-- lib/ODEProblemLibrary/src/nonlinchem.jl | 14 +- .../src/ode_simple_nonlinear_prob.jl | 153 ++++----- .../src/strange_attractors.jl | 36 +-- .../src/SDEProblemLibrary.jl | 12 +- 11 files changed, 497 insertions(+), 676 deletions(-) diff --git a/lib/BVProblemLibrary/src/BVProblemLibrary.jl b/lib/BVProblemLibrary/src/BVProblemLibrary.jl index 1cb7ad9..1e5654b 100644 --- a/lib/BVProblemLibrary/src/BVProblemLibrary.jl +++ b/lib/BVProblemLibrary/src/BVProblemLibrary.jl @@ -41,49 +41,29 @@ This test problem is about the optimal-time launching of a satellite into orbit Given by ```math -\frac{dz_1}{dt}=z_3t_f -``` -```math -\frac{dz_2}{dt}=z_4t_f -``` -```math -\frac{dz_3}{dt}=A\cos(z_5)t_f -``` -```math -\frac{dz_4}{dt}=(A\sin(z_5)-g)t_f -``` -```math -\frac{dz_5}{dt}=-z_6\cos(z_5)t_F -``` -```math -\frac{dz_6}{dt}=z_6^2\sin(z_5)t_f -``` -```math -\frac{dz_7}{dt}=0 +\begin{align*} +\frac{dz_1}{dt} &= z_3 t_f, & +\frac{dz_2}{dt} &= z_4 t_f, \\ +\frac{dz_3}{dt} &= A\cos(z_5) t_f, & +\frac{dz_4}{dt} &= (A\sin(z_5)-g) t_f, \\ +\frac{dz_5}{dt} &= -z_6\cos(z_5) t_F, & +\frac{dz_6}{dt} &= z_6^2\sin(z_5) t_f, \\ +\frac{dz_7}{dt} &= 0, +\end{align*} ``` with boundary condition ```math -z_1(0)=0 -``` -```math -z_2(0)=0 -``` -```math -z_3(0)=0 -``` -```math -z_4(0)=0 -``` -```math -z_5(1)=h -``` -```math -z_6(1)=V_c -``` -```math -z_7(1)=0 +\begin{align*} +z_1(0) &= 0, & +z_2(0) &= 0, \\ +z_3(0) &= 0, & +z_4(0) &= 0, \\ +z_5(1) &= h, & +z_6(1) &= V_c, \\ +z_7(1) &= 0. +\end{align*} ``` # Solution @@ -134,49 +114,29 @@ Launch of a satellite into circular orbit from a flat Earth where we assume a un Given by ```math -\frac{dz_1}{dt}=z_3\frac{V_c}{h} -``` -```math -\frac{dz_2}{dt}=z_4\frac{V_c}{h} -``` -```math -\frac{dz_3}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}} -``` -```math -\frac{dz_4}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}}-\frac{g}{V_c} -``` -```math -\frac{dz_5}{dt}=0 -``` -```math -\frac{dz_6}{dt}=-z_5\frac{V_c}{h} -``` -```math -\frac{dz_7}{dt}=0 +\begin{align*} +\frac{dz_1}{dt} &= z_3 \frac{V_c}{h}, \\[2pt] +\frac{dz_2}{dt} &= z_4 \frac{V_c}{h}, \\[2pt] +\frac{dz_3}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}, \\[2pt] +\frac{dz_4}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}-\frac{g}{V_c}, \\[2pt] +\frac{dz_5}{dt} &= 0, \\[2pt] +\frac{dz_6}{dt} &= -z_5 \frac{V_c}{h}, \\[2pt] +\frac{dz_7}{dt} &= 0, +\end{align*} ``` -with boundary condition +with boundary conditions ```math -z_1(0)=0 -``` -```math -z_2(0)=0 -``` -```math -z_3(0)=0 -``` -```math -z_4(0)=0 -``` -```math -z_5(1)=h -``` -```math -z_6(1)=V_c -``` -```math -z_7(1)=0 +\begin{align*} +z_1(0) &= 0, & +z_2(0) &= 0, \\ +z_3(0) &= 0, & +z_4(0) &= 0, \\ +z_5(1) &= h, & +z_6(1) &= V_c, \\ +z_7(1) &= 0. +\end{align*} ``` # Solution @@ -261,49 +221,29 @@ Launch into circular orbit from a flat Earth including athmosferic drag. Given by ```math -\frac{dz_1}{dt}=z_3\frac{V_c}{h} -``` -```math -\frac{dz_2}{dt}=z_4\frac{V_c}{h} -``` -```math -\frac{dz_3}{dt}=\frac{f}{V_c}(-\frac{z_6}{z_6^2+z_7^2}-V_c\eta\exp(-z_2\beta)z_3\sqrt{z_3^3+z_4^2})/m -``` -```math -\frac{dz_4}{dt}=\frac{f}{V_c}(-\frac{z_7}{z_6^2+z_7^2}-V_c\eta\exp(-z_2\beta)z_4\sqrt{z_3^3+z_4^2})/m - g_{accel}/V_c -``` -```math -\frac{dz_5}{dt}=-\eta\beta\exp(-z_2\beta)(z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} -``` -```math -\frac{dz_6}{dt}=\eta\exp(-z_2\beta)(z_6(2z_3^2+z_4^2)+z_7z_3z_4)V_c/\sqrt{z_3^2+z_4^2}/m -``` -```math -\frac{dz_7}{dt}=\eta\exp(-z_2\beta)(z_7(z_3^2+2z_4^2)+z_6z_3z_4)V_c/\sqrt{z_3^2+z_4^2}/m +\begin{align*} +\frac{dz_1}{dt} &= z_3 \frac{V_c}{h} \\ +\frac{dz_2}{dt} &= z_4 \frac{V_c}{h} \\ +\frac{dz_3}{dt} &= \frac{f}{V_c} \left(-\frac{z_6}{z_6^2+z_7^2} - V_c\eta\exp(-z_2\beta)z_3\sqrt{z_3^3+z_4^2}\right)/m \\ +\frac{dz_4}{dt} &= \frac{f}{V_c} \left(-\frac{z_7}{z_6^2+z_7^2} - V_c\eta\exp(-z_2\beta)z_4\sqrt{z_3^3+z_4^2}\right)/m - g_{accel}/V_c \\ +\frac{dz_5}{dt} &= -\eta\beta \exp(-z_2\beta) (z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} \\ +\frac{dz_6}{dt} &= \eta \exp(-z_2\beta) \left(z_6(2z_3^2+z_4^2)+z_7z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ +\frac{dz_7}{dt} &= \eta \exp(-z_2\beta) \left(z_7(z_3^2+2z_4^2)+z_6z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ +\end{align*} ``` -with boundary condition +with boundary conditions ```math -z_1(0)=0 -``` -```math -z_2(0)=0 -``` -```math -z_3(0)=0 -``` -```math -z_4(0)=0 -``` -```math -z_5(1)=h -``` -```math -z_6(1)=V_c -``` -```math -z_7(1)=0 +\begin{align*} +z_1(0) &= 0, & +z_2(0) &= 0, \\ +z_3(0) &= 0, & +z_4(0) &= 0, \\ +z_5(1) &= h, & +z_6(1) &= V_c, \\ +z_7(1) &= 0. +\end{align*} ``` # Solution @@ -346,22 +286,19 @@ This is an epidemiology model, about the spread of diseases. Given by ```math -\frac{dy_1}{dt}=\mu-\beta(t)y_1y_3 -``` -```math -\frac{dy_2}{dt}=\beta(t)y_1y_3-y_2/\lambda -``` -```math -\frac{dy_3}{dt}=y_2/\lambda-y_3/\eta +\begin{align*} +\frac{dy_1}{dt} &= \mu - \beta(t) y_1 y_3 \\ +\frac{dy_2}{dt} &= \beta(t)y_1y_3 - \frac{y_2}{\lambda} \\ +\frac{dy_3}{dt} &= \frac{y_2}{\lambda} - \frac{y_3}{\eta} +\end{align*} ``` with boundary condition ```math -y(0)=y(1) +y(0) = y(1) ``` - # Solution No analytical solution diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index 0947e39..62985ee 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -27,10 +27,10 @@ prob_bvp_linear_1_tspan = (0.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}y_1 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\[2pt] +\frac{dy_2}{dt} &= \frac{1}{\lambda} y_1 +\end{align*} ``` with boundary condition @@ -44,10 +44,10 @@ y_1(0)=1, y_1(1)=0 The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \frac{\exp(-t/\sqrt{\lambda}) - \exp((t-2)/\sqrt{\lambda})}{1-\exp(-2/\sqrt{\lambda})} -``` -```math -y_2(t)=y_1'(t) +\begin{align*} +y_1(t) &= \frac{\exp(-t/\sqrt{\lambda}) - \exp((t-2)/\sqrt{\lambda})}{1-\exp(-2/\sqrt{\lambda})} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -85,10 +85,10 @@ prob_bvp_linear_2_tspan = (0.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}y_2 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}y_2 +\end{align*} ``` with boundary condition @@ -102,10 +102,10 @@ y_1(0)=1, y_1(1)=0 The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \frac{1-\exp((t-1)/\lambda)}{1-\exp(-1/\lambda)} -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \frac{1-\exp((t-1)/\lambda)}{1-\exp(-1/\lambda)} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -146,10 +146,10 @@ prob_bvp_linear_3_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1, y_2) +\end{align*} ``` where @@ -169,10 +169,10 @@ y_1(-1)=-1, y_1(1)=-1 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -210,10 +210,10 @@ prob_bvp_linear_4_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -225,7 +225,10 @@ f(y_1, y_2)=-y2+(1+\lambda)y1 with boundary condition ```math -y_1(-1)=1+\exp(-2), y_1(1)=1+\exp(-2(1+\lambda)) +\begin{align*} +y_1(-1) &= 1 + \exp(-2), \\ +y_1(1) &= 1 + \exp(-2(1+\lambda)) +\end{align*} ``` # Solution @@ -233,10 +236,10 @@ y_1(-1)=1+\exp(-2), y_1(1)=1+\exp(-2(1+\lambda)) The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \exp(t-1)+\exp(-(1+\lambda)(1+t)/\lambda) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \exp(t-1) + \exp(-(1+\lambda)(1+t)/\lambda) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -276,10 +279,10 @@ prob_bvp_linear_5_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1, y_2) +\end{align*} ``` where @@ -299,10 +302,10 @@ y_1(-1)=-1, y_1(1)=-1 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -341,10 +344,10 @@ prob_bvp_linear_6_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_2) +\end{align*} ``` where @@ -364,10 +367,10 @@ y_1(-1)=-2, y_1(1)=0 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t) + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -413,10 +416,10 @@ prob_bvp_linear_7_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1, y_2) +\end{align*} ``` where @@ -436,10 +439,10 @@ y_1(-1)=-1, y_1(1)=1 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t) + t + \frac{t\erf(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{} -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) + t + \frac{t\erf(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -477,10 +480,10 @@ prob_bvp_linear_8_tspan = (0.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda} y_2 +\end{align*} ``` with boundary condition @@ -494,10 +497,10 @@ y_1(0)=1, y_1(1)=2 The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = (2-\exp(-1/\lambda)-\exp(-t/\lambda))/(1-\exp(-1/\lambda)) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= (2 - \exp(-1/\lambda) - \exp(-t/\lambda))/(1 - \exp(-1/\lambda)) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -535,10 +538,10 @@ prob_bvp_linear_9_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda+t^2}f(t, y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda+t^2} f(t, y_1, y_2) +\end{align*} ``` where @@ -558,10 +561,10 @@ y_1(-1)=1/(1+\lambda), y_1(1)=1/(1+\lambda) The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = 1/(\lambda+t^2) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \frac{1}{\lambda + t^2} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -600,16 +603,10 @@ prob_bvp_linear_10_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_2) -``` - -where - -```math -f(t, y_2)=-ty_2 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= - \frac{1}{\lambda} t y_2 +\end{align*} ``` with boundary condition @@ -623,10 +620,10 @@ y_1(-1)=0, y_1(1)=2 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = 1+\erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= 1 + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -664,10 +661,10 @@ prob_bvp_linear_11_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1) +\end{align*} ``` where @@ -687,10 +684,10 @@ y_1(-1)=0, y_1(1)=2 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -730,10 +727,10 @@ prob_bvp_linear_12_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1) +\end{align*} ``` where @@ -753,10 +750,10 @@ y_1(-1)=-1, y_1(1)=0 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t)+\frac{\exp((t+1)/\sqrt{\lambda})-\exp((-t-1))/\sqrt{\lambda}}{\exp(2/\sqrt{\lambda})-\exp(-2/\sqrt{\lambda})} -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) + \frac{\exp((t+1)/\sqrt{\lambda}) - \exp(-(t+1))/\sqrt{\lambda}}{\exp(2/\sqrt{\lambda})-\exp(-2/\sqrt{\lambda})} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -795,10 +792,10 @@ prob_bvp_linear_13_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1) +\end{align*} ``` where @@ -818,10 +815,10 @@ y_1(-1)=0, y_1(1)=-1 The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t)+\exp(-(t+1)/\sqrt{\lambda}) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) + \exp(-(t+1)/\sqrt{\lambda}) +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -860,10 +857,10 @@ prob_bvp_linear_14_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 +\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1) +\end{align*} ``` where @@ -883,10 +880,10 @@ y_1(-1)=\exp(-2/\sqrt{\lambda}, y_1(1)=\exp(-2/\sqrt{\lambda}) The analytical solution for ``t \in [-1, 1]`` is ```math -y_1(t) = \cos(\pi t)+\exp((t-1)/\sqrt{\lambda})+\exp(-(t+1)/\sqrt{\lambda}) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \cos(\pi t) + \exp((t-1)/\sqrt{\lambda}) + \exp(-(t+1)/\sqrt{\lambda}) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -921,16 +918,10 @@ prob_bvp_linear_15_tspan = (-1.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1) -``` - -where - -```math -f(t, y_1)=ty_1 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda} t y_1 +\end{align*} ``` with boundary condition @@ -978,10 +969,10 @@ prob_bvp_linear_16_tspan = (0.0, 1.0) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda^2}f(y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda^2}f(y_1) +\end{align*} ``` where @@ -1001,10 +992,10 @@ y_1(0)=0, y_1(1)=\sin(\pi/(2*\lambda)) The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \sin(\pi t/2\lambda) when 1/\lambda is odd -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \sin(\pi t/2\lambda) \text{ when } 1/\lambda \text{ is odd } \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -1041,10 +1032,10 @@ prob_bvp_linear_17_tspan = (-0.1, 0.1) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = f(y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= f(y_1) +\end{align*} ``` where @@ -1064,10 +1055,10 @@ y_1(-0.1)=-0.1/\sqrt{\lambda+0.01}, y_1(0.1)=0.1/\sqrt{\lambda+0.01} The analytical solution for ``t \in [-0.1, 0.1]`` is ```math -y_1(t) = t/\sqrt{\lambda+t^2} -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= t/\sqrt{\lambda+t^2} \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -1105,16 +1096,10 @@ prob_bvp_linear_18_tspan = (0, 1) Linear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2 -``` - -where - -```math -f(y_2)=-y_1 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda}y_2 +\end{align*} ``` with boundary condition @@ -1128,10 +1113,10 @@ y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01} The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \exp(-t/\lambda) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \exp(-t/\lambda) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References diff --git a/lib/BVProblemLibrary/src/nonlinear.jl b/lib/BVProblemLibrary/src/nonlinear.jl index 9e5b974..6a4d231 100644 --- a/lib/BVProblemLibrary/src/nonlinear.jl +++ b/lib/BVProblemLibrary/src/nonlinear.jl @@ -23,10 +23,10 @@ prob_bvp_nonlinear_1_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2 +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda}y_2 +\end{align*} ``` where @@ -46,10 +46,10 @@ y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01} The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \exp(-t/\lambda) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \exp(-t/\lambda) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -87,10 +87,10 @@ prob_bvp_nonlinear_2_tspan = (0, 1) Nonlinear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda} f(y_2) +\end{align*} ``` where @@ -102,7 +102,10 @@ f(y_2)=--y_2^2+1 with boundary condition ```math -y_1(0)=1+\lambda\ln\cosh(-0.745/\lambda), y_1(1)=1+\lambda\ln\cosh(0.255/\lambda) +\begin{align*} +y_1(0) &= 1 + \lambda\ln\cosh(-0.745/\lambda), \\ +y_1(1) &= 1 + \lambda\ln\cosh(0.255/\lambda) +\end{align*} ``` # Solution @@ -110,10 +113,10 @@ y_1(0)=1+\lambda\ln\cosh(-0.745/\lambda), y_1(1)=1+\lambda\ln\cosh(0.255/\lambda The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = 1+\lambda\ln\cosh((t-0.745)/\lambda) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= 1 + \lambda\ln\cosh((t-0.745)/\lambda) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -152,10 +155,10 @@ prob_bvp_nonlinear_3_tspan = (0, 1) Nonlinear boundary value problem with analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y, y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y, y_1) +\end{align*} ``` where @@ -175,10 +178,10 @@ y_1(0)=1, y_1(1)=\exp(-1/\sqrt{\lambda}) The analytical solution for ``t \in [0, 1]`` is ```math -y_1(t) = \exp(-t/\sqrt{\lambda}) -``` -```math -y_2(t) = y_1'(t) +\begin{align*} +y_1(t) &= \exp(-t/\sqrt{\lambda}) \\ +y_2(t) &= y_1'(t) +\end{align*} ``` # References @@ -213,10 +216,10 @@ prob_bvp_nonlinear_4_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -267,10 +270,10 @@ prob_bvp_nonlinear_5_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda} f(y_1) +\end{align*} ``` where @@ -327,10 +330,10 @@ This problem describes a shock wave in a one dimension nozzle flow. The steady state Navier-Stokes equations generate a second order differential equations which can be reduced to a first order system described by nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y_1) +\end{align*} ``` where @@ -381,10 +384,10 @@ prob_bvp_nonlinear_7_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -435,10 +438,10 @@ prob_bvp_nonlinear_8_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -489,10 +492,10 @@ prob_bvp_nonlinear_9_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) \\ +\end{align*} ``` where @@ -543,10 +546,10 @@ prob_bvp_nonlinear_10_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -597,10 +600,10 @@ prob_bvp_nonlinear_11_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -651,10 +654,10 @@ prob_bvp_nonlinear_12_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\end{align*} ``` where @@ -711,16 +714,12 @@ prob_bvp_nonlinear_13_tspan = (0, 1) Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = \sin(y_2) -``` -```math -\frac{dy_2}{dt} = y_3 -``` -```math -\frac{dy_3}{dt} = -y_4/\lambda -``` -```math -\frac{dy_4}{dt} = f(y_1, y_2, y_3, y_4) +\begin{align*} +\frac{dy_1}{dt} &= \sin(y_2) \\ +\frac{dy_2}{dt} &= y_3 \\ +\frac{dy_3}{dt} &= -y_4/\lambda \\ +\frac{dy_4}{dt} &= f(y_1, y_2, y_3, y_4) +\end{align*} ``` where @@ -777,22 +776,12 @@ This problem arises from fluid injection through one side of a long vertical cha Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = y_3 -``` -```math -\frac{dy_3}{dt} = y_4 -``` -```math -\frac{dy_4}{dt} = f(y_1, y_2, y_3, y_4) -``` - -where - -```math -f(y_1, y_2, y_3, y_4)=\lambda(y_2y_3-y_1y_4) +\begin{align*} +\frac{dy_1}{dt} &= y_2 \\ +\frac{dy_2}{dt} &= y_3 \\ +\frac{dy_3}{dt} &= y_4 \\ +\frac{dy_4}{dt} &= \lambda(y_2 y_3 - y_1 y_4) +\end{align*} ``` with boundary condition @@ -846,28 +835,23 @@ This problem arises from fluid injection through one side of a long vertical cha Nonlinear boundary value problem with no analytical solution, given by ```math -\frac{dy_1}{dt} = y_2 -``` -```math -\frac{dy_2}{dt} = \frac{1}{\lambda}y_1y_4-y_3y_2 -``` -```math -\frac{dy_3}{dt} = y_4 -``` -```math -\frac{dy_4}{dt} = y_5 -``` -```math -\frac{dy_5}{dt} = y_6 -``` -```math -\frac{dy_6}{dt} = \frac{1}{\lambda}(-y_3y_6-y_1y_2) +\begin{align*} +\frac{dy_1}{dt} &= y_2, & +\frac{dy_2}{dt} &= \frac{1}{\lambda}y_1y_4 - y_3y_2, \\ +\frac{dy_3}{dt} &= y_4, & +\frac{dy_4}{dt} &= y_5, \\ +\frac{dy_5}{dt} &= y_6, & +\frac{dy_6}{dt} &= \frac{1}{\lambda}(-y_3y_6-y_1y_2) +\end{align*} ``` with boundary condition ```math -y_1(0)=-1, y_3(0)=0, y_4(0)=0, y_1(1)=1, y_3(1)=0, y_4(1)=0 +\begin{align*} +y_1(0)&=-1, & y_3(0)&=0, & y_4(0)&=0, \\ +y_1(1)&= 1, & y_3(1)&=0, & y_4(1)&=0. +\end{align*} ``` # Solution diff --git a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl index 1dc34b3..daf8d66 100644 --- a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl +++ b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl @@ -20,13 +20,11 @@ du0 = [-0.04, 0.04, 0.0] The Robertson biochemical reactions in DAE form ```math -\frac{dy₁}{dt} = -k₁y₁+k₃y₂y₃ -``` -```math -\frac{dy₂}{dt} = k₁y₁-k₂y₂^2-k₃y₂y₃ -``` -```math -1 = y₁ + y₂ + y₃ +\begin{align*} +\frac{dy₁}{dt} &= -k₁y₁+k₃y₂y₃ \\ +\frac{dy₂}{dt} &= k₁y₁-k₂y₂^2-k₃y₂y₃ \\ +1 &= y₁ + y₂ + y₃ +\end{align*} ``` where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 diff --git a/lib/DDEProblemLibrary/src/ddetst.jl b/lib/DDEProblemLibrary/src/ddetst.jl index 410bea6..835ae06 100644 --- a/lib/DDEProblemLibrary/src/ddetst.jl +++ b/lib/DDEProblemLibrary/src/ddetst.jl @@ -45,19 +45,19 @@ const prob_dde_DDETST_A1 = DDEProblem(f_dde_DDETST_A1, h_dde_DDETST_A1, (0.0, 50 Delay differential equation model of chronic granulocytic leukemia, given by ```math -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)}, -``` -```math -u_2'(t) = \frac{100 u_1(t)}{1 + 40 u_2(t)} - 2.43 u_2(t), +\begin{align*} +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)}, \\ +u_2'(t) &= \frac{100 u_1(t)}{1 + 40 u_2(t)} - 2.43 u_2(t), +\end{align*} ``` for ``t \in [0, 100]`` and history function ```math -\phi_1(t) = 1.05767027/3, -``` -```math -\phi_2(t) = 1.030713491/3, +\begin{align*} +\phi_1(t) &= 1.05767027/3, \\ +\phi_2(t) &= 1.030713491/3, +\end{align*} ``` for ``t \leq 0``. @@ -247,19 +247,19 @@ const prob_dde_DDETST_C1 = DDEProblem(f_dde_DDETST_C1, h_dde_DDETST_C1, (0.0, 30 Delay differential equation ```math -u_1'(t) = - 2 u_1(t - u_2(t)), -``` -```math -u_₂'(t) = \frac{|u_1(t - u_2(t))| - |u_1(t)|}{1 + |u_1(t - u_2(t))|}, +\begin{align*} +u_1'(t) &= - 2 u_1(t - u_2(t)), \\ +u_₂'(t) &= \frac{|u_1(t - u_2(t))| - |u_1(t)|}{1 + |u_1(t - u_2(t))|}, +\end{align*} ``` for ``t \in [0, 40]`` with history function ```math -\phi_1(t) = 1, -``` -```math -\phi_2(t) = 0.5, +\begin{align*} +\phi_1(t) &= 1, \\ +\phi_2(t) &= 0.5, +\end{align*} ``` for ``t \leq 0``. @@ -305,13 +305,11 @@ const prob_dde_DDETST_C2 = DDEProblem(f_dde_DDETST_C2!, h_dde_DDETST_C2, (0.0, 3 Delay differential equation model of hematopoiesis, given by ```math -u_1'(t) = \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, -``` -```math -u_2'(t) = f(u_1(t)) - k u_2(t), -``` -```math -u_3'(t) = 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +\begin{align*} +u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, \\ +u_2'(t) &= f(u_1(t)) - k u_2(t), \\ +u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +\end{align*} ``` for ``t \in [0, 300]`` with history function ``\phi_1(0) = 3.325``, ``\phi_3(0) = 120``, and @@ -370,13 +368,11 @@ Delay differential equation model of hematopoiesis, given by the same delay diff equation as [`prob_dde_DDETST_C3`](@ref) ```math -u_1'(t) = \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, -``` -```math -u_2'(t) = f(u_1(t)) - k u_2(t), -``` -```math -u_3'(t) = 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +\begin{align*} +u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, \\ +u_2'(t) &= f(u_1(t)) - k u_2(t), \\ +u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +\end{align*} ``` for ``t \in [0, 100]`` with history function @@ -427,19 +423,19 @@ end Delay differential equation ```math -u_1'(t) = u_2(t), -``` -```math -u_2'(t) = - u_2(\exp(1 - u_2(t))) u_2(t)^2 \exp(1 - u_2(t)), +\begin{align*} +u_1'(t) &= u_2(t), \\ +u_2'(t) &= - u_2(\exp(1 - u_2(t))) u_2(t)^2 \exp(1 - u_2(t)), +\end{align*} ``` for ``t \in [0.1, 5]`` with history function ```math -\phi_1(t) = \log t, -``` -```math -\phi_2(t) = 1 / t, +\begin{align*} +\phi_1(t) &= \log t, \\ +\phi_2(t) &= 1 / t, +\end{align*} ``` for ``t \in (0, 0.1]``. @@ -449,10 +445,10 @@ for ``t \in (0, 0.1]``. The analytical solution for ``t \in [0.1, 5]`` is ```math -u_1(t) = \log t, -``` -```math +\begin{align*} +u_1(t) = \log t, \\ u_2(t) = 1 / t. +\end{align*} ``` # References @@ -505,31 +501,23 @@ const prob_dde_DDETST_D1 = DDEProblem( Delay differential equation model of antigen antibody dynamics with fading memory, given by ```math -u_1'(t) = - r_1 u_1(t) u_2(t) + r_2 u_3(t), -``` -```math -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)), -``` -```math -u_3'(t) = r_1 u_1(t) u_2(t) - r_2 u_3(t), -``` -```math -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)), +\begin{align*} +u_1'(t) &= - r_1 u_1(t) u_2(t) + r_2 u_3(t), \\ +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)), \\ +u_3'(t) &= r_1 u_1(t) u_2(t) - r_2 u_3(t), \\ +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)), +\end{align*} ``` for ``t \in [0, 40]`` with history function ```math -\phi_1(t) = 5, -``` -```math -\phi_2(t) = 0.1, -``` -```math -\phi_3(t) = 0, -``` -```math -\phi_4(t) = 0, +\begin{align*} +\phi_1(t) &= 5, & +\phi_2(t) &= 0.1, \\ +\phi_3(t) &= 0, & +\phi_4(t) &= 0, +\end{align*} ``` for ``t \leq 0``, where ``r_1 = 0.02``, ``r_2 = 0.005``, ``\alpha = 3``, and ``\delta = 0.01``. @@ -611,19 +599,19 @@ end Delay differential equation model of a logistic Gauss-type predator-prey system, given by ```math -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}, -``` -```math -u_2'(t) = u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - \alpha\right), +\begin{align*} +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}, \\ +u_2'(t) &= u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - \alpha\right), +\end{align*} ``` for ``t \in [0, 2]`` with history function ```math -\phi_1(t) = 0.33 - t / 10, -``` -```math -\phi_2(t) = 2.22 + t / 10, +\begin{align*} +\phi_1(t) &= 0.33 - t / 10, \\ +\phi_2(t) &= 2.22 + t / 10, +\end{align*} ``` for ``t \leq 0``, where ``\alpha = 0.1``, ``\rho = 2.9``, and ``\tau = 0.42``. @@ -763,16 +751,12 @@ u(t) = u_i(t) = \exp(-4^i t^2 + B_i t + C_i) / 2^i + K_i if ``t \in [x_i, x_{i + 1}]``, where ```math -x_i = (1 - 2^{-i}) / 2, -``` -```math -B_i = 2 (4^{i-1} + B_{i-1}), -``` -```math -C_i = - 4^{i-2} - B_{i-1} / 2 + C_{i-1}, -``` -```math -K_i = - \exp(-4^i x_i^2 + B_i x_i + C_i) / 2^i + u_{i-1}(x_i), +\begin{align*} +x_i &= (1 - 2^{-i}) / 2, \\ +B_i &= 2 (4^{i-1} + B_{i-1}), \\ +C_i &= - 4^{i-2} - B_{i-1} / 2 + C_{i-1}, \\ +K_i &= - \exp(-4^i x_i^2 + B_i x_i + C_i) / 2^i + u_{i-1}(x_i), +\end{align*} ``` and ``B_0 = C_0 = K_0 = 0``. diff --git a/lib/DDEProblemLibrary/src/radar5.jl b/lib/DDEProblemLibrary/src/radar5.jl index 7f7a04c..b12a33c 100644 --- a/lib/DDEProblemLibrary/src/radar5.jl +++ b/lib/DDEProblemLibrary/src/radar5.jl @@ -11,19 +11,19 @@ http://www.unige.ch/~hairer/radar5-v2.1.tar Delay differential equation model from chemical kinetics, given by ```math - 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, -``` -```math - 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), +\begin{align*} + 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, \\ + 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), +\end{align*} ``` for ``t \in [0, 100.5]`` with history function ```math - \phi_1(t) = 1e-10, -``` -```math - \phi_2(t) = 1e-5, +\begin{align*} + \phi_1(t) &= 10^{-10}, \\ + \phi_2(t) &= 10^{-5}, +\end{align*} ``` for ``t \leq 0``, where ``k_1 = 1.34``, ``k_2 = 1.6e9``, ``k_3 = 8000``, ``k_4 = 4e7``, @@ -75,13 +75,11 @@ Delay differential equation model of a chemical reaction with steady state solut by ```math - u_1'(t) = - a u_1(t) + b u_2(t - \tau) u_3(t), -``` -```math - u_2'(t) = a u_1(t) - b u_2(t - \tau) u_3(t) - c u_2(t)^2, -``` -```math - u_3'(t) = c u_2(t)^2, +\begin{align*} + u_1'(t) &= - a u_1(t) + b u_2(t - \tau) u_3(t), \\ + u_2'(t) &= a u_1(t) - b u_2(t - \tau) u_3(t) - c u_2(t)^2, \\ + u_3'(t) &= c u_2(t)^2, +\end{align*} ``` for ``t \in [0, 10e10]`` with history function ``\phi_1(0) = 1``, ``\phi_2(t) = 0`` for @@ -132,43 +130,27 @@ end Delay differential equation model of antibody production, given by ```math - u_1'(t) = - r u_1(t) u_2(t) - s u_1(t) u_4(t), -``` -```math - 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], -``` -```math - u_3'(t) = r u_1(t) u_2(t), -``` -```math - 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], -``` -```math - 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))}, -``` -```math - 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))}, +\begin{align*} + u_1'(t) &= - r u_1(t) u_2(t) - s u_1(t) u_4(t), \\ + 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], \\ + u_3'(t) &= r u_1(t) u_2(t), \\ + 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], \\ + 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))}, \\ + u_6'(t) &= [t \geq t_1] \frac{10^{-12} + u_2(t) + u_3(t)}{10^{-12} + u_2(u_6(t)) + u_3(u_6(t))}, +\end{align*} ``` for ``t \in [0, 300]`` with history function ```math - \phi_1(t) = \phi_0, -``` -```math - \phi_2(t) = 1e-15, -``` -```math - \phi_3(t) = 0, -``` -```math - \phi_4(t) = 0, -``` -```math - \phi_5(t) = 0, -``` -```math - \phi_6(t) = 0, +\begin{align*} + \phi_1(t) &= \phi_0, & + \phi_2(t) &= 10^{-15}, \\ + \phi_3(t) &= 0, & + \phi_4(t) &= 0, \\ + \phi_5(t) &= 0, & + \phi_6(t) &= 0, +\end{align*} ``` for ``t \leq 0``, where ``\alpha = 1.8``, ``\beta = 20``, ``\gamma = 0.002``, ``r = 5e4``, diff --git a/lib/ODEProblemLibrary/src/brusselator_prob.jl b/lib/ODEProblemLibrary/src/brusselator_prob.jl index f34c7bf..b1f1370 100644 --- a/lib/ODEProblemLibrary/src/brusselator_prob.jl +++ b/lib/ODEProblemLibrary/src/brusselator_prob.jl @@ -59,10 +59,10 @@ xyd_brusselator = range(0, stop = 1, length = 32) 2D Brusselator ```math -\frac{\partial u}{\partial t} = 1 + u^2v - 4.4u + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) + f(x, y, t) -``` -```math -\frac{\partial v}{\partial t} = 3.4u - u^2v + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) +\begin{align*} +\frac{\partial u}{\partial t} &= 1 + u^2v - 4.4u + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) + f(x, y, t) \\ +\frac{\partial v}{\partial t} &= 3.4u - u^2v + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) +\end{align*} ``` where @@ -77,19 +77,19 @@ f(x, y, t) = \begin{cases} and the initial conditions are ```math -u(x, y, 0) = 22\cdot y(1-y)^{3/2} -``` -```math -v(x, y, 0) = 27\cdot x(1-x)^{3/2} +\begin{align*} +u(x, y, 0) &= 22\cdot y(1-y)^{3/2} \\ +v(x, y, 0) &= 27\cdot x(1-x)^{3/2} +\end{align*} ``` with the periodic boundary condition ```math -u(x+1,y,t) = u(x,y,t) -``` -```math -u(x,y+1,t) = u(x,y,t) +\begin{align*} +u(x+1,y,t) &= u(x,y,t) \\ +u(x,y+1,t) &= u(x,y,t) +\end{align*} ``` From Hairer Norsett Wanner Solving Ordinary Differential Equations II - Stiff and Differential-Algebraic Problems Page 152 @@ -130,28 +130,28 @@ end 1D Brusselator ```math -\frac{\partial u}{\partial t} = A + u^2v - (B+1)u + \alpha\frac{\partial^2 u}{\partial x^2} -``` -```math -\frac{\partial v}{\partial t} = Bu - u^2v + \alpha\frac{\partial^2 u}{\partial x^2} +\begin{align*} +\frac{\partial u}{\partial t} &= A + u^2v - (B+1)u + \alpha\frac{\partial^2 u}{\partial x^2} \\ +\frac{\partial v}{\partial t} &= Bu - u^2v + \alpha\frac{\partial^2 u}{\partial x^2} +\end{align*} ``` and the initial conditions are ```math -u(x,0) = 1+\sin(2π x) -``` -```math -v(x,0) = 3 +\begin{align*} +u(x,0) &= 1 + \sin(2π x) \\ +v(x,0) &= 3 +\end{align*} ``` with the boundary condition ```math -u(0,t) = u(1,t) = 1 -``` -```math +\begin{align*} +u(0,t) = u(1,t) = 1 \\ v(0,t) = v(1,t) = 3 +\end{align*} ``` From Hairer Norsett Wanner Solving Ordinary Differential Equations II - Stiff and Differential-Algebraic Problems Page 6 diff --git a/lib/ODEProblemLibrary/src/nonlinchem.jl b/lib/ODEProblemLibrary/src/nonlinchem.jl index 54415a7..9f2885d 100644 --- a/lib/ODEProblemLibrary/src/nonlinchem.jl +++ b/lib/ODEProblemLibrary/src/nonlinchem.jl @@ -23,15 +23,11 @@ nonLinChem_f = ODEFunction(nonLinChem, analytic = nlc_analytic) Nonlinear system of reactions with an analytical solution ```math -\frac{dy_1}{dt} = -y_1 -``` - -```math -\frac{dy_2}{dt} = y_1 - y_2^2 -``` - -```math -\frac{dy_3}{dt} = y_2^2 +\begin{align*} +\frac{dy_1}{dt} &= -y_1 \\ +\frac{dy_2}{dt} &= y_1 - y_2^2 \\ +\frac{dy_3}{dt} &= y_2^2 +\end{align*} ``` with initial condition ``y=[1;0;0]`` on a time span of ``t \in (0,20)`` diff --git a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl index a735995..c0da30b 100644 --- a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl @@ -11,10 +11,10 @@ end Lotka-Volterra Equations (Non-stiff) ```math -\frac{dx}{dt} = ax - bxy -``` -```math -\frac{dy}{dt} = -cy + dxy +\begin{align*} +\frac{dx}{dt} &= ax - bxy \\ +\frac{dy}{dt} &= -cy + dxy \\ +\end{align*} ``` with initial condition ``x=y=1`` @@ -37,10 +37,10 @@ end Fitzhugh-Nagumo (Non-stiff) ```math -\frac{dv}{dt} = v - \frac{v^3}{3} - w + I_{est} -``` -```math -τ \frac{dw}{dt} = v + a -bw +\begin{align*} +\frac{dv}{dt} &= v - \frac{v^3}{3} - w + I_{est} \\ +τ \frac{dw}{dt} &= v + a -bw +\end{align*} ``` with initial condition ``v=w=1`` @@ -72,10 +72,10 @@ end Van der Pol Equations ```math -\frac{dx}{dt} = y -``` -```math -\frac{dy}{dt} = μ ((1-x^2)y - x) +\begin{align*} +\frac{dx}{dt} &= y \\ +\frac{dy}{dt} &= μ \left(\left(1-x^2\right) y - x\right) +\end{align*} ``` with ``μ=1.0`` and ``u_0=[\sqrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``) @@ -89,10 +89,10 @@ prob_ode_vanderpol = ODEProblem(ODEFunction(vanderpol, jac=vanderpol_jac), Van der Pol Equations ```math -\frac{dx}{dt} = y -``` -```math -\frac{dy}{dt} = μ ((1-x^2)y - x) +\begin{align*} +\frac{dx}{dt} &= y \\ +\frac{dy}{dt} &= μ \left(\left(1 - x^2\right) y - x\right) +\end{align*} ``` with ``μ=10^6`` and ``u_0=[\sqrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``) @@ -119,13 +119,11 @@ end The Robertson biochemical reactions: (Stiff) ```math -\frac{dy₁}{dt} = -k₁y₁+k₃y₂y₃ -``` -```math -\frac{dy₂}{dt} = k₁y₁-k₂y₂^2-k₃y₂y₃ -``` -```math -\frac{dy₃}{dt} = k₂y₂^2 +\begin{align*} +\frac{dy₁}{dt} &= -k₁y₁ + k₃y₂y₃ \\ +\frac{dy₂}{dt} &= k₁y₁ - k₂y₂^2 - k₃y₂y₃ \\ +\frac{dy₃}{dt} &= k₂y₂^2 +\end{align*} ``` where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: @@ -161,22 +159,18 @@ end The ThreeBody problem as written by Hairer: (Non-stiff) ```math -\frac{dy₁}{dt} = y₁ + 2\frac{dy₂}{dt} - \bar{μ}\frac{y₁+μ}{D₁} - μ\frac{y₁-\bar{μ}}{D₂} +\begin{align*} +\frac{dy₁}{dt} &= y₁ + 2\frac{dy₂}{dt} - \bar{μ}\frac{y₁+μ}{D₁} - μ\frac{y₁-\bar{μ}}{D₂} \\ +\frac{dy₂}{dt} &= y₂ - 2\frac{dy₁}{dt} - \bar{μ}\frac{y₂}{D₁} - μ\frac{y₂}{D₂} +\end{align*} ``` ```math -\frac{dy₂}{dt} = y₂ - 2\frac{dy₁}{dt} - \bar{μ}\frac{y₂}{D₁} - μ\frac{y₂}{D₂} -``` -```math -D₁ = ((y₁+μ)^2 + y₂^2)^{3/2} -``` -```math -D₂ = ((y₁-\bar{μ})^2+y₂^2)^{3/2} -``` -```math -μ = 0.012277471 -``` -```math -\bar{μ} =1-μ +\begin{align*} +D₁ &= \left((y₁+μ)^2 + y₂^2\right)^{3/2} \\ +D₂ &= \left((y₁-\bar{μ})^2 + y₂^2\right)^{3/2} \\ +μ &= 0.012277471 \\ +\bar{μ} &= 1-μ +\end{align*} ``` From Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 @@ -206,13 +200,11 @@ end Rigid Body Equations (Non-stiff) ```math -\frac{dy₁}{dt} = I₁y₂y₃ -``` -```math -\frac{dy₂}{dt} = I₂y₁y₃ -``` -```math -\frac{dy₃}{dt} = I₃y₁y₂ +\begin{align*} +\frac{dy₁}{dt} &= I₁y₂y₃ \\ +\frac{dy₂}{dt} &= I₂y₁y₃ \\ +\frac{dy₃}{dt} &= I₃y₁y₂ +\end{align*} ``` with ``I₁=-2``, ``I₂=1.25``, and ``I₃=-1/2``. @@ -252,10 +244,10 @@ end Pleiades Problem (Non-stiff) ```math -\frac{d^2xᵢ}{dt^2} = \sum_{j≠i} mⱼ(xⱼ-xᵢ)/rᵢⱼ -``` -```math -\frac{d^2yᵢ}{dt^2} = \sum_{j≠i} mⱼ(yⱼ-yᵢ)/rᵢⱼ +\begin{align*} +\frac{d^2xᵢ}{dt^2} &= \sum_{j≠i} mⱼ(xⱼ-xᵢ)/rᵢⱼ \\ +\frac{d^2yᵢ}{dt^2} &= \sum_{j≠i} mⱼ(yⱼ-yᵢ)/rᵢⱼ +\end{align*} ``` where @@ -267,61 +259,26 @@ rᵢⱼ = ((xᵢ-xⱼ)^2 + (yᵢ-yⱼ)^2)^{3/2} and initial conditions are ```math -x₁(0) = 3 -``` -```math -x₂(0) = 3 -``` -```math -x₃(0) = -1 -``` -```math -x₄(0) = -3 -``` -```math -x₅(0) = 2 -``` -```math -x₆(0) = -2 -``` -```math -x₇(0) = 2 -``` -```math -y₁(0) = 3 -``` -```math -y₂(0) = -3 -``` -```math -y₃(0) = 2 -``` -```math -y₄(0) = 0 -``` -```math -y₅(0) = 0 -``` -```math -y₆(0) = -4 -``` -```math -y₇(0) = 4 +\begin{align*} +x₁(0) &= 3, & y₁(0) &= 3, \\ +x₂(0) &= 3, & y₂(0) &= -3, \\ +x₃(0) &= -1, & y₃(0) &= 2, \\ +x₄(0) &= -3, & y₄(0) &= 0, \\ +x₅(0) &= 2, & y₅(0) &= 0, \\ +x₆(0) &= -2, & y₆(0) &= -4, \\ +x₇(0) &= 2, & y₇(0) &= 4 +\end{align*} ``` and with ``\frac{dxᵢ(0)}{dt}=\frac{dyᵢ(0)}{dt}=0`` except for ```math -\frac{dx₆(0)}{dt} = 1.75 -``` -```math -\frac{dx₇(0)}{dt} = -1.5 -``` -```math -\frac{dy₄(0)}{dt} = -1.25 -``` -```math -\frac{dy₅(0)}{dt} = 1 +\begin{align*} +\frac{dx₆(0)}{dt} &= 1.75, & +\frac{dx₇(0)}{dt} &= -1.5, \\ +\frac{dy₄(0)}{dt} &= -1.25, & +\frac{dy₅(0)}{dt} &= 1 +\end{align*} ``` From Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 244 diff --git a/lib/ODEProblemLibrary/src/strange_attractors.jl b/lib/ODEProblemLibrary/src/strange_attractors.jl index d1c62be..62aa10e 100644 --- a/lib/ODEProblemLibrary/src/strange_attractors.jl +++ b/lib/ODEProblemLibrary/src/strange_attractors.jl @@ -16,11 +16,11 @@ end Thomas' cyclically symmetric attractor equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= \sin(y) - bx \\ \frac{dy}{dt} &= \sin(z) - by \\ \frac{dz}{dt} &= \sin(x) - bz -\end{align} +\end{align*} ``` with parameter ``b = 0.208186`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -46,11 +46,11 @@ end Lorenz equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= σ(y - x) \\ \frac{dy}{dt} &= x(ρ - z) - y \\ \frac{dz}{dt} &= xy - βz -\end{align} +\end{align*} ``` with parameters ``σ=10, ρ=28, β=8/3`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -76,11 +76,11 @@ end Aizawa equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= (z - b)x - dy \\ \frac{dy}{dt} &= dx + (z - b)y \\ \frac{dz}{dt} &= c + az - \frac{z^3}{3} - (x^2 + y^2)(1 + ez) + fzx^3 -\end{align} +\end{align*} ``` with parameters ``a=0.95, b=0.7, c=0.6, d=3.5, e=0.25, f=0.1`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -104,11 +104,11 @@ end Dadras equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= y - ax + byz \\ \frac{dy}{dt} &= cy - xz + z \\ \frac{dz}{dt} &= dxy - ez -\end{align} +\end{align*} ``` with parameters ``a=3, b=2.7, c=1.7, d=2, e=9`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -132,11 +132,11 @@ end Chen equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= a(y - x) \\ \frac{dy}{dt} &= (c - a)x - xz + cy \\ \frac{dz}{dt} &= xy - bz -\end{align} +\end{align*} ``` with parameters ``a=35, b=3, c=28`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -160,11 +160,11 @@ end Rössler equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= -(y + z) \\ \frac{dy}{dt} &= x + ay \\ \frac{dz}{dt} &= b + z(x - c) -\end{align} +\end{align*} ``` with parameters ``a=0.2, b=0.2, c=5.7`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -189,11 +189,11 @@ end Rabinovich-Fabrikant equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= y(z - 1 + x^2) + bx \\ \frac{dy}{dt} &= x(3z + 1 - x^2) + by \\ \frac{dz}{dt} &= -2z(a + xy) -\end{align} +\end{align*} ``` with parameters ``a=0.14, b=0.10`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -217,11 +217,11 @@ end Sprott equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= y + axy + xz \\ \frac{dy}{dt} &= 1 - bx^2 + yz \\ \frac{dz}{dt} &= x - x^2 - y^2 -\end{align} +\end{align*} ``` with parameters ``a=2.07, b=1.79`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` @@ -245,11 +245,11 @@ end Hindmarsh-Rose equations ```math -\begin{align} +\begin{align*} \frac{dx}{dt} &= y - ax^3 + bx^2 - z + i \\ \frac{dy}{dt} &= c - dx^2 - y \\ \frac{dz}{dt} &= r(s(x - x_r) - z) -\end{align} +\end{align*} ``` with parameters ``a=1, b=3, c=1, d=5, r=1e-2, s=4, x_r=-8/5, i=5`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` diff --git a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl index da847ad..0f235e4 100644 --- a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl +++ b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl @@ -139,13 +139,11 @@ end Lorenz Attractor with additive noise ```math -dx = σ(y-x)dt + αdW_t -``` -```math -dy = (x(ρ-z) - y)dt + αdW_t -``` -```math -dz = (xy - βz)dt + αdW_t +\begin{align*} +dx &= σ(y-x) \, dt + α \, dW_t \\ +dy &= (x(ρ-z) - y) \, dt + α \, dW_t \\ +dz &= (xy - βz) \, dt + α \, dW_t +\end{align*} ``` with ``σ=10``, ``ρ=28``, ``β=8/3``, ``α=3.0`` and initial condition ``u_0=[1;1;1]``. From 9af6e2f6349077a29eafe0b405784d889690f920 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sun, 7 Sep 2025 22:49:09 -0400 Subject: [PATCH 02/10] Add `\operatorname` for `erf()` `\erf` is not recognized by the Documenter TeX renderer --- lib/BVProblemLibrary/src/linear.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index 62985ee..d7edcb7 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -368,7 +368,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) \\ +y_1(t) &= \cos(\pi t) + \operatorname{erf}(t/\sqrt{2\lambda})/\operatorname{erf}(1/\sqrt{2\lambda}) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -440,7 +440,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + t + \frac{t\erf(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{} \\ +y_1(t) &= \cos(\pi t) + t + \frac{t\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -621,7 +621,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= 1 + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda}) \\ +y_1(t) &= 1 + \operatorname{erf}(t/\sqrt{2\lambda})/\operatorname{erf}(1/\sqrt{2\lambda}) \\ y_2(t) &= y_1'(t) \end{align*} ``` From ea814570989cc671dec4cb8ad6bffb0b2b845848 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sun, 7 Sep 2025 22:50:10 -0400 Subject: [PATCH 03/10] Complete equation in docstring --- lib/BVProblemLibrary/src/linear.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index d7edcb7..55d0262 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -440,7 +440,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + t + \frac{t\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{} \\ +y_1(t) &= \cos(\pi t) + t + \frac{t\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-1/2\lambda)} \\ y_2(t) &= y_1'(t) \end{align*} ``` From 56978ad6c5a308a01cdf21cfee87eb97c0f33b7e Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sun, 7 Sep 2025 22:56:31 -0400 Subject: [PATCH 04/10] Update TeX formatting Fix up whitespace and delimiters in both source and render --- lib/BVProblemLibrary/src/linear.jl | 54 ++++++++++--------- lib/BVProblemLibrary/src/nonlinear.jl | 30 ++++++----- .../src/DAEProblemLibrary.jl | 44 +++++++-------- lib/ODEProblemLibrary/src/brusselator_prob.jl | 4 +- lib/ODEProblemLibrary/src/ode_linear_prob.jl | 12 ++--- .../src/ode_simple_nonlinear_prob.jl | 25 +++++++-- lib/ODEProblemLibrary/src/pollution_prob.jl | 25 ++++++++- .../src/SDEProblemLibrary.jl | 18 +++---- 8 files changed, 129 insertions(+), 83 deletions(-) diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index 55d0262..9e582fb 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -36,7 +36,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(0)=1, y_1(1)=0 +y_1(0)=1, \;\; y_1(1)=0 ``` # Solution @@ -94,7 +94,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(0)=1, y_1(1)=0 +y_1(0)=1, \;\; y_1(1)=0 ``` # Solution @@ -155,13 +155,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1, y_2) = -(2+\cos(\pi t))y_2 + y_1 -(1+\lambda \pi^2)\cos(\pi t) - (2+\cos(\pi t))\pi\sin(\pi t) +f(t, y_1, y_2) = -[2+\cos(\pi t)]y_2 + y_1 -(1+\lambda \pi^2)\cos(\pi t) - [2+\cos(\pi t)]\pi\sin(\pi t) ``` with boundary condition ```math -y_1(-1)=-1, y_1(1)=-1 +y_1(-1)=-1,\;\; y_1(1)=-1 ``` # Solution @@ -219,7 +219,7 @@ Linear boundary value problem with analytical solution, given by where ```math -f(y_1, y_2)=-y2+(1+\lambda)y1 +f(y_1, y_2) = -y_2 + (1+\lambda) y_1 ``` with boundary condition @@ -288,13 +288,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1, y_2)=ty_2+y_1-(1+\lambda\pi^2)\cos(\pi t)+\pi t\sin(\pi t) +f(t, y_1, y_2) = ty_2 + y_1 - (1+\lambda\pi^2)\cos(\pi t) + \pi t\sin(\pi t) ``` with boundary condition ```math -y_1(-1)=-1, y_1(1)=-1 +y_1(-1)=-1, \;\; y_1(1)=-1 ``` # Solution @@ -353,13 +353,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_2)=ty_2 - \lambda\pi^2\cos(\pi t)-\pi t\sin(\pi t) +f(t, y_2) = ty_2 - \lambda\pi^2\cos(\pi t)-\pi t\sin(\pi t) ``` with boundary condition ```math -y_1(-1)=-2, y_1(1)=0 +y_1(-1)=-2, \;\; y_1(1)=0 ``` # Solution @@ -425,13 +425,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1, y_2)=ty_2+y_1-(1+\lambda\pi^2)\cos(\pi t)+\pi t\sin(\pi t) +f(t, y_1, y_2) = t y_2 + y_1 - (1+\lambda\pi^2)\cos(\pi t) + \pi t\sin(\pi t) ``` with boundary condition ```math -y_1(-1)=-1, y_1(1)=1 +y_1(-1)=-1, \;\; y_1(1)=1 ``` # Solution @@ -489,7 +489,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(0)=1, y_1(1)=2 +y_1(0)=1, \;\; y_1(1)=2 ``` # Solution @@ -498,7 +498,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= (2 - \exp(-1/\lambda) - \exp(-t/\lambda))/(1 - \exp(-1/\lambda)) \\ +y_1(t) &= \frac{2 - \exp(-1/\lambda) - \exp(-t/\lambda)}{1 - \exp(-1/\lambda)} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -612,7 +612,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(-1)=0, y_1(1)=2 +y_1(-1)=0, \;\; y_1(1)=2 ``` # Solution @@ -670,13 +670,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) ``` with boundary condition ```math -y_1(-1)=0, y_1(1)=2 +y_1(-1)=0, \;\; y_1(1)=2 ``` # Solution @@ -736,7 +736,7 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) ``` with boundary condition @@ -801,13 +801,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) ``` with boundary condition ```math -y_1(-1)=0, y_1(1)=-1 +y_1(-1)=0, \;\; y_1(1)=-1 ``` # Solution @@ -872,7 +872,8 @@ f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t) with boundary condition ```math -y_1(-1)=\exp(-2/\sqrt{\lambda}, y_1(1)=\exp(-2/\sqrt{\lambda}) +y_1(-1) = \exp(-2/\sqrt{\lambda}), \;\; +y_1(1) = \exp(-2/\sqrt{\lambda}) ``` # Solution @@ -927,7 +928,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(-1)=1, y_1(1)=1 +y_1(-1)=1, \;\; y_1(1)=1 ``` # Solution @@ -978,13 +979,13 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1)=-π^2y_1/4 +f(t, y_1) = -π^2 y_1/4 ``` with boundary condition ```math -y_1(0)=0, y_1(1)=\sin(\pi/(2*\lambda)) +y_1(0)=0, \;\; y_1(1)=\sin(\pi/(2\lambda)) ``` # Solution @@ -1041,13 +1042,14 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1)=-3\lambda y_1/(\lambda+t^2)^2 +f(t, y_1) = -3\lambda y_1 / (\lambda+t^2)^2 ``` with boundary condition ```math -y_1(-0.1)=-0.1/\sqrt{\lambda+0.01}, y_1(0.1)=0.1/\sqrt{\lambda+0.01} +y_1(-0.1) = \frac{-0.1}{\sqrt{\lambda+0.01}}, +y_1(0.1) = \frac{ 0.1}{\sqrt{\lambda+0.01}} ``` # Solution @@ -1105,7 +1107,7 @@ Linear boundary value problem with analytical solution, given by with boundary condition ```math -y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01} +y_1(0)=1, \;\; y_1(1)=\frac{0.1}{\sqrt{\lambda+0.01}} ``` # Solution diff --git a/lib/BVProblemLibrary/src/nonlinear.jl b/lib/BVProblemLibrary/src/nonlinear.jl index 6a4d231..b1c8b4c 100644 --- a/lib/BVProblemLibrary/src/nonlinear.jl +++ b/lib/BVProblemLibrary/src/nonlinear.jl @@ -164,7 +164,7 @@ Nonlinear boundary value problem with analytical solution, given by where ```math -f(y_1)=y_1+y_1^2-\exp(-2t/\sqrt{\lambda}) +f(y_1) = y_1 + y_1^2 - \exp(-2t/\sqrt{\lambda}) ``` with boundary condition @@ -279,7 +279,7 @@ Nonlinear boundary value problem with no analytical solution, given by where ```math -f(y_1)=\lambda\sinh(\lambda z) +f(y_1) = \lambda\sinh(\lambda z) ``` with boundary condition @@ -339,13 +339,13 @@ The steady state Navier-Stokes equations generate a second order differential eq where ```math -f(t, y_1, y_2)=(\frac{1+\gamma}{2}-\lambda A'(t))y_1y_2-\frac{y_2}{y_1}-\frac{A'(t)}{A(t)}(1-(\frac{\gamma-1}{2})y_1^2) +f(t, y_1, y_2) = \left(\frac{1+\gamma}{2}-\lambda A'(t)\right) y_1y_2 - \frac{y_2}{y_1} - \frac{A'(t)}{A(t)} \left(1 - \frac{\gamma-1}{2} y_1^2\right) ``` with boundary condition ```math -y_1(0)=0.9129, y_1(1)=0.375 +y_1(0)=0.9129, \;\; y_1(1)=0.375 ``` # Solution @@ -393,13 +393,13 @@ Nonlinear boundary value problem with no analytical solution, given by where ```math -f(y_1, y_2)=-y_1y_2+y_1 +f(y_1, y_2) = -y_1 y_2 + y_1 ``` with boundary condition ```math -y_1(0)=-1/3, y_1(1)=1/3 +y_1(0)=-1/3, \;\; y_1(1)=1/3 ``` # Solution @@ -453,7 +453,7 @@ f(y_1, y_2)=-y_1y_2+y_1 with boundary condition ```math -y_1(0)=1, y_1(1)=-1/3 +y_1(0)=1, \;\; y_1(1)=-1/3 ``` # Solution @@ -561,7 +561,7 @@ f(y_1, y_2)=-y_1y_2+y_1 with boundary condition ```math -y_1(0)=1, y_1(1)=3/2 +y_1(0)=1, \;\; y_1(1)=3/2 ``` # Solution @@ -615,7 +615,7 @@ f(y_1, y_2)=-y_1y_2+y_1 with boundary condition ```math -y_1(0)=0, y_1(1)=3/2 +y_1(0)=0, \;\; y_1(1)=3/2 ``` # Solution @@ -663,13 +663,13 @@ Nonlinear boundary value problem with no analytical solution, given by where ```math -f(y_1, y_2)=-y_1y_2+y_1 +f(y_1, y_2) = -y_1y_2+y_1 ``` with boundary condition ```math -y_1(0)=-7/6, y_1(1)=3/2 +y_1(0)=-7/6, \;\; y_1(1)=3/2 ``` # Solution @@ -725,13 +725,14 @@ Nonlinear boundary value problem with no analytical solution, given by where ```math -f(z, \theta, M, Q)=\frac{1}{\lambda}((z-1)\cos\theta-M\sec\theta)+\lambda Q\tan\theta +f(z, \theta, M, Q) = \frac{1}{\lambda} [(z-1)\cos\theta-M\sec\theta] + \lambda Q\tan\theta ``` with boundary condition ```math -y_1(0)=0, y_3(0)=0, y_1(1)=0, y_3(1)=0 +y_1(0)=0, \;\; y_3(0)=0, \;\; +y_1(1)=0, \;\; y_3(1)=0 ``` # Solution @@ -787,7 +788,8 @@ Nonlinear boundary value problem with no analytical solution, given by with boundary condition ```math -y_1(0)=0, y_2(0)=0, y_1(1)=1, y_2(1)=0 +y_1(0)=0, \;\; y_2(0)=0, \;\; +y_1(1)=1, \;\; y_2(1)=0 ``` # Solution diff --git a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl index daf8d66..308ab9f 100644 --- a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl +++ b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl @@ -69,32 +69,34 @@ du0 = [ @doc doc""" The Transistor Amplifier model -M\frac{dy}{dt}=f(t,y),\quad y(0)=y_0,\quad y'(0)=y_0' +```math +M\frac{dy}{dt} = f(t,y), \quad y(0)=y_0,\quad y'(0)=y_0' +``` ```math -M=\left(\begin{array}{cccccccc} --C_{1} & C_{1} & 0 & 0 & 0 & 0 & 0 & 0 \\ -C_{1} & -C_{1} & 0 & 0 & 0 & 0 & 0 & 0 \\ -0 & 0 & -C_{2} & 0 & 0 & 0 & 0 & 0 \\ -0 & 0 & 0 & -C_{3} & C_{3} & 0 & 0 & 0 \\ -0 & 0 & 0 & C_{3} & -C_{3} & 0 & 0 & 0 \\ -0 & 0 & 0 & 0 & 0 & -C_{4} & 0 & 0 \\ -0 & 0 & 0 & 0 & 0 & 0 & -C_{5} & C_{5} \\ -0 & 0 & 0 & 0 & 0 & 0 & C_{5} & -C_{5} -\end{array}\right) +M = \begin{pmatrix} +-C_1 & C_1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + C_1 & -C_1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & -C_2 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & -C_3 & C_3 & 0 & 0 & 0 \\ + 0 & 0 & 0 & C_3 & -C_3 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & -C_4 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & -C_5 & C_5 \\ + 0 & 0 & 0 & 0 & 0 & 0 & C_5 & -C_5 +\end{pmatrix} ``` ```math -f(t, y)=\left(\begin{array}{c} --\frac{U_{e}(t)}{R_{0}}+\frac{y_{1}}{R_{0}} \\ --\frac{U_{b}}{R_{2}}+y_{2}\left(\frac{1}{R_{1}}+\frac{1}{R_{2}}\right)-(\alpha-1) g\left(y_{2}-y_{3}\right) \\ --g\left(y_{2}-y_{3}\right)+\frac{y_{3}}{R_{3}} \\ --\frac{U_{b}}{R_{4}}+\frac{y_{4}}{R_{4}}+\alpha g\left(y_{2}-y_{3}\right) \\ --\frac{U_{b}}{R_{6}}+y_{5}\left(\frac{1}{R_{5}}+\frac{1}{R_{6}}\right)-(\alpha-1) g\left(y_{5}-y_{6}\right) \\ --g\left(y_{5}-y_{6}\right)+\frac{y_{6}}{R_{7}} \\ --\frac{U_{b}}{R_{8}}+\frac{y_{7}}{R_{8}}+\alpha g\left(y_{5}-y_{6}\right) \\ -\frac{y_{8}}{R_{9}} -\end{array}\right) +f(t, y)=\begin{pmatrix} +-\frac{U_e(t)}{R_0} + \frac{y_1}{R_0} \\ +-\frac{U_b}{R_2} + y_2\left(\frac{1}{R_1}+\frac{1}{R_2}\right) - (\alpha-1) g\left(y_2-y_3\right) \\ +-g\left(y_2-y_3\right) + \frac{y_3}{R_3} \\ +-\frac{U_b}{R_4} + \frac{y_4}{R_4} + \alpha g\left(y_2-y_3\right) \\ +-\frac{U_b}{R_6} + y_5\left(\frac{1}{R_5}+\frac{1}{R_6}\right) - (\alpha-1) g\left(y_5-y_6\right) \\ +-g\left(y_5-y_6\right) + \frac{y_6}{R_7} \\ +-\frac{U_b}{R_8} + \frac{y_7}{R_8} + \alpha g\left(y_5-y_6\right) \\ +\frac{y_8}{R_9} +\end{pmatrix} ``` ## Reference diff --git a/lib/ODEProblemLibrary/src/brusselator_prob.jl b/lib/ODEProblemLibrary/src/brusselator_prob.jl index b1f1370..7f9e219 100644 --- a/lib/ODEProblemLibrary/src/brusselator_prob.jl +++ b/lib/ODEProblemLibrary/src/brusselator_prob.jl @@ -60,8 +60,8 @@ xyd_brusselator = range(0, stop = 1, length = 32) ```math \begin{align*} -\frac{\partial u}{\partial t} &= 1 + u^2v - 4.4u + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) + f(x, y, t) \\ -\frac{\partial v}{\partial t} &= 3.4u - u^2v + \alpha(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) +\frac{\partial u}{\partial t} &= 1 + u^2v - 4.4u + \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) + f(x, y, t) \\ +\frac{\partial v}{\partial t} &= 3.4u - u^2v + \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) \end{align*} ``` diff --git a/lib/ODEProblemLibrary/src/ode_linear_prob.jl b/lib/ODEProblemLibrary/src/ode_linear_prob.jl index 042d27d..cc6dd52 100644 --- a/lib/ODEProblemLibrary/src/ode_linear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_linear_prob.jl @@ -11,7 +11,7 @@ Linear ODE with initial condition ``u_0=\\frac{1}{2}``, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` with Float64s. The parameter is ``α`` @@ -29,7 +29,7 @@ Linear ODE with initial condition ``u_0=\\frac{1}{2}``, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` with BigFloats @@ -50,7 +50,7 @@ with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` with Float64s @@ -69,7 +69,7 @@ with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` with Float64s @@ -89,7 +89,7 @@ with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` with BigFloats @@ -112,7 +112,7 @@ with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math -u(t) = u_0e^{αt} +u(t) = u_0 e^{αt} ``` on Float64. Purposefully not in-place as a test. diff --git a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl index c0da30b..52d9a9d 100644 --- a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl @@ -253,7 +253,7 @@ Pleiades Problem (Non-stiff) where ```math -rᵢⱼ = ((xᵢ-xⱼ)^2 + (yᵢ-yⱼ)^2)^{3/2} +rᵢⱼ = \left((xᵢ-xⱼ)^2 + (yᵢ-yⱼ)^2\right)^{3/2} ``` and initial conditions are @@ -270,7 +270,7 @@ x₇(0) &= 2, & y₇(0) &= 4 \end{align*} ``` -and with ``\frac{dxᵢ(0)}{dt}=\frac{dyᵢ(0)}{dt}=0`` except for +and with ``\frac{dxᵢ(0)}{dt} = \frac{dyᵢ(0)}{dt} = 0`` except for ```math \begin{align*} @@ -366,7 +366,18 @@ It is in the form of where ``f`` is defined by -``f(y) = \begin{pmatrix} −1.71y_1 & +0.43y_2 & +8.32y_3 & +0.0007y_4 & \\ 1.71y_1 & −8.75y_2 & & & \\ −10.03y_3 & +0.43y_4 & +0.035y_5 & & \\ 8.32y_2 & +1.71y_3 & −1.12y_4 & & \\ −1.745y_5 & +0.43y_6 & +0.43y_7 & & \\ −280y_6y_8 & +0.69y_4 & +1.71y_5 & −0.43y_6 & +0.69y_7 \\ 280y_6y_8 & −1.81y_7 & & & \\ −280y_6y_8 & +1.81y_7 & & & \end{pmatrix}`` +```math +f(y) = \begin{pmatrix} +−1.71y_1 + 0.43y_2 + 8.32y_3 + 0.0007y_4 \\ + 1.71y_1 − 8.75y_2 \\ +−10.03y_3 + 0.43y_4 + 0.035y_5 \\ + 8.32y_2 + 1.71y_3 − 1.12y_4 \\ +−1.745y_5 + 0.43y_6 + 0.43y_7 \\ +−280y_6y_8 + 0.69y_4 + 1.71y_5 − 0.43y_6 + 0.69y_7 \\ + 280y_6y_8 − 1.81y_7 \\ +−280y_6y_8 + 1.81y_7 +\end{pmatrix} +``` Reference: [demohires.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoHires/demohires.pdf) Notebook: [Hires.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Hires.ipynb) @@ -395,7 +406,13 @@ y \in ℝ^3, \quad 0 ≤ t ≤ 360 where ``f`` is defined by -``f(y) = \begin{pmatrix} s(y_2 - y_1(1-qy_1-y_2)) \\ (y_3 - y_2(1+y_1))/s \\ w(y_1-y_3) \end{pmatrix}`` +```math +f(y) = \begin{pmatrix} +s(y_2 - y_1 (1 - q y_1 - y_2)) \\ +(y_3 - y_2 (1 + y_1)) / s \\ +w (y_1 - y_3) +\end{pmatrix} +``` where ``s=77.27``, ``w=0.161`` and ``q=8.375⋅10^{-6}``. diff --git a/lib/ODEProblemLibrary/src/pollution_prob.jl b/lib/ODEProblemLibrary/src/pollution_prob.jl index ba77fab..e415127 100644 --- a/lib/ODEProblemLibrary/src/pollution_prob.jl +++ b/lib/ODEProblemLibrary/src/pollution_prob.jl @@ -205,7 +205,30 @@ y(0)=y_0, \quad y \in ℝ^{20}, \quad 0 ≤ t ≤ 60 where ``f`` is defined by -``f(y) = \begin{pmatrix} -\sum_{j∈{1,10,14,23,24}} r_j + \sum_{j∈{2,3,9,11,12,22,25}} r_j \\ -r_2 - r_3 - r_9 - r_12 + r_1 + r_{21} \\ -r_{15} + r_1 + r_{17} + r_{19} + r_{22} \\ -r_2 - r_{16} - r_{17} - r_{23} + r_{15} \\ -r_3 + 2r_4 + r_6 + r_7 + r_{13} + r_{20} \\ -r_6 - r_8 - r_{14} - r_{20} + r_3 + 2r_{18} \\ -r_4 - r_5 - r_6 + r_{13} \\ r_4 + r_5 + r_6 + r_7 \\ -r_7 - r_8 \\ -r_{12} + r_7 + r_9 \\ -r_9 - r_{10} + r_8 + r_{11} \\ r_9 \\ -r_{11} + r_{10} \\ -r_{13} + r_{12} \\ r_{14} \\ -r_{18} - r_{19} + r_{16} \\ -r_{20} \\ r_{20} \\ -r{21} - r_{22} - r_{24} + r_{23} + r_{25} \\ -r_{25} + r_{24} \end{pmatrix}`` +```math +f(y) = \begin{pmatrix} +-\sum_{j\in{1,10,14,23,24}} r_j + \sum_{j\in{2,3,9,11,12,22,25}} r_j \\ +-r_2 - r_3 - r_9 - r_12 + r_1 + r_{21} \\ +-r_{15} + r_1 + r_{17} + r_{19} + r_{22} \\ +-r_2 - r_{16} - r_{17} - r_{23} + r_{15} \\ +-r_3 + 2r_4 + r_6 + r_7 + r_{13} + r_{20} \\ +-r_6 - r_8 - r_{14} - r_{20} + r_3 + 2r_{18} \\ +-r_4 - r_5 - r_6 + r_{13} \\ +r_4 + r_5 + r_6 + r_7 \\ +-r_7 - r_8 \\ +-r_{12} + r_7 + r_9 \\ +-r_9 - r_{10} + r_8 + r_{11} \\ +r_9 \\ +-r_{11} + r_{10} \\ +-r_{13} + r_{12} \\ +r_{14} \\ +-r_{18} - r_{19} + r_{16} \\ +-r_{20} \\ +r_{20} \\ +-r_{21} - r_{22} - r_{24} + r_{23} + r_{25} \\ +-r_{25} + r_{24} +\end{pmatrix} +``` with the initial condition of diff --git a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl index 0f235e4..72d8395 100644 --- a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl +++ b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl @@ -23,12 +23,12 @@ linear_analytic(u0, p, t, W) = @.(u0*exp(0.63155t + 0.87W)) @doc doc""" ```math -du_t = αudt + βudW_t +du_t = αu\,dt + βu\,dW_t ``` where ``α=1.01``, ``β=0.87``, and initial condition ``u_0=1/2``, with solution ```math -u(u_0,p,t,W_t)=u_0\exp((α-\frac{β^2}{2})t+βW_t) +u(u_0,p,t,W_t) = u_0 \exp\left(\left(α - \tfrac{1}{2}β^2\right) t + βW_t\right) ``` """ @@ -47,12 +47,12 @@ f_linear_iip(du, u, p, t) = @.(du=1.01 * u) 8 linear SDEs (as a 4x2 matrix): ```math -du_t = αudt + βudW_t +du_t = αu\,dt + βu\,dW_t ``` where ``α=1.01``, ``β=0.87``, and initial condition ``u_0=\frac{1}{2}`` with solution ```math -u(u_0,p,t,W_t)=u_0\exp((α-\frac{β^2}{2})t+βW_t) +u(u_0,p,t,W_t) = u_0 \exp\left(\left(α - \tfrac{1}{2}β^2\right) t + βW_t\right) ``` """ prob_sde_2Dlinear = SDEProblem( @@ -70,13 +70,13 @@ cubic_analytic(u0, p, t, W) = @. ((1 + u0) * exp(W) + u0 - 1) / ((1 + u0) * exp( ff_cubic = SDEFunction(f_cubic, σ_cubic, analytic = cubic_analytic) @doc doc""" ```math -du_t = \frac{1}{4}u(1-u^2)dt + \frac{1}{2}(1-u^2)dW_t +du_t = \frac{1}{4}u(1-u^2) \, dt + \frac{1}{2}(1-u^2) \, dW_t ``` and initial condition ``u_0=\frac{1}{2}``, with solution ```math -u(u0,p,t,W_t)=\frac{(1+u_0)\exp(W_t)+u)0-1}{(1+u_0)\exp(W_t)+1-u_0} +u(u0,p,t,W_t) = \frac{(1+u_0) \exp(W_t) + u_0 - 1}{(1+u_0) \exp(W_t) + 1 - u_0} ``` """ prob_sde_cubic = SDEProblem(ff_cubic, 1 / 2, (0.0, 1.0)) @@ -87,13 +87,13 @@ wave_analytic(u0, p, t, W) = @. atan(0.1 * W + tan(u0)) ff_wave = SDEFunction(f_wave, σ_wave, analytic = wave_analytic) @doc doc""" ```math -du_t = -\frac{1}{100}\sin(u)\cos^3(u)dt + \frac{1}{10}\cos^{2}(u_t) dW_t +du_t = -\frac{1}{100}\sin(u)\cos^3(u)\, dt + \frac{1}{10}\cos^2(u_t)\, dW_t ``` and initial condition ``u_0=1`` with solution ```math -u(u_0,p,t,W_t)=\arctan(\frac{W_t}{10} + \tan(u_0)) +u(u_0,p,t,W_t) = \arctan\left(\frac{W_t}{10} + \tan(u_0)\right) ``` """ prob_sde_wave = SDEProblem(ff_wave, 1.0, (0.0, 1.0)) @@ -107,7 +107,7 @@ ff_additive = SDEFunction(f_additive, σ_additive, analytic = additive_analytic) Additive noise problem ```math -u_t = (\frac{β}{\sqrt{1+t}}-\frac{1}{2(1+t)}u_t)dt + \frac{αβ}{\sqrt{1+t}}dW_t +u_t = \left(\frac{β}{\sqrt{1+t}} - \frac{1}{2(1+t)}u_t\right) \, dt + \frac{αβ}{\sqrt{1+t}} \, dW_t ``` and initial condition ``u_0=1`` with ``α=0.1`` and ``β=0.05``, with solution From c078ab3f2ef59095404384f73234ba492980c632 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sun, 7 Sep 2025 23:34:48 -0400 Subject: [PATCH 05/10] Fix use of scientific notation in TeX --- lib/DAEProblemLibrary/src/DAEProblemLibrary.jl | 2 +- lib/DDEProblemLibrary/src/radar5.jl | 18 +++++++++--------- .../src/ode_simple_nonlinear_prob.jl | 4 ++-- .../src/strange_attractors.jl | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl index 308ab9f..3063001 100644 --- a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl +++ b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl @@ -28,7 +28,7 @@ The Robertson biochemical reactions in DAE form ``` where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 -Usually solved on ``[0,1e11]`` +Usually solved on ``[0,10^{11}]`` """ prob_dae_resrob = DAEProblem(f, du0, u0, (0.0, 100000.0)) diff --git a/lib/DDEProblemLibrary/src/radar5.jl b/lib/DDEProblemLibrary/src/radar5.jl index b12a33c..4909b5f 100644 --- a/lib/DDEProblemLibrary/src/radar5.jl +++ b/lib/DDEProblemLibrary/src/radar5.jl @@ -26,7 +26,7 @@ for ``t \in [0, 100.5]`` with history function \end{align*} ``` -for ``t \leq 0``, where ``k_1 = 1.34``, ``k_2 = 1.6e9``, ``k_3 = 8000``, ``k_4 = 4e7``, +for ``t \leq 0``, where ``k_1 = 1.34``, ``k_2 = 1.6×10^9``, ``k_3 = 8000``, ``k_4 = 4×10^7``, ``k_5 = 1``, ``f = 1``, ``A = 0.06``, ``B = 0.06``, and ``\tau = 0.15``. # References @@ -82,9 +82,9 @@ by \end{align*} ``` -for ``t \in [0, 10e10]`` with history function ``\phi_1(0) = 1``, ``\phi_2(t) = 0`` for +for ``t \in [0, 10^{10}]`` with history function ``\phi_1(0) = 1``, ``\phi_2(t) = 0`` for ``t \in [-\tau, 0]``, and ``\phi_3(0) = 0``, where ``a = 0.04``, ``b = 10_000``, -``c = 3e7``, and ``\tau = 0.01``. +``c = 3×10^7``, and ``\tau = 0.01``. # References @@ -153,8 +153,8 @@ for ``t \in [0, 300]`` with history function \end{align*} ``` -for ``t \leq 0``, where ``\alpha = 1.8``, ``\beta = 20``, ``\gamma = 0.002``, ``r = 5e4``, -``s = 1e5``, ``t_0 = 32``, ``t_1 = 119``, and ``\phi_0 = 0.75e-4``. +for ``t \leq 0``, where ``\alpha = 1.8``, ``\beta = 20``, ``\gamma = 0.002``, ``r = 5\times10^4``, +``s = 10^5``, ``t_0 = 32``, ``t_1 = 119``, and ``\phi_0 = 0.75×10^{-4}``. # References @@ -218,7 +218,7 @@ const prob_dde_RADAR5_waltman_1 = prob_dde_RADAR5_waltman prob_dde_RADAR5_waltman_2 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 32``, -``t_1 = 111``, and ``\phi_0 = 0.5e-4``. +``t_1 = 111``, and ``\phi_0 = 0.5×10^{-4}``. # References @@ -232,7 +232,7 @@ const prob_dde_RADAR5_waltman_2 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_3 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 33``, -``t_1 = 145``, and ``\phi_0 = 1e-5``. +``t_1 = 145``, and ``\phi_0 = 10^{-5}``. # References @@ -246,7 +246,7 @@ const prob_dde_RADAR5_waltman_3 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_4 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 34``, -``t_1 = 163``, and ``\phi_0 = 0.75e-5``. +``t_1 = 163``, and ``\phi_0 = 0.75×10^{-5}``. # References @@ -260,7 +260,7 @@ const prob_dde_RADAR5_waltman_4 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_5 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 35``, -``t_1 = 197``, and ``\phi_0 = 0.5e-5``. +``t_1 = 197``, and ``\phi_0 = 0.5×10^{-5}``. # References diff --git a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl index 52d9a9d..4882718 100644 --- a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl @@ -130,7 +130,7 @@ where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 -Usually solved on ``[0,1e11]`` +Usually solved on ``[0,10^{11}]`` """ prob_ode_rober = ODEProblem(rober, [1.0, 0.0, 0.0], (0.0, 1e11), [0.04, 3e7, 1e4]) @@ -414,7 +414,7 @@ w (y_1 - y_3) \end{pmatrix} ``` -where ``s=77.27``, ``w=0.161`` and ``q=8.375⋅10^{-6}``. +where ``s=77.27``, ``w=0.161`` and ``q=8.375×10^{-6}``. Reference: [demoorego.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoOrego/demoorego.pdf) Notebook: [Orego.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Orego.ipynb) diff --git a/lib/ODEProblemLibrary/src/strange_attractors.jl b/lib/ODEProblemLibrary/src/strange_attractors.jl index 62aa10e..ddc0037 100644 --- a/lib/ODEProblemLibrary/src/strange_attractors.jl +++ b/lib/ODEProblemLibrary/src/strange_attractors.jl @@ -252,7 +252,7 @@ Hindmarsh-Rose equations \end{align*} ``` -with parameters ``a=1, b=3, c=1, d=5, r=1e-2, s=4, x_r=-8/5, i=5`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` +with parameters ``a=1, b=3, c=1, d=5, r=10^{-2}, s=4, x_r=-8/5, i=5`` and initial conditions ``x(0)=1, y(0)=0, z(0)=0`` [Reference](https://en.wikipedia.org/wiki/Hindmarsh%E2%80%93Rose_model) """ From ff826a3e5e01c221eb3d29bcecfd7753a6677b72 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Mon, 8 Sep 2025 00:17:43 -0400 Subject: [PATCH 06/10] Use Unicode characters in docstring formulae for Greek The KaTeX renderer used by Documenter.jl recognizes them and some of the source files already contain them --- lib/BVProblemLibrary/src/BVProblemLibrary.jl | 16 +-- lib/BVProblemLibrary/src/linear.jl | 104 +++++++++--------- lib/BVProblemLibrary/src/nonlinear.jl | 56 +++++----- .../src/DAEProblemLibrary.jl | 10 +- lib/DDEProblemLibrary/src/constant_delays.jl | 12 +- lib/DDEProblemLibrary/src/ddetst.jl | 102 ++++++++--------- lib/DDEProblemLibrary/src/radar5.jl | 54 ++++----- lib/ODEProblemLibrary/src/brusselator_prob.jl | 14 +-- lib/ODEProblemLibrary/src/ode_linear_prob.jl | 8 +- .../src/ode_simple_nonlinear_prob.jl | 2 +- .../src/SDEProblemLibrary.jl | 2 +- 11 files changed, 190 insertions(+), 190 deletions(-) diff --git a/lib/BVProblemLibrary/src/BVProblemLibrary.jl b/lib/BVProblemLibrary/src/BVProblemLibrary.jl index 1e5654b..2b98b36 100644 --- a/lib/BVProblemLibrary/src/BVProblemLibrary.jl +++ b/lib/BVProblemLibrary/src/BVProblemLibrary.jl @@ -224,11 +224,11 @@ Given by \begin{align*} \frac{dz_1}{dt} &= z_3 \frac{V_c}{h} \\ \frac{dz_2}{dt} &= z_4 \frac{V_c}{h} \\ -\frac{dz_3}{dt} &= \frac{f}{V_c} \left(-\frac{z_6}{z_6^2+z_7^2} - V_c\eta\exp(-z_2\beta)z_3\sqrt{z_3^3+z_4^2}\right)/m \\ -\frac{dz_4}{dt} &= \frac{f}{V_c} \left(-\frac{z_7}{z_6^2+z_7^2} - V_c\eta\exp(-z_2\beta)z_4\sqrt{z_3^3+z_4^2}\right)/m - g_{accel}/V_c \\ -\frac{dz_5}{dt} &= -\eta\beta \exp(-z_2\beta) (z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} \\ -\frac{dz_6}{dt} &= \eta \exp(-z_2\beta) \left(z_6(2z_3^2+z_4^2)+z_7z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ -\frac{dz_7}{dt} &= \eta \exp(-z_2\beta) \left(z_7(z_3^2+2z_4^2)+z_6z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ +\frac{dz_3}{dt} &= \frac{f}{V_c} \left(-\frac{z_6}{z_6^2+z_7^2} - V_c η\exp(-z_2 β) z_3\sqrt{z_3^3+z_4^2}\right)/m \\ +\frac{dz_4}{dt} &= \frac{f}{V_c} \left(-\frac{z_7}{z_6^2+z_7^2} - V_c η\exp(-z_2 β) z_4\sqrt{z_3^3+z_4^2}\right)/m - g_{accel}/V_c \\ +\frac{dz_5}{dt} &= -ηβ \exp(-z_2 β) (z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} \\ +\frac{dz_6}{dt} &= η \exp(-z_2 β) \left(z_6(2z_3^2+z_4^2)+z_7z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ +\frac{dz_7}{dt} &= η \exp(-z_2 β) \left(z_7(z_3^2+2z_4^2)+z_6z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\ \end{align*} ``` @@ -287,9 +287,9 @@ Given by ```math \begin{align*} -\frac{dy_1}{dt} &= \mu - \beta(t) y_1 y_3 \\ -\frac{dy_2}{dt} &= \beta(t)y_1y_3 - \frac{y_2}{\lambda} \\ -\frac{dy_3}{dt} &= \frac{y_2}{\lambda} - \frac{y_3}{\eta} +\frac{dy_1}{dt} &= μ - β(t) y_1 y_3 \\ +\frac{dy_2}{dt} &= β(t) y_1 y_3 - \frac{y_2}{λ} \\ +\frac{dy_3}{dt} &= \frac{y_2}{λ} - \frac{y_3}{η} \end{align*} ``` diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index 9e582fb..36820c8 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -29,7 +29,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\[2pt] -\frac{dy_2}{dt} &= \frac{1}{\lambda} y_1 +\frac{dy_2}{dt} &= \frac{1}{λ} y_1 \end{align*} ``` @@ -45,7 +45,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \frac{\exp(-t/\sqrt{\lambda}) - \exp((t-2)/\sqrt{\lambda})}{1-\exp(-2/\sqrt{\lambda})} \\ +y_1(t) &= \frac{\exp(-t/\sqrt{λ}) - \exp((t-2)/\sqrt{λ})}{1-\exp(-2/\sqrt{λ})} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -87,7 +87,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}y_2 +\frac{dy_2}{dt} &= \frac{1}{λ} y_2 \end{align*} ``` @@ -103,7 +103,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \frac{1-\exp((t-1)/\lambda)}{1-\exp(-1/\lambda)} \\ +y_1(t) &= \frac{1-\exp((t-1)/λ)}{1-\exp(-1/λ)} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -148,14 +148,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1, y_2) \end{align*} ``` where ```math -f(t, y_1, y_2) = -[2+\cos(\pi t)]y_2 + y_1 -(1+\lambda \pi^2)\cos(\pi t) - [2+\cos(\pi t)]\pi\sin(\pi t) +f(t, y_1, y_2) = -[2+\cos(πt)]y_2 + y_1 -(1+λπ^2)\cos(πt) - [2+\cos(πt)]π\sin(πt) ``` with boundary condition @@ -170,7 +170,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) \\ +y_1(t) &= \cos(πt) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -212,14 +212,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` where ```math -f(y_1, y_2) = -y_2 + (1+\lambda) y_1 +f(y_1, y_2) = -y_2 + (1+λ) y_1 ``` with boundary condition @@ -227,7 +227,7 @@ with boundary condition ```math \begin{align*} y_1(-1) &= 1 + \exp(-2), \\ -y_1(1) &= 1 + \exp(-2(1+\lambda)) +y_1(1) &= 1 + \exp(-2(1+λ)) \end{align*} ``` @@ -237,7 +237,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \exp(t-1) + \exp(-(1+\lambda)(1+t)/\lambda) \\ +y_1(t) &= \exp(t-1) + \exp(-(1+λ)(1+t)/λ) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -281,14 +281,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1, y_2) \end{align*} ``` where ```math -f(t, y_1, y_2) = ty_2 + y_1 - (1+\lambda\pi^2)\cos(\pi t) + \pi t\sin(\pi t) +f(t, y_1, y_2) = ty_2 + y_1 - (1+λπ^2)\cos(πt) + πt\sin(πt) ``` with boundary condition @@ -303,7 +303,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) \\ +y_1(t) &= \cos(πt) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -346,14 +346,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_2) \end{align*} ``` where ```math -f(t, y_2) = ty_2 - \lambda\pi^2\cos(\pi t)-\pi t\sin(\pi t) +f(t, y_2) = ty_2 - λπ^2\cos(πt)-πt\sin(πt) ``` with boundary condition @@ -368,7 +368,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + \operatorname{erf}(t/\sqrt{2\lambda})/\operatorname{erf}(1/\sqrt{2\lambda}) \\ +y_1(t) &= \cos(πt) + \operatorname{erf}(t/\sqrt{2λ})/\operatorname{erf}(1/\sqrt{2λ}) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -418,14 +418,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1, y_2) \end{align*} ``` where ```math -f(t, y_1, y_2) = t y_2 + y_1 - (1+\lambda\pi^2)\cos(\pi t) + \pi t\sin(\pi t) +f(t, y_1, y_2) = t y_2 + y_1 - (1+λπ^2)\cos(πt) + π t\sin(πt) ``` with boundary condition @@ -440,7 +440,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + t + \frac{t\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{\operatorname{erf}(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-1/2\lambda)} \\ +y_1(t) &= \cos(πt) + t + \frac{t\operatorname{erf}(t/\sqrt{2λ}) + \sqrt{2λ/π}\exp(-t^2/2λ)}{\operatorname{erf}(t/\sqrt{2λ}) + \sqrt{2λ/π}\exp(-1/2λ)} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -482,7 +482,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda} y_2 +\frac{dy_2}{dt} &= -\frac{1}{λ} y_2 \end{align*} ``` @@ -498,7 +498,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \frac{2 - \exp(-1/\lambda) - \exp(-t/\lambda)}{1 - \exp(-1/\lambda)} \\ +y_1(t) &= \frac{2 - \exp(-1/λ) - \exp(-t/λ)}{1 - \exp(-1/λ)} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -540,7 +540,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda+t^2} f(t, y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ+t^2} f(t, y_1, y_2) \end{align*} ``` @@ -553,7 +553,7 @@ f(t, y_1, y_2)=-4ty_2 - 2y_1 with boundary condition ```math -y_1(-1)=1/(1+\lambda), y_1(1)=1/(1+\lambda) +y_1(-1)=1/(1+λ), y_1(1)=1/(1+λ) ``` # Solution @@ -562,7 +562,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \frac{1}{\lambda + t^2} \\ +y_1(t) &= \frac{1}{λ + t^2} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -605,7 +605,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= - \frac{1}{\lambda} t y_2 +\frac{dy_2}{dt} &= - \frac{1}{λ} t y_2 \end{align*} ``` @@ -621,7 +621,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= 1 + \operatorname{erf}(t/\sqrt{2\lambda})/\operatorname{erf}(1/\sqrt{2\lambda}) \\ +y_1(t) &= 1 + \operatorname{erf}(t/\sqrt{2λ})/\operatorname{erf}(1/\sqrt{2λ}) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -663,14 +663,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1) +\frac{dy_2}{dt} &= \frac{1}{λ}f(t, y_1) \end{align*} ``` where ```math -f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+λπ^2)\cos(πt) ``` with boundary condition @@ -685,7 +685,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) \\ +y_1(t) &= \cos(πt) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -729,14 +729,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(t, y_1) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1) \end{align*} ``` where ```math -f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+λπ^2)\cos(πt) ``` with boundary condition @@ -751,7 +751,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + \frac{\exp((t+1)/\sqrt{\lambda}) - \exp(-(t+1))/\sqrt{\lambda}}{\exp(2/\sqrt{\lambda})-\exp(-2/\sqrt{\lambda})} \\ +y_1(t) &= \cos(πt) + \frac{\exp((t+1)/\sqrt{λ}) - \exp(-(t+1))/\sqrt{λ}}{\exp(2/\sqrt{λ}) - \exp(-2/\sqrt{λ})} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -794,14 +794,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1) \end{align*} ``` where ```math -f(t, y_1) = y_1 - (1+\lambda\pi^2)\cos(\pi t) +f(t, y_1) = y_1 - (1+λπ^2)\cos(πt) ``` with boundary condition @@ -816,7 +816,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + \exp(-(t+1)/\sqrt{\lambda}) +y_1(t) &= \cos(πt) + \exp(-(t+1)/\sqrt{λ}) y_2(t) &= y_1'(t) \end{align*} ``` @@ -859,21 +859,21 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 -\frac{dy_2}{dt} &= \frac{1}{\lambda} f(t, y_1) +\frac{dy_2}{dt} &= \frac{1}{λ} f(t, y_1) \end{align*} ``` where ```math -f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t) +f(t, y_1)=y_1-(1+λπ^2)\cos(πt) ``` with boundary condition ```math -y_1(-1) = \exp(-2/\sqrt{\lambda}), \;\; -y_1(1) = \exp(-2/\sqrt{\lambda}) +y_1(-1) = \exp(-2/\sqrt{λ}), \;\; +y_1(1) = \exp(-2/\sqrt{λ}) ``` # Solution @@ -882,7 +882,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(\pi t) + \exp((t-1)/\sqrt{\lambda}) + \exp(-(t+1)/\sqrt{\lambda}) \\ +y_1(t) &= \cos(πt) + \exp((t-1)/\sqrt{λ}) + \exp(-(t+1)/\sqrt{λ}) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -921,7 +921,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda} t y_1 +\frac{dy_2}{dt} &= \frac{1}{λ} t y_1 \end{align*} ``` @@ -972,7 +972,7 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda^2}f(y_1) +\frac{dy_2}{dt} &= \frac{1}{λ^2} f(y_1) \end{align*} ``` @@ -985,7 +985,7 @@ f(t, y_1) = -π^2 y_1/4 with boundary condition ```math -y_1(0)=0, \;\; y_1(1)=\sin(\pi/(2\lambda)) +y_1(0)=0, \;\; y_1(1)=\sin(π/(2λ)) ``` # Solution @@ -994,7 +994,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \sin(\pi t/2\lambda) \text{ when } 1/\lambda \text{ is odd } \\ +y_1(t) &= \sin(πt/2λ) \text{ when } 1/λ \text{ is odd } \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -1042,14 +1042,14 @@ Linear boundary value problem with analytical solution, given by where ```math -f(t, y_1) = -3\lambda y_1 / (\lambda+t^2)^2 +f(t, y_1) = -3λ y_1 / (λ+t^2)^2 ``` with boundary condition ```math -y_1(-0.1) = \frac{-0.1}{\sqrt{\lambda+0.01}}, -y_1(0.1) = \frac{ 0.1}{\sqrt{\lambda+0.01}} +y_1(-0.1) = \frac{-0.1}{\sqrt{λ+0.01}}, +y_1(0.1) = \frac{ 0.1}{\sqrt{λ+0.01}} ``` # Solution @@ -1058,7 +1058,7 @@ The analytical solution for ``t \in [-0.1, 0.1]`` is ```math \begin{align*} -y_1(t) &= t/\sqrt{\lambda+t^2} \\ +y_1(t) &= t/\sqrt{λ+t^2} \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -1100,14 +1100,14 @@ Linear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda}y_2 +\frac{dy_2}{dt} &= -\frac{1}{λ} y_2 \end{align*} ``` with boundary condition ```math -y_1(0)=1, \;\; y_1(1)=\frac{0.1}{\sqrt{\lambda+0.01}} +y_1(0)=1, \;\; y_1(1)=\frac{0.1}{\sqrt{λ+0.01}} ``` # Solution @@ -1116,7 +1116,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \exp(-t/\lambda) \\ +y_1(t) &= \exp(-t/λ) \\ y_2(t) &= y_1'(t) \end{align*} ``` diff --git a/lib/BVProblemLibrary/src/nonlinear.jl b/lib/BVProblemLibrary/src/nonlinear.jl index b1c8b4c..b96d95a 100644 --- a/lib/BVProblemLibrary/src/nonlinear.jl +++ b/lib/BVProblemLibrary/src/nonlinear.jl @@ -25,7 +25,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda}y_2 +\frac{dy_2}{dt} &= -\frac{1}{λ} y_2 \end{align*} ``` @@ -38,7 +38,7 @@ f(y_2)=-y_1 with boundary condition ```math -y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01} +y_1(0)=1, y_1(1)=0.1/\sqrt{λ+0.01} ``` # Solution @@ -47,7 +47,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \exp(-t/\lambda) \\ +y_1(t) &= \exp(-t/λ) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -89,7 +89,7 @@ Nonlinear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda} f(y_2) +\frac{dy_2}{dt} &= -\frac{1}{λ} f(y_2) \end{align*} ``` @@ -103,8 +103,8 @@ with boundary condition ```math \begin{align*} -y_1(0) &= 1 + \lambda\ln\cosh(-0.745/\lambda), \\ -y_1(1) &= 1 + \lambda\ln\cosh(0.255/\lambda) +y_1(0) &= 1 + λ \ln\cosh(-0.745/λ), \\ +y_1(1) &= 1 + λ \ln\cosh(0.255/λ) \end{align*} ``` @@ -114,7 +114,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= 1 + \lambda\ln\cosh((t-0.745)/\lambda) \\ +y_1(t) &= 1 + λ \ln\cosh((t-0.745)/λ) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -157,20 +157,20 @@ Nonlinear boundary value problem with analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y, y_1) +\frac{dy_2}{dt} &= -\frac{1}{λ} f(y, y_1) \end{align*} ``` where ```math -f(y_1) = y_1 + y_1^2 - \exp(-2t/\sqrt{\lambda}) +f(y_1) = y_1 + y_1^2 - \exp(-2t/\sqrt{λ}) ``` with boundary condition ```math -y_1(0)=1, y_1(1)=\exp(-1/\sqrt{\lambda}) +y_1(0)=1, y_1(1)=\exp(-1/\sqrt{λ}) ``` # Solution @@ -179,7 +179,7 @@ The analytical solution for ``t \in [0, 1]`` is ```math \begin{align*} -y_1(t) &= \exp(-t/\sqrt{\lambda}) \\ +y_1(t) &= \exp(-t/\sqrt{λ}) \\ y_2(t) &= y_1'(t) \end{align*} ``` @@ -218,7 +218,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= -\frac{1}{λ} f(y_1, y_2) \end{align*} ``` @@ -272,14 +272,14 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda} f(y_1) +\frac{dy_2}{dt} &= -\frac{1}{λ} f(y_1) \end{align*} ``` where ```math -f(y_1) = \lambda\sinh(\lambda z) +f(y_1) = λ\sinh(λz) ``` with boundary condition @@ -332,14 +332,14 @@ The steady state Navier-Stokes equations generate a second order differential eq ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= -\frac{1}{\lambda}f(y_1) +\frac{dy_2}{dt} &= -\frac{1}{λ} f(y_1) \end{align*} ``` where ```math -f(t, y_1, y_2) = \left(\frac{1+\gamma}{2}-\lambda A'(t)\right) y_1y_2 - \frac{y_2}{y_1} - \frac{A'(t)}{A(t)} \left(1 - \frac{\gamma-1}{2} y_1^2\right) +f(t, y_1, y_2) = \left(\frac{1+γ}{2} - λ A'(t)\right) y_1 y_2 - \frac{y_2}{y_1} - \frac{A'(t)}{A(t)} \left(1 - \frac{γ-1}{2} y_1^2\right) ``` with boundary condition @@ -386,7 +386,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` @@ -440,7 +440,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` @@ -494,7 +494,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) \\ +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \\ \end{align*} ``` @@ -548,7 +548,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` @@ -602,7 +602,7 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` @@ -656,14 +656,14 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2 \\ -\frac{dy_2}{dt} &= \frac{1}{\lambda}f(y_1, y_2) +\frac{dy_2}{dt} &= \frac{1}{λ} f(y_1, y_2) \end{align*} ``` where ```math -f(y_1, y_2) = -y_1y_2+y_1 +f(y_1, y_2) = -y_1 y_2 + y_1 ``` with boundary condition @@ -717,7 +717,7 @@ Nonlinear boundary value problem with no analytical solution, given by \begin{align*} \frac{dy_1}{dt} &= \sin(y_2) \\ \frac{dy_2}{dt} &= y_3 \\ -\frac{dy_3}{dt} &= -y_4/\lambda \\ +\frac{dy_3}{dt} &= -y_4/λ \\ \frac{dy_4}{dt} &= f(y_1, y_2, y_3, y_4) \end{align*} ``` @@ -725,7 +725,7 @@ Nonlinear boundary value problem with no analytical solution, given by where ```math -f(z, \theta, M, Q) = \frac{1}{\lambda} [(z-1)\cos\theta-M\sec\theta] + \lambda Q\tan\theta +f(z, θ, M, Q) = \frac{1}{λ} [(z-1) \cos θ - M \sec θ] + λ Q \tan θ ``` with boundary condition @@ -781,7 +781,7 @@ Nonlinear boundary value problem with no analytical solution, given by \frac{dy_1}{dt} &= y_2 \\ \frac{dy_2}{dt} &= y_3 \\ \frac{dy_3}{dt} &= y_4 \\ -\frac{dy_4}{dt} &= \lambda(y_2 y_3 - y_1 y_4) +\frac{dy_4}{dt} &= λ(y_2 y_3 - y_1 y_4) \end{align*} ``` @@ -839,11 +839,11 @@ Nonlinear boundary value problem with no analytical solution, given by ```math \begin{align*} \frac{dy_1}{dt} &= y_2, & -\frac{dy_2}{dt} &= \frac{1}{\lambda}y_1y_4 - y_3y_2, \\ +\frac{dy_2}{dt} &= \frac{1}{λ}y_1y_4 - y_3y_2, \\ \frac{dy_3}{dt} &= y_4, & \frac{dy_4}{dt} &= y_5, \\ \frac{dy_5}{dt} &= y_6, & -\frac{dy_6}{dt} &= \frac{1}{\lambda}(-y_3y_6-y_1y_2) +\frac{dy_6}{dt} &= \frac{1}{λ}(-y_3y_6-y_1y_2) \end{align*} ``` diff --git a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl index 3063001..2393dcf 100644 --- a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl +++ b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl @@ -26,7 +26,7 @@ The Robertson biochemical reactions in DAE form 1 &= y₁ + y₂ + y₃ \end{align*} ``` -where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: +where ``k₁=0.04``, ``k₂=3×10^7``, ``k₃=10^4``. For details, see: Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 Usually solved on ``[0,10^{11}]`` """ @@ -89,12 +89,12 @@ M = \begin{pmatrix} ```math f(t, y)=\begin{pmatrix} -\frac{U_e(t)}{R_0} + \frac{y_1}{R_0} \\ --\frac{U_b}{R_2} + y_2\left(\frac{1}{R_1}+\frac{1}{R_2}\right) - (\alpha-1) g\left(y_2-y_3\right) \\ +-\frac{U_b}{R_2} + y_2\left(\frac{1}{R_1}+\frac{1}{R_2}\right) - (α-1) g\left(y_2-y_3\right) \\ -g\left(y_2-y_3\right) + \frac{y_3}{R_3} \\ --\frac{U_b}{R_4} + \frac{y_4}{R_4} + \alpha g\left(y_2-y_3\right) \\ --\frac{U_b}{R_6} + y_5\left(\frac{1}{R_5}+\frac{1}{R_6}\right) - (\alpha-1) g\left(y_5-y_6\right) \\ +-\frac{U_b}{R_4} + \frac{y_4}{R_4} + α g\left(y_2-y_3\right) \\ +-\frac{U_b}{R_6} + y_5\left(\frac{1}{R_5}+\frac{1}{R_6}\right) - (α-1) g\left(y_5-y_6\right) \\ -g\left(y_5-y_6\right) + \frac{y_6}{R_7} \\ --\frac{U_b}{R_8} + \frac{y_7}{R_8} + \alpha g\left(y_5-y_6\right) \\ +-\frac{U_b}{R_8} + \frac{y_7}{R_8} + α g\left(y_5-y_6\right) \\ \frac{y_8}{R_9} \end{pmatrix} ``` diff --git a/lib/DDEProblemLibrary/src/constant_delays.jl b/lib/DDEProblemLibrary/src/constant_delays.jl index a87d671..9d1c150 100644 --- a/lib/DDEProblemLibrary/src/constant_delays.jl +++ b/lib/DDEProblemLibrary/src/constant_delays.jl @@ -55,7 +55,7 @@ Delay differential equation u'(t) = -u(t - 1) ``` -for ``t \in [0, 1]`` with history function ``\phi(t) = 0`` if ``t < 0`` and ``\phi(0) = 1``. +for ``t \in [0, 1]`` with history function ``ϕ(t) = 0`` if ``t < 0`` and ``ϕ(0) = 1``. # Solution @@ -174,8 +174,8 @@ Delay differential equation u'(t) = u(t) - u(t - 1/5) ``` -for ``t \in [0, 100]`` with history function ``\phi(t) = 0`` if ``t < 0`` and -``\phi(0) = 1``. +for ``t \in [0, 100]`` with history function ``ϕ(t) = 0`` if ``t < 0`` and +``ϕ(0) = 1``. """ prob_dde_constant_1delay_long_ip @@ -247,7 +247,7 @@ Delay differential equation u'(t) = -u(t - 1/3) - u(t - 1/5) ``` -for ``t \in [0, 1]`` with history function ``\phi(t) = 0`` if ``t < 0`` and ``\phi(0) = 1``. +for ``t \in [0, 1]`` with history function ``ϕ(t) = 0`` if ``t < 0`` and ``ϕ(0) = 1``. # Solution @@ -364,8 +364,8 @@ Delay differential equation u'(t) = - u(t - 1/3) - u(t - 1/5) ``` -for ``t \in [0, 100]`` with history function ``\phi(t) = 0`` if ``t < 0`` and -``\phi(0) = 1``. +for ``t \in [0, 100]`` with history function ``ϕ(t) = 0`` if ``t < 0`` and +``ϕ(0) = 1``. """ prob_dde_constant_2delays_long_ip diff --git a/lib/DDEProblemLibrary/src/ddetst.jl b/lib/DDEProblemLibrary/src/ddetst.jl index 835ae06..d2e9a34 100644 --- a/lib/DDEProblemLibrary/src/ddetst.jl +++ b/lib/DDEProblemLibrary/src/ddetst.jl @@ -14,7 +14,7 @@ Delay differential equation model of blood production, given by u'(t) = \frac{0.2 u(t - 14)}{1 + u(t - 14)^{10}} - 0.1 u(t) ``` -for ``t \in [0, 500]`` and history function ``\phi(t) = 0.5`` for ``t \leq 0``. +for ``t \in [0, 500]`` and history function ``ϕ(t) = 0.5`` for ``t ≤ 0``. # References @@ -55,12 +55,12 @@ for ``t \in [0, 100]`` and history function ```math \begin{align*} -\phi_1(t) &= 1.05767027/3, \\ -\phi_2(t) &= 1.030713491/3, +ϕ_1(t) &= 1.05767027/3, \\ +ϕ_2(t) &= 1.030713491/3, \end{align*} ``` -for ``t \leq 0``. +for ``t ≤ 0``. # References @@ -105,7 +105,7 @@ Delay differential equation u'(t) = 1 - u(\exp(1 - 1/t)) ``` -for ``t \in [0.1, 10]`` with history function ``\phi(t) = \log t`` for ``t \in (0, 0.1]``. +for ``t \in [0.1, 10]`` with history function ``ϕ(t) = \log t`` for ``t \in (0, 0.1]``. # Solution @@ -155,7 +155,7 @@ Delay differential equation u'(t) = - 1 - u(t) + 2 [u(t / 2) < 0] ``` -for ``t \in [0, 2 \log 66]`` with history function ``\phi(0) = 1``. +for ``t \in [0, 2 \log 66]`` with history function ``ϕ(0) = 1``. # Solution @@ -220,7 +220,7 @@ Delay differential equation u'(t) = - 2 u(t - 1 - |u(t)|) (1 - u(t)^2) ``` -for ``t \in [0, 30]`` with history function ``\phi(t) = 0.5`` for ``t \leq 0``. +for ``t \in [0, 30]`` with history function ``ϕ(t) = 0.5`` for ``t ≤ 0``. # References @@ -257,12 +257,12 @@ for ``t \in [0, 40]`` with history function ```math \begin{align*} -\phi_1(t) &= 1, \\ -\phi_2(t) &= 0.5, +ϕ_1(t) &= 1, \\ +ϕ_2(t) &= 0.5, \end{align*} ``` -for ``t \leq 0``. +for ``t ≤ 0``. # References @@ -306,22 +306,22 @@ Delay differential equation model of hematopoiesis, given by ```math \begin{align*} -u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, \\ +u_1'(t) &= \hat{s}_0 u_2(t - T_1) - γ u_1(t) - Q, \\ u_2'(t) &= f(u_1(t)) - k u_2(t), \\ -u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +u_3'(t) &= 1 - \frac{Q \exp(γ u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, \end{align*} ``` -for ``t \in [0, 300]`` with history function ``\phi_1(0) = 3.325``, ``\phi_3(0) = 120``, and +for ``t \in [0, 300]`` with history function ``ϕ_1(0) = 3.325``, ``ϕ_3(0) = 120``, and ```math -\phi_2(t) = \begin{cases} - 10 & \text{if } t \in [- T_1, 0],\\ +ϕ_2(t) = \begin{cases} + 10 & \text{if } t \in [- T_1, 0],\\ 9.5 & \text{if } t < - T_1, \end{cases} ``` -where ``f(y) = a / (1 + K y^r)``, ``\hat{s}_0 = 0.0031``, ``T_1 = 6``, ``\gamma = 0.001``, +where ``f(y) = a / (1 + K y^r)``, ``\hat{s}_0 = 0.0031``, ``T_1 = 6``, ``γ = 0.001``, ``Q = 0.0275``, ``k = 2.8``, ``a = 6570``, ``K = 0.0382``, and ``r = 6.96``. # References @@ -369,15 +369,15 @@ equation as [`prob_dde_DDETST_C3`](@ref) ```math \begin{align*} -u_1'(t) &= \hat{s}_0 u_2(t - T_1) - \gamma u_1(t) - Q, \\ +u_1'(t) &= \hat{s}_0 u_2(t - T_1) - γ u_1(t) - Q, \\ u_2'(t) &= f(u_1(t)) - k u_2(t), \\ -u_3'(t) &= 1 - \frac{Q \exp(\gamma u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, +u_3'(t) &= 1 - \frac{Q \exp(γ u_3(t))}{\hat{s}_0 u_2(t - T_1 - u_3(t))}, \end{align*} ``` for ``t \in [0, 100]`` with history function -``\phi_1(0) = 3.5``, ``\phi_3(0) = 50``, and ``\phi_2(t) = 10`` for ``t \leq 0``, where -``f(y) = a / (1 + K y^r)``, ``\hat{s}_0 = 0.00372``, ``T_1 = 3``, ``\gamma = 0.1``, +``ϕ_1(0) = 3.5``, ``ϕ_3(0) = 50``, and ``ϕ_2(t) = 10`` for ``t ≤ 0``, where +``f(y) = a / (1 + K y^r)``, ``\hat{s}_0 = 0.00372``, ``T_1 = 3``, ``γ = 0.1``, ``Q = 0.00178``, ``k = 6.65``, ``a = 15600``, ``K = 0.0382``, and ``r = 6.96``. # References @@ -433,8 +433,8 @@ for ``t \in [0.1, 5]`` with history function ```math \begin{align*} -\phi_1(t) &= \log t, \\ -\phi_2(t) &= 1 / t, +ϕ_1(t) &= \log t, \\ +ϕ_2(t) &= 1 / t, \end{align*} ``` @@ -503,9 +503,9 @@ Delay differential equation model of antigen antibody dynamics with fading memor ```math \begin{align*} u_1'(t) &= - r_1 u_1(t) u_2(t) + r_2 u_3(t), \\ -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)), \\ -u_3'(t) &= r_1 u_1(t) u_2(t) - r_2 u_3(t), \\ -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)), +u_2'(t) &= - r_1 u_1(t) u_2(t) + α r_1 u_1(t - u_4(t)) u_2(t - u_4(t)), \\ +u_3'(t) &= r_1 u_1(t) u_2(t) - r_2 u_3(t), \\ +u_4'(t) &= 1 + \frac{3δ - 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(δ u_4(t)), \end{align*} ``` @@ -513,14 +513,14 @@ for ``t \in [0, 40]`` with history function ```math \begin{align*} -\phi_1(t) &= 5, & -\phi_2(t) &= 0.1, \\ -\phi_3(t) &= 0, & -\phi_4(t) &= 0, +ϕ_1(t) &= 5, & +ϕ_2(t) &= 0.1, \\ +ϕ_3(t) &= 0, & +ϕ_4(t) &= 0, \end{align*} ``` -for ``t \leq 0``, where ``r_1 = 0.02``, ``r_2 = 0.005``, ``\alpha = 3``, and ``\delta = 0.01``. +for ``t ≤ 0``, where ``r_1 = 0.02``, ``r_2 = 0.005``, ``α = 3``, and ``δ = 0.01``. # References @@ -565,8 +565,8 @@ Delay differential equation model of a food-limited population, given by u(t) = r u(t) (1 - u(t - 1) - c u'(t - 1)) ``` -for ``t \in [0, 40]`` with history function ``\phi(t) = 2 + t`` for ``t \leq 0``, where -``r = \pi / \sqrt{3} + 1/20`` and ``c = \sqrt{3} / (2 \pi) - 1 / 25``. +for ``t \in [0, 40]`` with history function ``ϕ(t) = 2 + t`` for ``t ≤ 0``, where +``r = π / \sqrt{3} + 1/20`` and ``c = \sqrt{3} / (2π) - 1 / 25``. # References @@ -600,8 +600,8 @@ Delay differential equation model of a logistic Gauss-type predator-prey system, ```math \begin{align*} -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}, \\ -u_2'(t) &= u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - \alpha\right), +u_1'(t) &= u_1(t) (1 - u_1(t - τ) - ρ u_1'(t - τ)) - \frac{u_2(t) u_1(t)^2}{u_1(t)^2 + 1}, \\ +u_2'(t) &= u_2(t) \left(\frac{u_1(t)^2}{u_1(t)^2 + 1} - α\right), \end{align*} ``` @@ -609,12 +609,12 @@ for ``t \in [0, 2]`` with history function ```math \begin{align*} -\phi_1(t) &= 0.33 - t / 10, \\ -\phi_2(t) &= 2.22 + t / 10, +ϕ_1(t) &= 0.33 - t / 10, \\ +ϕ_2(t) &= 2.22 + t / 10, \end{align*} ``` -for ``t \leq 0``, where ``\alpha = 0.1``, ``\rho = 2.9``, and ``\tau = 0.42``. +for ``t ≤ 0``, where ``α = 0.1``, ``ρ = 2.9``, and ``τ = 0.42``. # References @@ -673,7 +673,7 @@ Delay differential equation u'(t) = 2 \cos(2t) u(t / 2)^{2 \cos t} + \log(u'(t / 2)) - \log(2 \cos t) - \sin t ``` -for ``t \in [0, 1]`` with history function ``\phi(0) = 1`` and ``\phi'(0) = 2``. +for ``t \in [0, 1]`` with history function ``ϕ(0) = 1`` and ``ϕ'(0) = 2``. # Solution @@ -737,8 +737,8 @@ Delay differential equation u'(t) = u'(2t - 0.5) ``` -for ``t \in [0.25, 0.499]`` with history function ``\phi(t) = \exp(-t^2)`` and -``\phi'(t) = -2t \exp(-t^2)`` for ``t \leq 0.25``. +for ``t \in [0.25, 0.499]`` with history function ``ϕ(t) = \exp(-t^2)`` and +``ϕ'(t) = -2t \exp(-t^2)`` for ``t ≤ 0.25``. # Solution @@ -821,11 +821,11 @@ const prob_dde_DDETST_F2 = DDEProblem( Delay differential equation ```math -u'(t) = \exp(-u(t)) + L_3 \left[\sin(u'(\alpha(t))) - \sin\left(\frac{1}{3 + \alpha(t)}\right)\right] +u'(t) = \exp(-u(t)) + L_3 \left[\sin(u'(α(t))) - \sin\left(\frac{1}{3 + α(t)}\right)\right] ``` -for ``t \in [0, 10]`` with history function ``\phi(0) = \log 3`` and ``\phi'(0) = 1 / 3``, -where ``\alpha(t) = 0.5 t (1 - \cos(2 \pi t))`` and ``L_3 = 0.2``. +for ``t \in [0, 10]`` with history function ``ϕ(0) = \log 3`` and ``ϕ'(0) = 1 / 3``, +where ``α(t) = 0.5 t (1 - \cos(2πt))`` and ``L_3 = 0.2``. # Solution @@ -922,8 +922,8 @@ Delay differential equation u'(t) = - u'(t - u(t)^2 / 4) ``` -for ``t \in [0, 1]`` with history function ``\phi(t) = 1 - t`` for ``t \leq 0`` and -``\phi'(t) = -1`` for ``t < 0``. +for ``t \in [0, 1]`` with history function ``ϕ(t) = 1 - t`` for ``t ≤ 0`` and +``ϕ'(t) = -1`` for ``t < 0``. # Solution @@ -978,8 +978,8 @@ Delay differential equation u'(t) = - u'(u(t) - 2) ``` -for ``t \in [0, 1]`` with history function ``\phi(t) = 1 - t`` for ``t \leq 0`` and -``\phi'(t) = -1`` for ``t < 0``. +for ``t \in [0, 1]`` with history function ``ϕ(t) = 1 - t`` for ``t ≤ 0`` and +``ϕ'(t) = -1`` for ``t < 0``. # Solution @@ -1032,11 +1032,11 @@ Delay differential equation u'(t) = - \frac{4 t u(t)^2}{4 + \log(\cos(2t))^2} + \tan(2t) + 0.5 \arctan\left(u'\left(\frac{t u(t)^2}{1 + u(t)^2}\right)\right) ``` -for ``t \in [0, 0.225 \pi]`` with history function ``\phi(0) = 0`` and ``\phi'(0) = 0``. +for ``t \in [0, 0.225 π]`` with history function ``ϕ(0) = 0`` and ``ϕ'(0) = 0``. # Solution -The analytical solution for ``t \in [0, 0.225 \pi]`` is +The analytical solution for ``t \in [0, 0.225 π]`` is ```math u(t) = - \log(\cos(2t)) / 2. @@ -1092,12 +1092,12 @@ Delay differential equation u'(t) = \cos(t) (1 + u(t u(t)^2)) + L_3 u(t) u'(t u(t)^2) + (1 - L_3) \sin(t) \cos(t \sin(t)^2) - \sin(t + t \sin(t)^2) ``` -for ``t \in [0, \pi]`` with history function ``\phi(0) = 0`` and ``\phi'(0) = 1``, where +for ``t \in [0, π]`` with history function ``ϕ(0) = 0`` and ``ϕ'(0) = 1``, where ``L_3 = 0.1``. # Solution -The analytical solution for ``t \in [0, \pi]`` is +The analytical solution for ``t \in [0, π]`` is ```math u(t) = \sin(t). diff --git a/lib/DDEProblemLibrary/src/radar5.jl b/lib/DDEProblemLibrary/src/radar5.jl index 4909b5f..c1e4dfa 100644 --- a/lib/DDEProblemLibrary/src/radar5.jl +++ b/lib/DDEProblemLibrary/src/radar5.jl @@ -12,8 +12,8 @@ Delay differential equation model from chemical kinetics, given by ```math \begin{align*} - 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, \\ - 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), + u_1'(t) &= - k_1 A u_2(t) - k_2 u_1(t) u_2(t - τ) + k_3 B u_1(t) - 2 k_4 u_1(t)^2, \\ + u_2'(t) &= - k_1 A u_2(t) - k_2 u_1(t) u_2(t - τ) + f k_3 B u_1(t), \end{align*} ``` @@ -21,13 +21,13 @@ for ``t \in [0, 100.5]`` with history function ```math \begin{align*} - \phi_1(t) &= 10^{-10}, \\ - \phi_2(t) &= 10^{-5}, + ϕ_1(t) &= 10^{-10}, \\ + ϕ_2(t) &= 10^{-5}, \end{align*} ``` -for ``t \leq 0``, where ``k_1 = 1.34``, ``k_2 = 1.6×10^9``, ``k_3 = 8000``, ``k_4 = 4×10^7``, -``k_5 = 1``, ``f = 1``, ``A = 0.06``, ``B = 0.06``, and ``\tau = 0.15``. +for ``t ≤ 0``, where ``k_1 = 1.34``, ``k_2 = 1.6×10^9``, ``k_3 = 8000``, ``k_4 = 4×10^7``, +``k_5 = 1``, ``f = 1``, ``A = 0.06``, ``B = 0.06``, and ``τ = 0.15``. # References @@ -76,15 +76,15 @@ by ```math \begin{align*} - u_1'(t) &= - a u_1(t) + b u_2(t - \tau) u_3(t), \\ - u_2'(t) &= a u_1(t) - b u_2(t - \tau) u_3(t) - c u_2(t)^2, \\ + u_1'(t) &= - a u_1(t) + b u_2(t - τ) u_3(t), \\ + u_2'(t) &= a u_1(t) - b u_2(t - τ) u_3(t) - c u_2(t)^2, \\ u_3'(t) &= c u_2(t)^2, \end{align*} ``` -for ``t \in [0, 10^{10}]`` with history function ``\phi_1(0) = 1``, ``\phi_2(t) = 0`` for -``t \in [-\tau, 0]``, and ``\phi_3(0) = 0``, where ``a = 0.04``, ``b = 10_000``, -``c = 3×10^7``, and ``\tau = 0.01``. +for ``t \in [0, 10^{10}]`` with history function ``ϕ_1(0) = 1``, ``ϕ_2(t) = 0`` for +``t \in [-τ, 0]``, and ``ϕ_3(0) = 0``, where ``a = 0.04``, ``b = 10_000``, +``c = 3×10^7``, and ``τ = 0.01``. # References @@ -132,11 +132,11 @@ Delay differential equation model of antibody production, given by ```math \begin{align*} u_1'(t) &= - r u_1(t) u_2(t) - s u_1(t) u_4(t), \\ - 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], \\ + u_2'(t) &= - r u_1(t) u_2(t) + α r u_1(u_5(t)) u_2(u_5(t)) & [t ≥ t_0], \\ u_3'(t) &= r u_1(t) u_2(t), \\ - 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], \\ - 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))}, \\ - u_6'(t) &= [t \geq t_1] \frac{10^{-12} + u_2(t) + u_3(t)}{10^{-12} + u_2(u_6(t)) + u_3(u_6(t))}, + u_4'(t) &= - s u_1(t) u_4(t) - γ u_4(t) + β r u_1(u_6(t)) u_2(u_6(t)) & [t > t_1], \\ + u_5'(t) &= [t ≥ 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))}, \\ + u_6'(t) &= [t ≥ t_1] \frac{10^{-12} + u_2(t) + u_3(t)}{10^{-12} + u_2(u_6(t)) + u_3(u_6(t))}, \end{align*} ``` @@ -144,17 +144,17 @@ for ``t \in [0, 300]`` with history function ```math \begin{align*} - \phi_1(t) &= \phi_0, & - \phi_2(t) &= 10^{-15}, \\ - \phi_3(t) &= 0, & - \phi_4(t) &= 0, \\ - \phi_5(t) &= 0, & - \phi_6(t) &= 0, + ϕ_1(t) &= ϕ_0, & + ϕ_2(t) &= 10^{-15}, \\ + ϕ_3(t) &= 0, & + ϕ_4(t) &= 0, \\ + ϕ_5(t) &= 0, & + ϕ_6(t) &= 0, \end{align*} ``` -for ``t \leq 0``, where ``\alpha = 1.8``, ``\beta = 20``, ``\gamma = 0.002``, ``r = 5\times10^4``, -``s = 10^5``, ``t_0 = 32``, ``t_1 = 119``, and ``\phi_0 = 0.75×10^{-4}``. +for ``t ≤ 0``, where ``α = 1.8``, ``β = 20``, ``γ = 0.002``, ``r = 5×10^4``, +``s = 10^5``, ``t_0 = 32``, ``t_1 = 119``, and ``ϕ_0 = 0.75×10^{-4}``. # References @@ -218,7 +218,7 @@ const prob_dde_RADAR5_waltman_1 = prob_dde_RADAR5_waltman prob_dde_RADAR5_waltman_2 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 32``, -``t_1 = 111``, and ``\phi_0 = 0.5×10^{-4}``. +``t_1 = 111``, and ``ϕ_0 = 0.5×10^{-4}``. # References @@ -232,7 +232,7 @@ const prob_dde_RADAR5_waltman_2 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_3 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 33``, -``t_1 = 145``, and ``\phi_0 = 10^{-5}``. +``t_1 = 145``, and ``ϕ_0 = 10^{-5}``. # References @@ -246,7 +246,7 @@ const prob_dde_RADAR5_waltman_3 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_4 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 34``, -``t_1 = 163``, and ``\phi_0 = 0.75×10^{-5}``. +``t_1 = 163``, and ``ϕ_0 = 0.75×10^{-5}``. # References @@ -260,7 +260,7 @@ const prob_dde_RADAR5_waltman_4 = remake(prob_dde_RADAR5_waltman; prob_dde_RADAR5_waltman_5 Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 35``, -``t_1 = 197``, and ``\phi_0 = 0.5×10^{-5}``. +``t_1 = 197``, and ``ϕ_0 = 0.5×10^{-5}``. # References diff --git a/lib/ODEProblemLibrary/src/brusselator_prob.jl b/lib/ODEProblemLibrary/src/brusselator_prob.jl index 7f9e219..4a2b30e 100644 --- a/lib/ODEProblemLibrary/src/brusselator_prob.jl +++ b/lib/ODEProblemLibrary/src/brusselator_prob.jl @@ -60,8 +60,8 @@ xyd_brusselator = range(0, stop = 1, length = 32) ```math \begin{align*} -\frac{\partial u}{\partial t} &= 1 + u^2v - 4.4u + \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) + f(x, y, t) \\ -\frac{\partial v}{\partial t} &= 3.4u - u^2v + \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) +\frac{∂u}{∂t} &= 1 + u^2v - 4.4u + α\left(\frac{∂^2 u}{∂x^2} + \frac{∂^2 u}{∂y^2}\right) + f(x, y, t) \\ +\frac{∂v}{∂t} &= 3.4u - u^2v + α\left(\frac{∂^2 u}{∂x^2} + \frac{∂^2 u}{∂y^2}\right) \end{align*} ``` @@ -78,8 +78,8 @@ and the initial conditions are ```math \begin{align*} -u(x, y, 0) &= 22\cdot y(1-y)^{3/2} \\ -v(x, y, 0) &= 27\cdot x(1-x)^{3/2} +u(x, y, 0) &= 22 ⋅ y(1-y)^{3/2} \\ +v(x, y, 0) &= 27 ⋅ x(1-x)^{3/2} \end{align*} ``` @@ -131,8 +131,8 @@ end ```math \begin{align*} -\frac{\partial u}{\partial t} &= A + u^2v - (B+1)u + \alpha\frac{\partial^2 u}{\partial x^2} \\ -\frac{\partial v}{\partial t} &= Bu - u^2v + \alpha\frac{\partial^2 u}{\partial x^2} +\frac{∂u}{∂t} &= A - (B+1) u + u^2 v + α \frac{∂^2 u}{∂x^2} \\ +\frac{∂v}{∂t} &= B u - u^2 v + α \frac{∂^2 u}{∂x^2} \end{align*} ``` @@ -140,7 +140,7 @@ and the initial conditions are ```math \begin{align*} -u(x,0) &= 1 + \sin(2π x) \\ +u(x,0) &= 1 + \sin(2πx) \\ v(x,0) &= 3 \end{align*} ``` diff --git a/lib/ODEProblemLibrary/src/ode_linear_prob.jl b/lib/ODEProblemLibrary/src/ode_linear_prob.jl index cc6dd52..d713e97 100644 --- a/lib/ODEProblemLibrary/src/ode_linear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_linear_prob.jl @@ -40,7 +40,7 @@ prob_ode_bigfloatlinear = ODEProblem(ODEFunction(linear, analytic = linear_analy f_2dlinear = (du, u, p, t) -> (@. du = p * u) f_2dlinear_analytic = (u0, p, t) -> @. u0 * exp(p * t) """ -4x2 version of the Linear ODE +4×2 version of the Linear ODE ```math \\frac{du}{dt} = αu @@ -59,7 +59,7 @@ prob_ode_2Dlinear = ODEProblem(ODEFunction(f_2dlinear, analytic = f_2dlinear_ana rand(4, 2), (0.0, 1.0), 1.01) """ -100x100 version of the Linear ODE +100×100 version of the Linear ODE ```math \\frac{du}{dt} = αu @@ -79,7 +79,7 @@ prob_ode_large2Dlinear = ODEProblem( rand(100, 100), (0.0, 1.0), 1.01) """ -4x2 version of the Linear ODE +4×2 version of the Linear ODE ```math \\frac{du}{dt} = αu @@ -102,7 +102,7 @@ prob_ode_bigfloat2Dlinear = ODEProblem( f_2dlinear_notinplace = (u, p, t) -> p * u """ -4x2 version of the Linear ODE +4×2 version of the Linear ODE ```math \\frac{du}{dt} = αu diff --git a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl index 4882718..b101f05 100644 --- a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl @@ -126,7 +126,7 @@ The Robertson biochemical reactions: (Stiff) \end{align*} ``` -where ``k₁=0.04``, ``k₂=3\times10^7``, ``k₃=10^4``. For details, see: +where ``k₁=0.04``, ``k₂=3×10^7``, ``k₃=10^4``. For details, see: Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129 diff --git a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl index 72d8395..cb9c450 100644 --- a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl +++ b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl @@ -44,7 +44,7 @@ prob_sde_linear_stratonovich = SDEProblem( f_linear_iip(du, u, p, t) = @.(du=1.01 * u) σ_linear_iip(du, u, p, t) = @.(du=0.87 * u) @doc doc""" -8 linear SDEs (as a 4x2 matrix): +8 linear SDEs (as a 4×2 matrix): ```math du_t = αu\,dt + βu\,dW_t From 4e7f14b65b6d2f72803fb8aabd19301f253e48b3 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:03:03 -0400 Subject: [PATCH 07/10] Add Markdown link syntax to URL in docstring --- lib/DAEProblemLibrary/src/DAEProblemLibrary.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl index 2393dcf..ff9299e 100644 --- a/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl +++ b/lib/DAEProblemLibrary/src/DAEProblemLibrary.jl @@ -100,7 +100,7 @@ f(t, y)=\begin{pmatrix} ``` ## Reference -DAE testset: https://archimede.uniba.it/~testset/problems/transamp.php +DAE testset: """ prob_dae_transamp = DAEProblem(transamp, du0, u0, (0.0, 0.2)) From dad9c1eb7430dded7e7b6a6ed4aaa6af6e1f4655 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:05:01 -0400 Subject: [PATCH 08/10] Add newline to LaTeX `align*` block --- lib/BVProblemLibrary/src/linear.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/BVProblemLibrary/src/linear.jl b/lib/BVProblemLibrary/src/linear.jl index 36820c8..aa9a414 100644 --- a/lib/BVProblemLibrary/src/linear.jl +++ b/lib/BVProblemLibrary/src/linear.jl @@ -816,7 +816,7 @@ The analytical solution for ``t \in [-1, 1]`` is ```math \begin{align*} -y_1(t) &= \cos(πt) + \exp(-(t+1)/\sqrt{λ}) +y_1(t) &= \cos(πt) + \exp(-(t+1)/\sqrt{λ}) \\ y_2(t) &= y_1'(t) \end{align*} ``` From 512540214e2898cd8ed6bfb868161f376ad03aa5 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:19:09 -0400 Subject: [PATCH 09/10] Add Documenter's `@ref` links to docstrings --- lib/DDEProblemLibrary/src/radar5.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DDEProblemLibrary/src/radar5.jl b/lib/DDEProblemLibrary/src/radar5.jl index c1e4dfa..f06f5bf 100644 --- a/lib/DDEProblemLibrary/src/radar5.jl +++ b/lib/DDEProblemLibrary/src/radar5.jl @@ -217,7 +217,7 @@ const prob_dde_RADAR5_waltman_1 = prob_dde_RADAR5_waltman @doc raw""" prob_dde_RADAR5_waltman_2 -Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 32``, +Same delay differential equation as [`prob_dde_RADAR5_waltman`](@ref) with ``t_0 = 32``, ``t_1 = 111``, and ``ϕ_0 = 0.5×10^{-4}``. # References @@ -231,7 +231,7 @@ const prob_dde_RADAR5_waltman_2 = remake(prob_dde_RADAR5_waltman; @doc raw""" prob_dde_RADAR5_waltman_3 -Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 33``, +Same delay differential equation as [`prob_dde_RADAR5_waltman`](@ref) with ``t_0 = 33``, ``t_1 = 145``, and ``ϕ_0 = 10^{-5}``. # References @@ -245,7 +245,7 @@ const prob_dde_RADAR5_waltman_3 = remake(prob_dde_RADAR5_waltman; @doc raw""" prob_dde_RADAR5_waltman_4 -Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 34``, +Same delay differential equation as [`prob_dde_RADAR5_waltman`](@ref) with ``t_0 = 34``, ``t_1 = 163``, and ``ϕ_0 = 0.75×10^{-5}``. # References @@ -259,7 +259,7 @@ const prob_dde_RADAR5_waltman_4 = remake(prob_dde_RADAR5_waltman; @doc raw""" prob_dde_RADAR5_waltman_5 -Same delay differential equation as [`prob_dde_RADAR5_waltman`] with ``t_0 = 35``, +Same delay differential equation as [`prob_dde_RADAR5_waltman`](@ref) with ``t_0 = 35``, ``t_1 = 197``, and ``ϕ_0 = 0.5×10^{-5}``. # References From a46cf1be5a8ba00bc77df67339da94156ed134bf Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:22:19 -0400 Subject: [PATCH 10/10] Add `@doc_str` macros to docstrings in ode_linear_prob.jl File missed in PR #163 (https://github.com/SciML/DiffEqProblemLibrary.jl/pull/163) --- lib/ODEProblemLibrary/src/ode_linear_prob.jl | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/ODEProblemLibrary/src/ode_linear_prob.jl b/lib/ODEProblemLibrary/src/ode_linear_prob.jl index d713e97..0ee61ca 100644 --- a/lib/ODEProblemLibrary/src/ode_linear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_linear_prob.jl @@ -1,14 +1,14 @@ # Linear ODE linear = (u, p, t) -> (p * u) linear_analytic = (u0, p, t) -> u0 * exp(p * t) -""" +@doc doc""" Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0=\\frac{1}{2}``, ``α=1.01``, and solution +with initial condition ``u_0=\frac{1}{2}``, ``α=1.01``, and solution ```math u(t) = u_0 e^{αt} @@ -19,14 +19,14 @@ with Float64s. The parameter is ``α`` prob_ode_linear = ODEProblem(ODEFunction(linear, analytic = linear_analytic), 1 / 2, (0.0, 1.0), 1.01) -""" +@doc doc""" Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0=\\frac{1}{2}``, ``α=1.01``, and solution +with initial condition ``u_0=\frac{1}{2}``, ``α=1.01``, and solution ```math u(t) = u_0 e^{αt} @@ -39,14 +39,14 @@ prob_ode_bigfloatlinear = ODEProblem(ODEFunction(linear, analytic = linear_analy f_2dlinear = (du, u, p, t) -> (@. du = p * u) f_2dlinear_analytic = (u0, p, t) -> @. u0 * exp(p * t) -""" +@doc doc""" 4×2 version of the Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0`` as all uniformly distributed random numbers, +with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math @@ -58,14 +58,14 @@ with Float64s prob_ode_2Dlinear = ODEProblem(ODEFunction(f_2dlinear, analytic = f_2dlinear_analytic), rand(4, 2), (0.0, 1.0), 1.01) -""" +@doc doc""" 100×100 version of the Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0`` as all uniformly distributed random numbers, +with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math @@ -78,14 +78,14 @@ prob_ode_large2Dlinear = ODEProblem( ODEFunction(f_2dlinear, analytic = f_2dlinear_analytic), rand(100, 100), (0.0, 1.0), 1.01) -""" +@doc doc""" 4×2 version of the Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0`` as all uniformly distributed random numbers, +with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math @@ -101,14 +101,14 @@ prob_ode_bigfloat2Dlinear = ODEProblem( big(1.01)) f_2dlinear_notinplace = (u, p, t) -> p * u -""" +@doc doc""" 4×2 version of the Linear ODE ```math -\\frac{du}{dt} = αu +\frac{du}{dt} = αu ``` -with initial condition ``u_0`` as all uniformly distributed random numbers, +with initial condition ``u_0`` as all uniformly distributed random numbers, ``α=1.01``, and solution ```math