Log in using OpenID

Project 2
Project II
Automatic Initial Value ODE Packages
You should submit this project by 10am, Thursday -- 11 December 2014
A digitally signed Email submission of a single document document (one file!) is preferred!
There is a 24 side A4 size limit! The project must include a pledge that it is all your own work.
The goal of this project is to determine the efficiency and accuracy of an automatic initial value ODE
integration package such as Maple’s dsolve(,,numeric). You may use a Mathematica or
MATLAB equivalent, a package from NAGLIB or one suitable from some other software library
such as GSL, NAG, IMSL or This will be used to redo the problems defined in Project I.
Tasks: Practical:
Part A {Amend as appropriate for whatever automatic IVODE package you are using!}
1. Read all of the on-line Help for dsolve,numeric. What are the various method that can be used
by this package to solve initial value ordinary differential equations? What are the user-tunable
parameters that to control the operation of this package? When and how should these be used?
2. Read the on-line Help information on Time and Date. Find the appropriate function to time how long
it takes you to find the solution to the required accuracy.
3. Solve a suitable model problem with a known analytical solution. Determine the variation in the true
accuracy of the method as the various user-controlled parameters are set. How does the execution
time vary as user specified accuracy is increased? How reliable is the user error control?
4. How are step sizes chosen? How do they change as the calculation progresses? Can you tell what
criteria are used to reject a step if it is not accurate enough?
[Hint: The procedure that defines F(x,Y(x)) can write x & Y to a file for later processing!]
5. Discuss a comparison of the efficiency of this automatic package with the hand coded method you
used for project I. Comment on the quality of the available documentation and examples.
6. Explain what determines the accuracy of your results for each of the problems you solve?
Part B – Describe the solution to the two ODEs set out in Project #1:
i. Find the best values of C, D and z0 for the asymptotic fit to the solution for large z for
the Blasius differential equation when ”(0)=1 if
 C ( z  z0 ) 
 C 2 ( z  z0 )2 /2 
 ( z )  C 2 ( z  z0 )  D  C 2  ( z  z0 ) erfc 
 / (2 C )
What are the values of C, D and z0 when ”(0) is chosen so that ’(z)  1 as z  .
Find the best values of A, xo and C for the lubrication problem (2e) in Project I.
You may assume: for x << 0
30 3 x 12895 4 x
590711 5 x 2314042201 6 x
h( x )  e x  e 2 x 
e 
e 
e  .....
and when x >> 0
h(x) 
( x  x0 ) 2  C
2 ( 2C  3)
3 A ( x  x0 )
15 A ( x  x 0 )
45 A ( x  x 0 ) 4
Dan Moore
Huxley 627
Project 2
You may include any further terms in either series you think will improve your results.
Determine the sensitivity of your values of A, x0 and C to each of the ‘tunable’ parameters within your
control such as xstart, xstop , user ODE accuracy, etc.
Discuss and compare the work necessary for doing this project with that done in Project 1. Compare and
discuss the accuracy achievable in each of the projects. Comment on the computer time taken by the
automatic package and your hand-coded method from Project #1. Comment on the ‘personal’ time taken.
Consider a family of Linear Multistep formulae which use the most accurate possible Predictors and
Correctors of the form:
Ypn 1  Y n  h im f ( xn 1  i h, Y n 1i ).
i 1
Ycn 1  Y n  h
i 0
i*m f ( xn 1  i h, Y n 1i ).
for solving systems of ordinary differential equations of the form
DY = f(x,Y) ,
given Y(x0) = Y0
a. Derive m step predictor formulae of maximum accuracy for m = 1, 2, 3, 4, 5 & 6
of the type Y n+1= Y n+ … . Derive the m step Corrector Formulae to accompany them.
b. Using a predictor of one step less than the corrector formula for each value of m as a PECE
pair, calculate the interval of stability on the real h axis of each pair for m = 2, 3, 4, 5 & 6
for DY = -Y. You may use Maple or some other Computer Algebra package.
Mastery Section: {Counts 5% bonus marks for M3N7}
1. Determine the shape of the region of stability of the first 6 Predictor-Corrector Pairs
you derived above in the complex h plane when used in PECE mode as described above.
(five Figures)
2. What is the shape of these regions when these pairs are used in PE(CE) mode?
3. If you solve D2Y = - Y, Y(0) =1, DY(0) = 0, what is the maximum stable step size for each of
the 5 PECE pairs derived above?
0,subject to the B.Cs
1, D(0)=0, for n = 0, ½, 1, 3/2, 2, ... 9/2.
You need to find the smallest value of r for which (r)= 0. Call this radius r0.
4. Solve the Lane-Emden Equation:
Print a table of r0 and What limits the attainable accuracy of your values of r0 for various values of n?
Dan Moore
Huxley 627
Пожаловаться на содержимое документа