# PlanetPhysics/Airship Stream Function

This is a work in progress... \\
Here we will calculate the stream function for an arbitrary body of revolution. This will then let us calculate the lift on an airship for various hull geometries. Following the setup in [1], combine the uniform stream function with a line of sources and sinks along the axis of symmetry.
The steps of the calcuation are:
1) Get an expression for the stream function. Since, we have lots of sources/sinks along the axis and we don't know the strength of each one $Q_{n}$, we must must setup algebraic equations to solve for the strengths
2) N equations are created by using the property that the stream function is zero on the surface
$\psi =0$
So for N sources/sinks we have N points $P_{n}$ on the surface giving us N equations and N unknowns.
3) Numerically solve the equations for the N source/sinks strengths.
{\mathbf Stream Function}
$\psi _{p}=-\sum _{n=1}^{N}{\frac {Q_{n}}{4\pi }}\left(r_{n-1}^{p}-r_{n}^{p}\right)+{\frac {1}{2}}V_{\infty }y_{p}^{2}$
In the below figure we need expressions for the vector magnitude from the source to the point on the surface
$\sin(\alpha _{n-1})={\frac {y_{p}}{r_{n-1}^{p}}}$
but
$\alpha _{n-1}=\tan ^{-1}\left({\frac {y_{p}}{x_{p}-x_{n-1}}}\right)$
Therefore
$r_{n-1}^{p}={\frac {y_{p}}{\sin(\tan ^{-1}\left({\frac {y_{p}}{x_{p}-x_{n-1}}}\right))}}$
Similarily,
$r_{n}^{p}={\frac {y_{p}}{\sin(\tan ^{-1}\left({\frac {y_{p}}{x_{p}-x_{n}}}\right))}}$
\begin{figure} \includegraphics[scale=.85]{AirshipStreamFunction.eps} \caption{Airship Stream Function Setup} \end{figure}
The last piece needed is to describe the airship geometry to give us $y_{p}$. Using the equation for an ellipse gives us a starting point.
$y_{p}=\pm b{\sqrt {1-{\frac {x_{n}^{2}}{a^{2}}}}}$
Combining all the equations gives us an expression for the stream function for the top surface points
$\psi _{p}=-\sum _{n=1}^{N}{\frac {Q_{n}b{\sqrt {1-{\frac {x_{n}^{2}}{a^{2}}}}}}{4\pi }}\left[{\frac {1}{\sin \left(\tan ^{-1}\left({\frac {b{\sqrt {1-{\frac {x_{n}^{2}}{a^{2}}}}}}{x_{p}-x_{n-1}}}\right)\right)}}-{\frac {1}{\sin \left(\tan ^{-1}\left({\frac {b{\sqrt {1-{\frac {x_{n}^{2}}{a^{2}}}}}}{x_{p}-x_{n}}}\right)\right)}}\right]+{\frac {1}{2}}V_{\infty }\left(b{\sqrt {1-{\frac {x_{n}^{2}}{a^{2}}}}}\right)^{2}$
Yikes! Following the example in [2] the matrix form of the above equation when put together for N equations for the top surface becomes
$A_{11}Q_{1}+A_{12}Q_{2}+...+A_{1n}Q_{n}={\frac {1}{2}}V_{\infty }y_{1}$ $A_{21}Q_{1}+A_{22}Q_{2}+...+A_{2n}Q_{n}={\frac {1}{2}}V_{\infty }y_{2}$ $...$ $A_{n1}Q_{1}+A_{n2}Q_{2}+...+A_{nn}Q_{n}={\frac {1}{2}}V_{\infty }y_{n}$
The matrix equation is then
${\mathbf {A} }{\mathbf {Q} }={\mathbf {Y} }$ ${\mathbf {Q} }={\mathbf {A} }^{-1}{\mathbf {Y} }$
therefore in matlab or octave we wil solve for the strengths, (i.e. 4 sources)
$\left[{\begin{matrix}Q_{1}\\Q_{2}\\Q_{3}\\Q_{4}\end{matrix}}\right]=inv\left[{\begin{matrix}A_{11}&A_{12}&A_{13}&A_{14}\\A_{21}&A_{22}&A_{23}&A_{24}\\A_{31}&A_{32}&A_{33}&A_{34}\\A_{31}&A_{32}&A_{33}&A_{44}\end{matrix}}\right]\left[{\begin{matrix}{\frac {1}{2}}V_{\infty }y_{1}\\{\frac {1}{2}}V_{\infty }y_{2}\\{\frac {1}{2}}V_{\infty }y_{3}\\{\frac {1}{2}}V_{\infty }y_{4}\end{matrix}}\right]$