%% This document created by Scientific Notebook (R) Version 3.0


\documentclass[12pt,thmsa]{article}
\usepackage{amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{makeidx}
\usepackage{sw20jart}

%TCIDATA{TCIstyle=article/art4.lat,jart,sw20jart}

%TCIDATA{<META NAME="ViewSettings" CONTENT="31">}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="Title" CONTENT="Numerical Methods">}
%TCIDATA{Created=Mon Aug 19 14:52:24 1996}
%TCIDATA{LastRevised=Thu Feb 13 16:45:14 1997}
%TCIDATA{Language=American English}
%TCIDATA{CSTFile=MathHelp.cst}
%TCIDATA{<LINK REL="author" HREF="DM0-1.tex">}
%TCIDATA{<LINK REL="first" HREF="DM10-1.tex">}
%TCIDATA{<LINK REL="contents" HREF="DM0-0.tex">}
%TCIDATA{<LINK REL="copyright" HREF="DM0-2.tex">}
%TCIDATA{<LINK REL="end" HREF="DM10-5.tex">}
%TCIDATA{<LINK REL="index" HREF="DMIndex.tex">}
%TCIDATA{<LINK REL="next" HREF="DM10-4.tex">}
%TCIDATA{<LINK REL="parent" HREF="DM10.tex">}
%TCIDATA{<LINK REL="previous" HREF="DM10-2.tex">}
%TCIDATA{<LINK REL="top" HREF="DM0-0.tex">}
%TCIDATA{MapleDefs=
%$g \left( i\right) =0.1i $
%}


\input{tcilatex}
\begin{document}


\section{Numerical Methods 
\index{Solve ODE@Solve ODE!numeric@numeric}\label{Solve ODE, numeric}}

\label{Runge-Kutta}\textsl{Scientific Notebook} also solves appropriate
systems numerically. These numeric solutions are functions that can be
evaluated at points or plotted. The method implemented by Maple for
numerical solutions is a Fehlberg fourth-fifth order Runge-Kutta method.

\subsection{\ Initial-Value Problems\label{Initial value problems}}

\begin{quote}
$\blacktriangleright $ To solve an initial-value problem numerically \label%
{ODE, solve numeric}\label{Numerical methods for ODEs}
\end{quote}

\begin{enumerate}
\item[1.]  Start with a column matrix and enter an initial-value problem,
such as 
\begin{eqnarray*}
y^{\prime }+y &=&0 \\
\;\,y(0) &=&1
\end{eqnarray*}
$\,$with one equation per row.

\item[2.]  From the \textsf{Solve ODE} submenu, choose \textsf{Numeric}%
.\medskip 
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Solve ODE + Numeric}
\end{quote}

\begin{quotation}
$
\begin{array}{r}
y^{\prime }+y=0 \\ 
y(0)=1
\end{array}
$, Functions defined: $y$
\end{quotation}

This calculation defines a function $y$ that can be evaluated at given
arguments. You can use the function to generate a table of values, and as
you will see in the next section, the function can be plotted.\medskip

\begin{quote}
$\blacktriangleright $ Evaluate
\end{quote}

\begin{quotation}
$y\left( 1\right) =\allowbreak .\,\allowbreak 367\,88$

$y\left( 10.7\right) =\allowbreak 2.\,\allowbreak 254\,3\times 10^{-5}$%
\medskip
\end{quotation}

\begin{quote}
$\blacktriangleright $ To generate a table of function values 
\index{Table of values@Table of values}for a function $y$
\end{quote}

\begin{enumerate}
\item[1.]  Define a function $g(i)=0.1i$.

\item[2.]  From the \textsf{Matrix} submenu, choose \textsf{Fill Matrix}.

\item[3.]  In the dialog box, select 10 rows and 1 column.

\item[4.]  Select \textsf{Defined by function} and enter the function name $g
$ to create a column of numbers between 0 and 1.

\item[5.]  Select the column and enclose it with brackets.

\item[6.]  Place $y$ at the left edge of the column.

\item[7.]  Choose \textsf{Evaluate.} 
\[
y\left[ 
\begin{array}{c}
.1 \\ 
.2 \\ 
.3 \\ 
.4 \\ 
.5 \\ 
.6 \\ 
.7 \\ 
.8 \\ 
.9 \\ 
1.0
\end{array}
\right] =\,\left[ 
\begin{array}{c}
.90484 \\ 
.81873 \\ 
.74082 \\ 
.67032 \\ 
.60653 \\ 
.54881 \\ 
.49659 \\ 
.44933 \\ 
.40657 \\ 
.36788
\end{array}
\right] 
\]
\end{enumerate}

