@@ -40,21 +40,21 @@ plot!(sol.t, t->exp(-C₁*t),lw=3,ls=:dash,label="Analytical Solution")
4040
4141#### Simple Harmonic Oscillator
4242
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+
4747with the known analytical solution
48- $$
49- \begin{align*}
48+
49+ $$ \begin{align*}
5050x(t) &= A\cos(\omega t - \phi) \\
5151v(t) &= -A\omega\sin(\omega t - \phi),
52- \end{align*}
53- $$
52+ \end{align*}$$
53+
5454where
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+
5858with $c_1, c_2$ constants determined by the initial conditions such that
5959$c_1$ is the initial position and $\omega c_2$ is the initial velocity.
6060
@@ -110,12 +110,10 @@ Notice that now we have a second order ODE.
110110In order to use the same method as above, we nee to transform it into a system
111111of first order ODEs by employing the notation $d\theta = \dot{\theta}$.
112112
113- $$
114- \begin{align*}
113+ $$\begin{align*}
115114&\dot{\theta} = d{\theta} \\
116115&\dot{d\theta} = - \frac{g}{L}{\sin(\theta)}
117- \end{align*}
118- $$
116+ \end{align*}$$
119117
120118```julia
121119# Simple Pendulum Problem
@@ -277,12 +275,10 @@ plot(p, xlabel="\\beta", ylabel="l_\\beta", ylims=(0, 0.03))
277275
278276The Hénon-Heiles potential occurs when non-linear motion of a star around a galactic center with the motion restricted to a plane.
279277
280- $$
281- \begin{align}
278+ $$\begin{align}
282279\frac{d^2x}{dt^2}&=-\frac{\partial V}{\partial x}\\
283280\frac{d^2y}{dt^2}&=-\frac{\partial V}{\partial y}
284- \end{align}
285- $$
281+ \end{align}$$
286282
287283where
288284
0 commit comments