# Applications cheatsheet Star

## Physics Laws

Gravitational force A mass $m$ is subject to the gravitational force $\vec{F}_g$, which is expressed with respect to $\vec{g}$ of magnitude $9.81\textrm{ m}\cdot \textrm{s}^{-2}$ and directed towards the center of the Earth, as follows:

$\boxed{\vec{F}_g=m\vec{g}}$

Spring force A spring of constant $k$ and of relaxed position $\vec{x}_0$ attached a mass $m$ of position $\vec{x}$ has a force $\vec{F}_{s}$ expressed as follows:

$\boxed{\vec{F}_s=-k(\vec{x}-\vec{x}_0)}$

Friction force The friction force $F_{f}$ of constant coefficient $\beta$ applied on a mass of velocity $\vec{v}$ is written as:

$\boxed{\vec{F}_f=-\beta\vec{v}}$

Mass moment of inertia The mass moment of inertia of a system of mass $m_i$ located at distance $r_i$ from point $O$, expressed in point $O$ is written as:

$\boxed{J_0 = \sum_{i} m_ir_i^2}$

Torque The torque $\vec{T}$ of a force $\vec{F}$ located at $\vec{r}$ from the reference point $O$ is written as:

$\boxed{\vec{T}=\vec{r}\times\vec{F}}$

Newton's second law A mass $m$ of acceleration $\vec{a}$ to which forces $\vec{F}_i$ are applied verifies the following equation:

$\boxed{m\vec{a}=\sum_i\vec{F}_i}$

In the 1-D case along the $x$ axis, we can write it as $mx''=\sum_{i}F_i$.
In the rotationary case, around point $O$, we can write it as $J_0\theta''=\sum_iT_i$.

## Spring-mass system

### Free oscillation

Free undamped motion A free undamped spring-mass system of mass $m$ and spring coefficient $k$ follows the ODE $x''+\frac{k}{m}x=0$, which can be written as a function of the natural frequency $\omega$ as:

$\boxed{x''+\omega^2 x=0}\quad\textrm{with}\quad\boxed{\omega=\sqrt{\frac{k}{m}}}$

Free damped motion A free damped spring-mass system of mass $m$, of spring coefficient $k$ and subject to a friction force of coefficient $\beta$ follows the ODE $x''+\frac{\beta}{m}x'+\frac{k}{m}x=0$, which can be written as a function of the damping parameter $\lambda$ and the natural frequency $\omega$ as:

$\boxed{x''+2\lambda x'+\omega^2 x=0}\quad\textrm{with}\quad\boxed{\lambda=\frac{\beta}{2m}}\quad\textrm{and}\quad\boxed{\omega=\sqrt{\frac{k}{m}}}$

which has the following cases summed up in the table below:

 Condition Type of motion $\lambda>\omega$ Over damped $\lambda=\omega$ Critically damped $\lambda<\omega$ Under damped

### Forced oscillation

Forcing frequency A forcing function $F(t)$ is often modeled with a periodic function of the form $F(t)=F_0\sin(\gamma t)$, where $\gamma$ is called the forcing frequency.

Forced undamped motion A forced undamped spring-mass system of mass $m$ and spring coefficient $k$ follows the ODE $x''+\frac{k}{m}x=F_0\sin(\gamma t)$, which can be written as a function of the natural frequency $\omega$ as:

$\boxed{x''+\omega^2 x=F_0\sin(\gamma t)}\quad\textrm{with}\quad\boxed{\omega=\sqrt{\frac{k}{m}}}$

which has the following cases summed up in the table below:

 Condition Type of motion $\gamma\neq\omega$ General response $\gamma\approx\omega$ Beats $\gamma=\omega$ Resonance

Forced damped motion A forced damped spring-mass system of mass $m$, of spring coefficient $k$ and subject to a friction force of coefficient $\beta$ follows the ODE $x''+\frac{\beta}{m}x'+\frac{k}{m}x=F_0\sin(\gamma t)$, which can be written as a function of the damping parameter $\lambda$ and the natural frequency $\omega$ as:

$\boxed{x''+2\lambda x'+\omega^2 x=F_0\sin(\gamma t)}\quad\textrm{with}\quad\boxed{\lambda=\frac{\beta}{2m}}\quad\textrm{and}\quad\boxed{\omega=\sqrt{\frac{k}{m}}}$

## Boundary Value Problems

Types of boundary conditions Given a numerical problem between $0$ and $L$, we distinguish the following types of boundary conditions:

 Name Boundary values Dirichlet $y(0)$ and $y(L)$ Neumann $y(0)$ and $y'(L)$ Robin $y(0)$ and $\alpha y(L)+\beta y'(L)$

Numerical differentiation The table below sums up the approximation of the derivatives of $y$ at point $x_j$, knowing the values of $y$ at each point of a uniformly spaced set of grid points.

 Order of derivative Name Formula Order of error First derivative Forward differenceBackward differenceCentral difference $y_{j}'=\frac{y_{j+1}-y_j}{h}$$y_j'=\frac{y_{j}-y_{j-1}}{h}$$y_j'=\frac{y_{j+1}-y_{j-1}}{2h}$ $O(h)$$O(h)$$O(h^2)$ Second derivative Central difference $y_j''=\frac{y_{j+1}-2y_j+y_{j-1}}{h^2}$ $O(h^2)$

Direct method The direct method can solve linear ODEs by reducing the problem to the resolution of a linear system $Ay=f$, where $A$ is a tridiagonal matrix.

Shooting method The shooting method is an algorithm that can solve ODEs through an iterative process. It uses a numerical scheme, such as Runge-Kutta, and converges to the right solution by iteratively searching for the missing initial condition $y'(0)$.

Remark: in the linear case, the shooting method converges after the first two initial guesses.