This calculation generates a list of function values for $y$ as $x$ varies
from $0.1$ to $1$. As a check, solve the initial-value problem
exactly.\medskip

\begin{quote}
$\blacktriangleright $ \textsf{Solve ODE + Exact}
\end{quote}

\begin{quotation}
$
\begin{array}{r}
y^{\prime }+y=0 \\ 
y(0)=1
\end{array}
$, (Specify $t$), Exact solution is: $y\left( t\right) =e^{-t}\medskip $
\end{quotation}

Compute the function values for $y\left( t\right) =e^{-t}$ for the same
arguments as before. You will find that they agree exactly, at least to the
indicated precision. 
\[
y\left[ 
\begin{array}{c}
.1 \\ 
.2 \\ 
.3 \\ 
.4 \\ 
.5
\end{array}
\right] =\,\left[ 
\begin{array}{c}
.90484 \\ 
.81873 \\ 
.74082 \\ 
.67032 \\ 
.60653
\end{array}
\right] 
\]

\strut

\subsection{\ \label{ODE, graphical solutions}Graphical Solutions to
Initial-Value Problems\label{Plot 2D, ODE}}

Numerical solutions can be plotted. To view the solution to the
initial-value problem $y^{\prime }=\sin xy$, $y(0)=3$, enter the two
equations into a $2\times 1$ matrix, and choose \textsf{Numeric} from the 
\textsf{Solve ODE} submenu.

\begin{quote}
$\blacktriangleright $ \textsf{Solve ODE + Numeric}
\end{quote}

\begin{quotation}
$
\begin{array}{r}
y^{\prime }=\sin xy \\ 
y(0)=3
\end{array}
$, Functions defined: $y$
\end{quotation}

Now plot $y$ by choosing \textsf{Rectangular} from 
\index{Plot 2D@Plot 2D!ODE@ODE}the \textsf{Plot 2D} submenu.\medskip For the
plot below, on the \textsf{Plot Components} page of the \textsf{Plot
Properties} dialog, change \textsf{Domain Interval} to $0<x<5$ and set 
\textsf{Line Color} to \textsf{Red}.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$y$
\end{quotation}

\FRAME{dtbpF}{3.0277in}{2.028in}{0pt}{}{}{odenum1.wmf}{\special{language
"Scientific Word";type "GRAPHIC";display "PICT";valid_file "F";width
3.0277in;height 2.028in;depth 0pt;original-width 216.8125pt;original-height
144.5625pt;cropleft "0";croptop "1";cropright "1";cropbottom "0";filename
'Odenum1.wmf';file-properties "XNPEU";}}

\subsection{\ \label{Solve ODE (2)}Numerical Solutions to Systems of
Differential Equations}

You can solve the following system numerically by entering the equations
into a $6\times 1$ matrix and choosing \textsf{Numeric} from 
\index{Solve ODE@Solve ODE!numeric@numeric}the \textsf{Solve ODE} submenu.
Three functions $x$, $y$, and $z$ are returned as output.\medskip

\begin{quote}
$\blacktriangleright $ \textsf{Solve ODE + Numeric}
\end{quote}

\begin{quotation}
$
\begin{array}{r}
x^{\prime }=x+y-z \\ 
y^{\prime }=-x+y+z \\ 
z^{\prime }=-x-y+z \\ 
x(0)=1 \\ 
y(0)=1 \\ 
z(0)=1
\end{array}
$, Functions defined: $x,y,z\medskip $
\end{quotation}

The following table lists values of $x$, $y$, and $z$ as the independent
variable $t$ varies from 0 to 1.

\begin{center}
$
\begin{array}{rrrr}
t & x & y & z \\ 
0 & 1.0000 & 1.0000 & 1.0000 \\ 
.1 & 1.1158 & 1.0938 & .8842 \\ 
.2 & 1.2668 & 1.1695 & .7332 \\ 
.3 & 1.4582 & 1.2173 & .5418 \\ 
.4 & 1.6953 & 1.2253 & .3047 \\ 
.5 & 1.9830 & 1.1791 & .0170 \\ 
.6 & 2.3256 & 1.0619 & -.3256 \\ 
.7 & 2.7265 & .8542 & -.7265 \\ 
.8 & 3.1873 & .5344 & -1.1873 \\ 
.9 & 3.7077 & .0777 & -1.7077 \\ 
1.0 & 4.2842 & -.5424 & -2.2842
\end{array}
\medskip $
\end{center}

