Menu

[r8864]: / trunk / py4science / workbook / bessel.tex  Maximize  Restore  History

Download this file

51 lines (32 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
\section{Bessel functions}
\label{sec:bessel}
\textbf{Illustrates}: Special functions library, array manipulations
to check recursion relation.
In this exercise, you will verify a few simple relations involving the Bessel
functions of the first kind. The important relations to keep in mind are the
asymptotic form of $J_n(x)$ for $x>>n$:
\begin{equation}
J_n(x) \approx \sqrt(\frac{2}{\pi x})\cos(x-(n\frac{\pi}{2}+\frac{\pi}{4}))
\end{equation}
%
and the recursion relation
\begin{equation}
J_{n+1}(x) = \frac{2n}{x} J_n(x)-J_{n-1}(x)
\end{equation}
\begin{figure}
\begin{centering}
\includegraphics[width=5in]{fig/bessel_functions}
\par
\end{centering}
\caption{\label{fig:bessel_functions}A few Bessel functions.}
\end{figure}
\begin{figure}
\begin{centering}
\includegraphics[width=5in]{fig/bessel_error}
\par
\end{centering}
\caption{\label{fig:bessel_error}Numerical error for $J_5$.}
\end{figure}
Once you get the code to run, you should see two figures like
Figure~\ref{fig:bessel_functions} and Figure~\ref{fig:bessel_error}.
\lstinputlisting[label={code:bessel},caption={IGNORED}]{problems/bessel.py}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.