Preface


This is a tutorial made solely for the purpose of education and it was designed for students taking Applied Math 0330. It is primarily for students who have very little experience or have never used Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in regular fonts. This means that you can copy and paste all comamnds into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts to your needs for learning how to use the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part III of the course APMA0330

Hamming Method


In 1959, Richard Wesley Hamming from Bell Telephone Laboratories, Murray Hill, New Jersey, proposed a stable predictor-corrector method for ordinary differential equations, which now bears his name. He improved classical Milne--Simpson method by replacing unstable corrector rule by a stable one.
Journal of the ACM, Volume 6, Issue 1, Jan. 1959, pages 37-47.

The Hamming multistep method is used to approximate solution of the initial vaue problem \( y' = f(x,y), \quad y(x_0 ) = y_0 \) over interval [a,b] (where usually x0 = a) by using the predictor
\[ p_{n+1} = y_{n-3} + \frac{4h}{3} \left( 2\,f_{n-2} - f_{n-1} + 2\,f_n \right) , \qquad n=3,4,\ldots . \]
and the corrector
\[ y_{n+1} = \frac{9\, y_n - y_{n-2}}{8} + \frac{3h}{8} \left( f_{n+1} - f_{n-1} + 2\,f_n \right) , \qquad n=3,4,\ldots . \]
As usual, we implement a unifom grid \( x_n = x_0 + n\,h , \) with step length h. Here yn is an approximation to the true value \( \phi (x_n ) \) of the actual solution \( y = \phi (x) . \)

Example. Let us start with the Riccati equation \( y' = x^2 + y^2 \) subject to the initial condition \( y(0) =-1 . \) Its solution is expressed through Bessel functions:

\[ d(x)\, y(x) = J_{-3/4} \left( \frac{x^2}{2} \right) \left( \Gamma^2 \left( \frac{3}{4} \right) + \pi \right) - Y_{-3/4} \left( \frac{x^2}{2} \right) \Gamma^2 \left( \frac{3}{4} \right) . \]
where the denominator
\[ d(x) = Y_{1/4} \left( \frac{x^2}{2} \right) \Gamma^2 \left( \frac{3}{4} \right) - J_{1/4} \left( \frac{x^2}{2} \right) \left( \Gamma^2 \left( \frac{3}{4} \right) +\pi \right) \]
has the first positive null at x = 2.223378383 as the figure shows
d[x_] = BesselY[1/4, x^2 /2]*Gamma[3/4]^2 - BesselJ[1/4, x^2 /2]*(Gamma[3/4]^2 + Pi)
Plot[d[x], {x, 0, 5.5}, PlotStyle -> Thick]
The sollution blows up near the point 2.223378.

 

 

Fixed Point Iteration

Bracketing Methods

Secant Methods

Euler's Methods

Heun Method

Runge-Kutta Methods

Runge-Kutta Methods of order 2

Runge-Kutta Methods of order 3

Runge-Kutta Methods of order 4

Polynomial Approximations

Error Estimates

Adomian Decomposition Method

Modified Decomposition Method

Multistep Methods

Multistep Methods of order 3

Multistep Methods of order 4

Milne Method

Hamming Method

 

Return to Mathematica page

Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)