User:Arthurv/sandbox

Glide equations
Assumptions:
 * 1) $$D$$ is proportional to $V^2$ (induced drag is much smaller than profile drag)
 * 2) straight flight path at constant velocity
 * 3) still air (wind =0)

So "thrust" in unpowered gliding flight is provided by a component of the weight vector W:

$$ T = D = W\sin\theta $$

And taking assumptions above:

$$T = D = \frac{1}{2}\rho V^2SC_d = W \sin\theta $$

Condensing the constants into k, we can write this as:

$$V^2 \propto k \sin\theta$$

$$\therefore V \propto \sqrt{k \sin\theta}$$

Taking the horizontal component of V:

$$V_x = V\cos\theta \propto \sqrt{k \sin\theta}\cos\theta$$

To take the maximum of this, you can plot this function, or differentiate it and equate to zero:

$$\frac{dV_x}{d\theta} = 0 = \frac{d}{d\theta}\left(\sqrt{k \sin\theta}\cos\theta\right)$$

Equating to 0 factors out sqrt(k), so:

$$0 = \frac{\cos\theta}{2\sqrt{\sin\theta}}\cos\theta - \sqrt{\sin\theta}\sin\theta$$

$$0 = \frac{\cos^2\theta}{2\sqrt{\sin\theta}} - \sin^\frac{3}{2}\theta$$

Substituting $$\cos^2\theta = 1-\sin^2\theta$$,

$$\sin^\frac{3}{2}\theta = \frac{(1-\sin^2\theta)}{2\sqrt{\sin\theta}}$$

Which can be simplified to:

$$\sin\theta = \sqrt{\frac{1}{3}}$$

And finally:

$$\theta \approx 35.26^\circ$$

And since $$L = W\cos\theta$$

$$D = W\sin\theta$$

$$\frac{D}{W} = \sin\theta \therefore L/D = 2\sqrt{2} \approx 1.41$$

Motion equations
$$ \begin{bmatrix} x \\ \dot{x} \\ \ddot{x} \end{bmatrix}_{n+1} = \begin{bmatrix} 1 & \Delta t & \frac{1}{2} \Delta t^2 \\ 0 & 1 & \Delta t \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ \dot{x} \\ \ddot{x} \end{bmatrix}_n $$

$$ \begin{bmatrix} x \\ y \\ \dot{x} \\ \dot{y} \end{bmatrix}_{n+1} = \begin{bmatrix} 1 & 0 & \Delta t & 0 \\ 0 & 1 & 0 & \Delta t              \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ \dot{x} \\ \dot{y} \end{bmatrix}_n $$