Lab3 - Lab 3 Higher-Order Numerical Methods Goals In this...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 3: Higher-Order Numerical Methods Goals In this lab you will compare the order of accuracy of various numerical methods; that is, you will test-drive some new solvers. You will implement an improved Euler’s method and a fourth-order Runge-Kutta method, in addition to your Euler’s method program from Lab 2. The example from Lab 2 of an RC circuit with AC voltage provides a case-study for comparing these three methods. Prelab assignment Before arriving in the lab, answer the following questions. You will need your answers in lab to work the problems, and your recitation instructor may check that you have brought them. These problems are to be handed in as part of your lab report. Consider the initial-value problem Q 0 ( t ) = - 1 2 Q ( t ) + 5 , Q (0) = 2 . (1) 1. Solve this problem for Q ( t ) by noting that the differential equation is separable. 2. Table 1 below shows the resulting values from N steps of some numerical method to approximate Q ( t ) over the interval 0 t 2. Copy the table and fill in the exact values using your solution. 3. Calculate the errors and write them in Table 1. Note that error means | approximate - exact | . Also copy Table 2 and fill in the errors (only for t = 2). 4. The step size h is obtained by dividing the interval over which the solution is computed into N equal parts. Calculate the step sizes h for the three rows in Table 2. 5. Plug in the values from Table 2 into the following equations, E 1 = Ch α 1 and E 2 = Ch α 2 and solve them for the exponent α . Hint: taking logarithms makes the equations easier to solve. 6. Repeat the computations of question 5 using the values h 2 , h 3 and E 2 , E 3 instead of h 1 , h 2 and E 1 , E 2 . The value of α you obtain should be close to that obtained in question 5; you are repeating the computation as a check on your previous calculation. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7. Based on your answers to questions 5 and 6 which numerical method do you think was used? (Refer to sections 2.5 and 2.6 of the textbook.) t Approximate Q Exact Q Error N = 10 1 . 0 5 . 143393877 2 . 0 7 . 051672121 N = 60 1 . 0 5 . 147640987 2 . 0 7 . 056826501 N = 360 1 . 0 5 . 147751596 2 . 0 7 . 056960678 Table 1: Approximate Solution to the initial-value problem (1) N h Error 10 h 1 = E 1 = 60 h 2 = E 2 = 360 h 3 = E 3 = Table 2: Errors for t = 2 2
Background image of page 2
In the lab In this lab we will see how higher-order numerical methods can be implemented in Matlab as easily as Euler’s method was implemented in Lab 2. We are still concerned with the general initial-value problem dy dt = f ( t, y ) , y ( a ) = y 0 . (2)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course MATH 216 taught by Professor Stenstones? during the Fall '07 term at University of Michigan.

Page1 / 8

Lab3 - Lab 3 Higher-Order Numerical Methods Goals In this...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online