@@ -40,21 +40,21 @@ plot!(sol.t, t->exp(-C₁*t),lw=3,ls=:dash,label="Analytical Solution")
40
40
41
41
#### Simple Harmonic Oscillator
42
42
43
- Another classical example is the harmonic oscillator, given by
44
- $$
45
- \ddot{x} + \omega^2 x = 0
46
- $$
43
+ Another classical example is the harmonic oscillator, given by:
44
+
45
+ $$ \ddot{x} + \omega^2 x = 0$$
46
+
47
47
with the known analytical solution
48
- $$
49
- \begin{align*}
48
+
49
+ $$ \begin{align*}
50
50
x(t) &= A\cos(\omega t - \phi) \\
51
51
v(t) &= -A\omega\sin(\omega t - \phi),
52
- \end{align*}
53
- $$
52
+ \end{align*}$$
53
+
54
54
where
55
- $$
56
- A = \sqrt{c_1 + c_2} \qquad\text{and}\qquad \tan \phi = \frac{c_2}{c_1}
57
- $$
55
+
56
+ $$ A = \sqrt{c_1 + c_2} \qquad\text{and}\qquad \tan \phi = \frac{c_2}{c_1}$$
57
+
58
58
with $c_1, c_2$ constants determined by the initial conditions such that
59
59
$c_1$ is the initial position and $\omega c_2$ is the initial velocity.
60
60
@@ -110,12 +110,10 @@ Notice that now we have a second order ODE.
110
110
In order to use the same method as above, we nee to transform it into a system
111
111
of first order ODEs by employing the notation $d\theta = \dot{\theta}$.
112
112
113
- $$
114
- \begin{align*}
113
+ $$\begin{align*}
115
114
&\dot{\theta} = d{\theta} \\
116
115
&\dot{d\theta} = - \frac{g}{L}{\sin(\theta)}
117
- \end{align*}
118
- $$
116
+ \end{align*}$$
119
117
120
118
```julia
121
119
# Simple Pendulum Problem
@@ -277,12 +275,10 @@ plot(p, xlabel="\\beta", ylabel="l_\\beta", ylims=(0, 0.03))
277
275
278
276
The Hénon-Heiles potential occurs when non-linear motion of a star around a galactic center with the motion restricted to a plane.
279
277
280
- $$
281
- \begin{align}
278
+ $$\begin{align}
282
279
\frac{d^2x}{dt^2}&=-\frac{\partial V}{\partial x}\\
283
280
\frac{d^2y}{dt^2}&=-\frac{\partial V}{\partial y}
284
- \end{align}
285
- $$
281
+ \end{align}$$
286
282
287
283
where
288
284
0 commit comments