You can create a matrix with these values as follows.

\begin{enumerate}
\item[1.]  Apply \textsf{Evaluate} to $x\left[ 
\begin{array}{r}
0.0 \\ 
.1 \\ 
.2 \\ 
.3 \\ 
.4 \\ 
.5 \\ 
.6 \\ 
.7 \\ 
.8 \\ 
.9 \\ 
1.0
\end{array}
\right] $ to get $x\left[ 
\begin{array}{r}
0.0 \\ 
.1 \\ 
.2 \\ 
.3 \\ 
.4 \\ 
.5 \\ 
.6 \\ 
.7 \\ 
.8 \\ 
.9 \\ 
1.0
\end{array}
\right] =\left[ 
\begin{array}{l}
1.0 \\ 
1.1158 \\ 
1.2668 \\ 
1.4582 \\ 
1.6953 \\ 
1.983 \\ 
2.3256 \\ 
2.7265 \\ 
3.1873 \\ 
3.7077 \\ 
4.2843
\end{array}
\right] $

\item[2.]  Similarly, apply \textsf{Evaluate} to get the $y$ and $z$ columns.

\item[3.]  To create a matrix with all four columns, place the $\mathbf{t}$, 
$\mathbf{x}$, $\mathbf{y}$, and $\mathbf{z}$ columns next to one another,
and from the \textsf{Matrices} submenu choose \textsf{Concatenate.}

\item[4.]  To add a row at the top for labels, select the matrix and choose 
\textsf{Edit + Insert Rows}. (You must select only the matrix, not including
brackets, to have \textsf{Insert Rows} appear on the \textsf{Edit} menu.)

\item  To line up entries, select a column, choose \textsf{Edit + Properties}%
, and change \textsf{Column Alignment} to \textsf{Aligned Left} or \textsf{%
Aligned Right}.
\end{enumerate}

You can also take advantage of the fact that you are using a word processor
to put the values into a 12 by 4 table. You can then revise the table to add
lines.\medskip

\subsection{\ Graphical Solutions to Systems of ODEs\label%
{ODE, graphical solutions (2)}}

The functions $x$, $y$, and $z$ returned previously as output can be
plotted. 
\index{Plot 2D@Plot 2D!ODE@ODE}\medskip

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Rectangular}
\end{quote}

\begin{quotation}
$x$
\end{quotation}

In the dialog box,

\begin{enumerate}
\item[1.]  Note that $x$ appears as \textsf{Item number} 1.

\item[2.]  Change the \textsf{Domain Interval} to 0 to 5.

\item[3.]  Click \textsf{Add Item}.

\item[4.]  Type $y$ as \textsf{Item Number} 2. Change \textsf{Line Color} to 
\textsf{Red}.

\item[5.]  Click \textsf{Add Item.}

\item[6.]  Type $z$ as \textsf{Item Number} 3. Change \textsf{Line Color} to 
\textsf{Green}.

\item[7.]  Click \textsf{OK}.
\end{enumerate}

\FRAME{dtbpF}{3.0225in}{2.0228in}{0pt}{}{}{odenum2.wmf}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"PICT";valid_file "F";width 3.0225in;height 2.0228in;depth
0pt;original-width 216.8125pt;original-height 144.5625pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'Odenum2.wmf';file-properties "XNPEU";}}

Note that the numeric output for $t$ between $0$ and $1$ does not predict
long-range behavior. This system of differential equations describes a
highly unstable system.\medskip

You can also plot these functions with \textsf{Plot 2D + ODE}.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + ODE}
\end{quote}

\begin{quotation}
$x,y,z$
\end{quotation}

\FRAME{dtbpF}{3.0441in}{2.0384in}{0pt}{}{}{plotode3.wmf}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"PICT";valid_file "F";width 3.0441in;height 2.0384in;depth
0pt;original-width 216.8125pt;original-height 144.5625pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'Plotode3.wmf';file-properties "XNPEU";}}

\subsection{\ Phase Plane\label{Phase plane}}

If two functions are returned by \textsf{Solve ODE,} then a phase plane can
be plotted. The phase plane is the curve defined parametrically by the two
functions.

\begin{quote}
\index{Phase plane@Phase plane}$\blacktriangleright $ \textsf{Solve ODE +
Numeric}
\end{quote}

\begin{quotation}
$
\begin{array}{l}
\text{\quad }x^{\prime }=y \\ 
\text{\quad }y^{\prime }=-x \\ 
x(0)=0 \\ 
y(0)=1
\end{array}
$, Functions defined: $x,y$
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Plot 2D + Phase Plane}
\end{quote}

