Skip to content

Commit 8744108

Browse files
Merge pull request #165 from abhro/docstring-latex
Update TeX formula in docstrings
2 parents d40f483 + a46cf1b commit 8744108

File tree

14 files changed

+708
-841
lines changed

14 files changed

+708
-841
lines changed

lib/BVProblemLibrary/src/BVProblemLibrary.jl

Lines changed: 62 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -41,49 +41,29 @@ This test problem is about the optimal-time launching of a satellite into orbit
4141
Given by
4242
4343
```math
44-
\frac{dz_1}{dt}=z_3t_f
45-
```
46-
```math
47-
\frac{dz_2}{dt}=z_4t_f
48-
```
49-
```math
50-
\frac{dz_3}{dt}=A\cos(z_5)t_f
51-
```
52-
```math
53-
\frac{dz_4}{dt}=(A\sin(z_5)-g)t_f
54-
```
55-
```math
56-
\frac{dz_5}{dt}=-z_6\cos(z_5)t_F
57-
```
58-
```math
59-
\frac{dz_6}{dt}=z_6^2\sin(z_5)t_f
60-
```
61-
```math
62-
\frac{dz_7}{dt}=0
44+
\begin{align*}
45+
\frac{dz_1}{dt} &= z_3 t_f, &
46+
\frac{dz_2}{dt} &= z_4 t_f, \\
47+
\frac{dz_3}{dt} &= A\cos(z_5) t_f, &
48+
\frac{dz_4}{dt} &= (A\sin(z_5)-g) t_f, \\
49+
\frac{dz_5}{dt} &= -z_6\cos(z_5) t_F, &
50+
\frac{dz_6}{dt} &= z_6^2\sin(z_5) t_f, \\
51+
\frac{dz_7}{dt} &= 0,
52+
\end{align*}
6353
```
6454
6555
with boundary condition
6656
6757
```math
68-
z_1(0)=0
69-
```
70-
```math
71-
z_2(0)=0
72-
```
73-
```math
74-
z_3(0)=0
75-
```
76-
```math
77-
z_4(0)=0
78-
```
79-
```math
80-
z_5(1)=h
81-
```
82-
```math
83-
z_6(1)=V_c
84-
```
85-
```math
86-
z_7(1)=0
58+
\begin{align*}
59+
z_1(0) &= 0, &
60+
z_2(0) &= 0, \\
61+
z_3(0) &= 0, &
62+
z_4(0) &= 0, \\
63+
z_5(1) &= h, &
64+
z_6(1) &= V_c, \\
65+
z_7(1) &= 0.
66+
\end{align*}
8767
```
8868
8969
# Solution
@@ -134,49 +114,29 @@ Launch of a satellite into circular orbit from a flat Earth where we assume a un
134114
Given by
135115
136116
```math
137-
\frac{dz_1}{dt}=z_3\frac{V_c}{h}
138-
```
139-
```math
140-
\frac{dz_2}{dt}=z_4\frac{V_c}{h}
141-
```
142-
```math
143-
\frac{dz_3}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}}
144-
```
145-
```math
146-
\frac{dz_4}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}}-\frac{g}{V_c}
147-
```
148-
```math
149-
\frac{dz_5}{dt}=0
150-
```
151-
```math
152-
\frac{dz_6}{dt}=-z_5\frac{V_c}{h}
153-
```
154-
```math
155-
\frac{dz_7}{dt}=0
117+
\begin{align*}
118+
\frac{dz_1}{dt} &= z_3 \frac{V_c}{h}, \\[2pt]
119+
\frac{dz_2}{dt} &= z_4 \frac{V_c}{h}, \\[2pt]
120+
\frac{dz_3}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}, \\[2pt]
121+
\frac{dz_4}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}-\frac{g}{V_c}, \\[2pt]
122+
\frac{dz_5}{dt} &= 0, \\[2pt]
123+
\frac{dz_6}{dt} &= -z_5 \frac{V_c}{h}, \\[2pt]
124+
\frac{dz_7}{dt} &= 0,
125+
\end{align*}
156126
```
157127
158-
with boundary condition
128+
with boundary conditions
159129
160130
```math
161-
z_1(0)=0
162-
```
163-
```math
164-
z_2(0)=0
165-
```
166-
```math
167-
z_3(0)=0
168-
```
169-
```math
170-
z_4(0)=0
171-
```
172-
```math
173-
z_5(1)=h
174-
```
175-
```math
176-
z_6(1)=V_c
177-
```
178-
```math
179-
z_7(1)=0
131+
\begin{align*}
132+
z_1(0) &= 0, &
133+
z_2(0) &= 0, \\
134+
z_3(0) &= 0, &
135+
z_4(0) &= 0, \\
136+
z_5(1) &= h, &
137+
z_6(1) &= V_c, \\
138+
z_7(1) &= 0.
139+
\end{align*}
180140
```
181141
182142
# Solution
@@ -261,49 +221,29 @@ Launch into circular orbit from a flat Earth including athmosferic drag.
261221
Given by
262222
263223
```math
264-
\frac{dz_1}{dt}=z_3\frac{V_c}{h}
265-
```
266-
```math
267-
\frac{dz_2}{dt}=z_4\frac{V_c}{h}
268-
```
269-
```math
270-
\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
271-
```
272-
```math
273-
\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
274-
```
275-
```math
276-
\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}
277-
```
278-
```math
279-
\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
280-
```
281-
```math
282-
\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
224+
\begin{align*}
225+
\frac{dz_1}{dt} &= z_3 \frac{V_c}{h} \\
226+
\frac{dz_2}{dt} &= z_4 \frac{V_c}{h} \\
227+
\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 \\
228+
\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 \\
229+
\frac{dz_5}{dt} &= -ηβ \exp(-z_2 β) (z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} \\
230+
\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 \\
231+
\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 \\
232+
\end{align*}
283233
```
284234
285-
with boundary condition
235+
with boundary conditions
286236
287237
```math
288-
z_1(0)=0
289-
```
290-
```math
291-
z_2(0)=0
292-
```
293-
```math
294-
z_3(0)=0
295-
```
296-
```math
297-
z_4(0)=0
298-
```
299-
```math
300-
z_5(1)=h
301-
```
302-
```math
303-
z_6(1)=V_c
304-
```
305-
```math
306-
z_7(1)=0
238+
\begin{align*}
239+
z_1(0) &= 0, &
240+
z_2(0) &= 0, \\
241+
z_3(0) &= 0, &
242+
z_4(0) &= 0, \\
243+
z_5(1) &= h, &
244+
z_6(1) &= V_c, \\
245+
z_7(1) &= 0.
246+
\end{align*}
307247
```
308248
309249
# Solution
@@ -346,22 +286,19 @@ This is an epidemiology model, about the spread of diseases.
346286
Given by
347287
348288
```math
349-
\frac{dy_1}{dt}=\mu-\beta(t)y_1y_3
350-
```
351-
```math
352-
\frac{dy_2}{dt}=\beta(t)y_1y_3-y_2/\lambda
353-
```
354-
```math
355-
\frac{dy_3}{dt}=y_2/\lambda-y_3/\eta
289+
\begin{align*}
290+
\frac{dy_1}{dt} &= μ - β(t) y_1 y_3 \\
291+
\frac{dy_2}{dt} &= β(t) y_1 y_3 - \frac{y_2}{λ} \\
292+
\frac{dy_3}{dt} &= \frac{y_2}{λ} - \frac{y_3}{η}
293+
\end{align*}
356294
```
357295
358296
with boundary condition
359297
360298
```math
361-
y(0)=y(1)
299+
y(0) = y(1)
362300
```
363301
364-
365302
# Solution
366303
367304
No analytical solution

0 commit comments

Comments
 (0)