Calculus I
&
Engineering Mathematics 2

Workshop 9


Ordinary Differential Equations

Source: Falling

\[ m \frac{dV}{dt} =m\,g - k V \]


More info: Newton's second law of motion: $F=ma$


Ordinary Differential Equations

$\ds m \frac{d^2x}{dt^2} = -k\, x(t) $


More info: Free, Undamped Vibrations



Ordinary Differential Equations

$\ds x''(t) + \frac{\beta}{m}x'(t) + \frac{k}{m}x(t) =0$


More info: Free, Damped Vibrations



Ordinary Differential Equations

\(\ds \frac{d^2\theta(t) }{dt^2} = -\mu\frac{d\theta (t)}{dt}-\frac{g}{L} \sin \left(\theta(t)\right) \)


More info: Pendulum (mechanics)



Ordinary Differential Equations

\(\ds \frac{d^2\theta_i }{dt^2} =-\frac{g}{L_i}\sin \theta_i \)












Ordinary Differential Equations

\[ \begin{eqnarray} \theta_1'' & = & \frac{-g\left(2m_1+m_2\right)\sin \theta_1 - m_2 g \sin\left(\theta_1 - 2 \theta_2\right) - 2\sin\left(\theta_1 - \theta_2\right)\,m_2 \big[\theta_2'^2 L_2 + \theta_1'^2L_1 \cos\left(\theta_1 - \theta_2\right)\big]}{L_1\big[2m_1+m_3-m_2\cos \left(2\theta_1 - 2 \theta_2\right) \big]}\\ \theta_2'' & = & \frac{ 2\sin\left(\theta_1 - \theta_2\right) \big[ \theta_1'^2L_1(m_1+m_2) + g (m_1+m_2) \cos \theta_1 + \theta_2'^2L_2m_2\cos\left(\theta_1 - \theta_2\right) \big]}{L_2\big[2m_1+m_3-m_2\cos \left(2\theta_1 - 2 \theta_2\right) \big]}\\ \end{eqnarray} \]



Ordinary Differential Equations

First and second order ODEs are amazing! 😎

However, they are really freaking hard to solve!

😭

$x^2\dfrac{d^2y}{dx^2} + x\dfrac{dy}{dx} + \left(x^2-\alpha^2 \right) y = 0,$ $\alpha \in \C.$

Source: Bessel functions - circular drumhead



Ordinary Differential Equations

It gets even more complicated when we consider
Partial Differential Equations

For example, Laplace equation

$\dfrac{\partial^2u }{\partial x^2} + \dfrac{\partial^2u}{\partial y^2}+ \dfrac{\partial^2u }{\partial z^2}=0$





Ordinary Differential Equations

It gets even more complicated when we consider
Partial Differential Equations

Simulation by: Konstantin Makhmutov

Chladni Figures:
$$N^2\left( \dfrac{\partial^4 z}{\partial x^4} + 2 \dfrac{\partial^4 z}{\partial x^2\partial y^2} + \dfrac{\partial^4 z}{\partial y^4} \right) + \dfrac{\partial^2 z}{\partial t^2} = 0 ,$$ $$N\in \R.$$


Ordinary Differential Equations

It gets even more complicated when we consider
Partial Differential Equations


Another example: Navier-Stokes equations (imcompressible)

\( \ds\rho \left(\frac{\partial \v}{\partial t} + \v \cdot \nabla \v \right) = -\nabla p + \mu \nabla^2 \v + \F, \quad \nabla \cdot \v = 0. \)







Ordinary Differential Equations

Another example: Navier-Stokes equations (imcompressible)

\( \ds\rho \left(\frac{\partial \v}{\partial t} + \v \cdot \nabla \v \right) = -\nabla p + \mu \nabla^2 \v + \F, \quad \nabla \cdot \v = 0. \)

Fluid simulation by Amanda Ghassaei     🔄 (Reset/Re-start)


Ordinary Differential Equations

A first-order ODE is called separable if it can be written in the form

$\ds \dif{y}{x} = f(x)\,g(y).$


$\ds \dif{y}{t} = f(t)\,g(y),\;\;$ $\ds \dif{y}{\theta} = f(\theta)\,g(y),\;\;$ $\ds \dif{T}{t} = f(t)\,g(T).$



Solving separable ODEs

$\ds \dif{y}{x} = f(x)\,g(y).$

  1. Rewrite the equation as $\,\displaystyle \frac{1}{g(y)}\,\dif{y}{x} = f(x).$
  2. Integrate both sides with respect to $x$: $\,\displaystyle \int\frac{1}{g(y)}\,\dif{y}{x}\, \dup x = \int f(x) \dup x.$
    • Note the integral on the left is a "substitution", so that we can replace the last equation by $\;\displaystyle \int\frac{\dup y}{g(y)} = \int f(x) \dup x. $
    • If we are lucky one or both of the integrals can actually be computed.
  1. Extra step: If we are even more lucky we can then finally explicitly express $y$ as a function of $x$.


Solving separable ODEs

Example: Solve the ODE $\;\ds \dif{y}{x}=\frac{x}{y}$.

$\ds \frac{dy}{dx} = x\left(\frac{1}{y}\right)$

$\Ra $ separable.

       😃



1. $\ds y \frac{dy}{dx} = x$

2. $\ds \int y \frac{dy}{dx} ~dx= \int x ~dx$ $\;\Ra\ds \int y ~dy = \int x~dx $

$\quad\Ra\; \ds \frac{y^2}{2}= \frac{x^2}{2}+C \;$ $\Ra\; y^2 = x^2 + K $

3. Extra step: $ \,y = \pm \sqrt{x^2+ K} $   📝



Solving separable ODEs

If $\,\ds\dif{y}{x}=\frac{x}{y},\,$ then $\,y^2 = x^2 + K $ or $ \,y = \pm \sqrt{x^2+ K} $

The solution we found for the above example contains an arbitrary constant. So this is the general solution.

In the case of an Initial Value Problem (IVP) this constant will be fixed to find one, particular solution.

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{x}{y}},$ $\, y(0)=3.$





Solving separable ODEs

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{x}{y}},$ $\, y(0)=3.$

We know that $y^2 = x^2 + K$ is the general solution.

Consider the initial condition $y(0)=3.$

That is $\,3^2=0^2+ K$ $\Ra K = 9\,$ $\,\Ra y = \pm \sqrt{x^2+9}.$

Here we need to take the $+$ sign since $\,y(0)=3.$

Therefore $\,y = \sqrt{x^2+9}$ is the solution to the IVP.


Steps to solve separable ODEs: $\ds \,\dif{y}{x} = f(x)\,g(y).$

  1. Rewrite the equation as $\,\displaystyle \frac{1}{g(y)}\,\dif{y}{x} = f(x).$
  2. Integrate both sides with respect to $x$:

    $\displaystyle \int\frac{1}{g(y)}\,\dif{y}{x}\, \dup x = \int f(x) \dup x\;$ $\iff$ $\displaystyle \int\frac{\dup y}{g(y)} = \int f(x) \dup x. $

  3. Extra step: If possible, explicitly express $y$ as a function of $x$.



Credits