MCS 471 Practice Problems 5: Numerical Solution of ODEs

Hand Calculator and Maple Calculations

Do NOT Hand In: Practice Problems ONLY!


Background Reading:

Practice Problems Topics:
CAUTION: These problems are just for practice and are not to be handed in. Some of these old exam problems and answers may not be relevant to your current course. Caveat Usor!


Practice Problems:

In following computational questions, use 4 Digit Exam Precision: Round to 4 significant decimal digits only when you record an intermediate or final answer in your exam booklet; and continue calculations with these rounded, recorded numbers.
  1. Estimate the maximum step size h for Euler's Method applied to the first order ODE
    y'(x) = f(x, y(x))
    
    needed to make the absolute value of the theoretical global discretization error less than tol = 0.45e-2, given the (x,y)-dependent bounds
    |y| < 0.5223,  |f(x,y)| < 0.5649,
    

    |fx(x,y)| < 0.1432|x||y|, |f_y(x,y)| < 0.04321|x|2,

    x on [-0.5710, +0.4710].



    (S99a)

  2. Using the 4th Order Runge-Kutta Method, numerically approximate the solution to the nonlinear IVP by
    y'(x) = 0.4710 y(x)(1 - 0.05444 y(x)/(1+x2)) ,  y(1) = 200 ,
    
    with h = 0.025 for two x-steps. Tabulate

      n   Xn   Yn   RK1   RK2   RK3   RK4   Xn+1   Yn+DeltaYn 
      0                         
      1                         

    for all values calculated.



    (S99a)

  3. Using the Algebraic BVP Method, numerically approximate the solution to the linear BVP,
    y''(x) + x y'(x) + 3 y(x) = -0.2 x2 , 
    

    y(1.25) = 2.5 & y(2.00) = 1.5 ,

    using finite central differencing of derivatives with h = 0.25. Tabulate

      n   0   1   2   3 
      Xn             
      Yn             

    In solving, use the Thomas tridiagonal elimination algorithm. Sketch your approximation Y_n in the $xy$-plane.



Old Practice Problems using Chopping:

In computational problems, use "EXAM PRECISION": Chop to 4 significant (4C) digits only when you write an intermediate or final answer down and continue calculations with those numbers recorded.

Caution: These old problems may have different answers due to different methods and chopping truncation used, so do not worry if your answers are a few least significant digits different.



    For problems in the Gerald and Wheatley text,

  1. Consider the initial value problem:
         Let h =.5 and t(i) = i*h for i = 1 TO n. Find Y(i) = Y(t(i)) using 4-digit exam precision with the following methods
         (here, F(i) = f(Y(i)):

      (a) Euler's with n=3 tabulating
                       t(i), Y(i), F(i);
        

      (b) 4TH order Runge-kutta with n=2, tabulating
                        Y(i), RK1, RK2, RK3, RK4
        
      where needed.
  2. Estimate the step size, h, needed to make the maximum global discretization error < 0.5e-3 of Euler's Method for t in (0,10) when

  3. Approximate the solution to the ODE: using Euler's Method for i = 0 to 6 stepping with h = 0.25. Tabulate your answers chopped to 4 significant digits with columns for

  4. Find a numerical approximation to the solution of the initial value problem: using a 4th order Runge-Kutta Method with h = 0.1 for t = 0 to 2*h. Tabulate at each step except the last, reporting only items needed. Use a modification of 4 digit precision.
  5. a) Suppose that and that the local chopping is bounded by 5.e-3, find the optimal step size h = 1/n for euler's method when 0 < t < 1. (Hint: Show that -1.5<(d/dt)f(y(t),t) < 0, y > 0, T > 0, getting a similar bound for f_y(y(t),t), and use this to estimate the Euler discretization error).


    b) For the ODE plus the IC in part a), illustrate Euler's Method with h = 0.1, tabulating

  6. Formulate an algorithm for a 4th order Runge-Kutta Method to numerically solve the initial value problem for autonomous systems of ordinary differential equations, where y(t) = [y(i,t)]_{NX1} and f(y(t)) = [f(i,y(t)]_{NX1} are vectors with N components. Illustrate your algorithm by solving the system with h = 0.1 for t = 0 to 1*h. Use a modified 4 digit precision.
  7. Solve the following IVP numerically: with h=0.1 and t(n)=n*h for n=1 to m using the following methods:
  8. Estimate the step size h needed to make the absolute value of the global theoretical discretization error on (0,3) less than 1.e-4 when
  9. Consider the BVP Apply the central difference BVP Method with h=1 to convert the BVP into a linear algebra problem with the proper numerical coefficients, but do not solve the matrix problem.
  10. Find a numerical approximation to the solution of using a 4th order Adams' (-Bashforth) Predictor-Corrector Method with a single derivative function evaluation following each "P" or "C" step, h = 0.25 for t=i*h and i = 1 to 5. Use just enough Euler steps to start the Adams' Method. Tabulate both y and f at both predictor and corrector steps.

  11. (Master's Exam Spring 1998, NA#11) Estimate the step size  h  for Euler's Method needed to make the absolute value of the theoretical global discretization error less that 0.25e-1, given the bounds
    |f(x,y)| < 1.387,
    |f_x(x,y)| < 0.6795*|x|,
    |f_y(x,y)| < 0.5432*|x|,
    
    on [-2.25,1.35].

    {Optional Hint: It is permissible to exponentially approximate  (1+h*c)^n  for some bounded constant  c , where  n  is the number of steps.}

    Use 4 digit exam precision: chop recorded intermediate results only to 4 significant decimal digits and continue calculations with these results.


    Answer: The theoretical global error is such that
    |E| < |(B'*h/(2*By))*[exp((x_n-x_0)*By)-1]| < tol,
    
    where tol=0.25e-1; and the bounds are given by
    By=0.5432*2.25=(4ch) 1.222; 
    
    Bx=0.6795*2.25=(4ch) 1.528;
    B=1.387;
    and where B'=Bx+B*By=3.222. Solving the error inequality for the best step size h yields
    h < tol*2*By/[B'*[exp(By*(1.35-(-2.25)))-1]]=(4ch) 0.2359e-3 (answer).
    
    {Note: The less than "<" symbol used in the HTML form of this problem should really be the less than or equal "<=" symbol.}


Web Source: http://www.math.uic.edu/~hanson/mcs471/pp5.html

Email Comments or Questions to hanson A T math uic edu

Click Here For Current Class HomePage