\begin{quotation}
$x,y$
\end{quotation}

\begin{enumerate}
\item  On the \textsf{Plot Components} page of the \textsf{Plot Properties}
dialog, set the \textsf{Domain Interval} from $-3.15$ to $3.15$.

\item  For the second view, on the \textsf{Axes} page of the \textsf{Plot
Properties} dialog, check \textsf{Equal Scaling on Each Axis}.\medskip
\end{enumerate}

\begin{center}
\FRAME{itbpF}{2.5771in}{1.727in}{0in}{}{}{phase3.wmf}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"PICT";valid_file "F";width 2.5771in;height 1.727in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'phase3.wmf';file-properties "XNPEU";}} \FRAME{%
itbpF}{2.5771in}{1.727in}{0in}{}{}{phase4.wmf}{\special{language "Scientific
Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display "PICT";valid_file
"F";width 2.5771in;height 1.727in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'phase4.wmf';file-properties "XNPEU";}}
\end{center}

\strut

\subsection{\ \protect\vspace{1pt}Bessel Functions\label{Bessel functions}}

The Bessel functions are rather complicated oscillatory functions with many
interesting properties. The functions $I_{v}(z)$ and $K_{v}(z)$ are
solutions of the first and second kind, respectively, to the modified Bessel
equation 
\[
z^{2}\frac{d^{2}w}{dz^{2}}+z\frac{dw}{dz}-\left( z^{2}+v^{2}\right) w=0 
\]
and the functions $J_{v}(z)$ and $Y_{v}(z)$ are solutions of the first and
second kind, respectively, to the Bessel equation 
\[
z^{2}\frac{d^{2}w}{dz^{2}}+z\frac{dw}{dz}+\left( z^{2}-v^{2}\right) w=0 
\]
Following are plots of these functions.

\begin{center}
\FRAME{itbpFU}{3.0441in}{2.0384in}{0in}{\Qcb{$I_{v}(z)$}}{}{besseli.wmf}{%
\special{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 3.0441in;height 2.0384in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'BesselI.wmf';file-properties "XNPEU";}}\ \FRAME{%
itbpFU}{3.0441in}{2.0384in}{0in}{\Qcb{$K_{v}(z)$}}{}{besselk.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 3.0441in;height 2.0384in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'BesselK.wmf';file-properties "XNPEU";}}

\FRAME{itbpFU}{3.0441in}{2.0384in}{0in}{\Qcb{$J_{v}(z)$}}{}{besselj.wmf}{%
\special{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 3.0441in;height 2.0384in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'BesselJ.wmf';file-properties "XNPEU";}}\ \FRAME{%
itbpFU}{3.0441in}{2.0384in}{0in}{\Qcb{$Y_{v}(z)$}}{}{bessely.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 3.0441in;height 2.0384in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'BesselY.wmf';file-properties "XNPEU";}}
\end{center}

\strut

\subsection{\protect\vspace{1pt}\ Related topics}

\begin{itemize}
\item  \hyperref{Ordinary Differential Equations}{}{}{%
DM10-1.tex#Differential equation}

\item  \hyperref{Systems of Ordinary Differential Equations}{}{}{%
DM10-2.tex#Exact solutions}

\item  \hyperref{Partial Differential Equations}{}{}{DM10-4.tex#PDE}

\item  \hyperref{Two Dimensional Plots of Functions and Expressions}{}{}{%
DM6-4.tex#Plot expression}

\item  \hyperref{Exercises and Solutions}{}{}{DM10-5.tex#Exercises}
\end{itemize}

\rule{0.67in}{0.01in}

\hyperref{\FRAME{itbpF}{0.5275in}{0.3399in}{0.0519in}{}{}{index.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 0.5275in;height 0.3399in;depth 0.0519in;original-width
36.875pt;original-height 22.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'index.wmf';file-properties "XNPEU";}}}{}{}{%
DMIndex.tex#Math Index}\quad {\small Index entries: \hyperref{Bessel
functions}{}{}{DMIndex.tex#Bessel functions}, \hyperref{Differential
equations}{}{}{DMIndex.tex#Differential equations}, \hyperref{Plotting 2D}{}{%
}{DMIndex.tex#Plotting 2D}, \hyperref{Solve ODE}{}{}{DMIndex.tex#Solve ODE}, 
\hyperref{Table of values}{}{}{DMIndex.tex#Table of values}}

\end{document}
