numerical method

profilefcb6-2
3_instructions_spr_2015.pdf

CE 3173 Numerical Methods Dr. Joseph, Spring 2015 HW #3 Due Wednesday, February 4

#1. The position y (in feet) of an object varies with time t (in seconds). The velocity and initial position are given by

𝑦′ = 3𝑡2 + 1; 𝑦(0) = 1 a. Analytically determine the positon as a function of time.

b. On an Excel spreadsheet, apply the Euler method and a step size of ∆𝑡 = 0.1 to estimate y through t = 2.0 seconds. Use a column format similar to that used in #7c of HW#2. The estimate of y should be displayed not only for t = 2.0 seconds, but also for the beginning of each time step.

c. Add an additional column to the Excel table created in #1b for estimates of y using the Taylor series through the second derivative.

d. Add an additional column to the Excel table created in #1b and #1c for values of y obtained analytically.

e. Are the values from part c more accurate than the values in part b, or vice versa? How can you tell? And what causes one column to be more accurate than the other?

#2. Write VBA code to solve the ODE of #1 using the Euler method. The main function “Euler_hw3” is to call on a secondary function named “first_der” that calculates the first derivative. Report only the value at t = 2.0 seconds to the Excel spreadsheet. The first lines of the main function and the secondary function, respectively, are to be

Function Euler_hw3(h, y_o, x_o, x_f) Function first_der(t) where h is the step size, y_o is the intial value of the response variable, x_o is the initial value of the independent variable, and x_f is the final value of the independent variable.

#3. Write VBA code to solve the ODE of #1 using the Taylor series through the second derivative. The main function “Taylor_2” is to call on a two secondary functions named “first_der” and “second_der” that calculates the first and second derivatives. Report only the value at t = 2.0 seconds to the Excel spreadsheet. The first lines of the main function and the secondary functions, respectively, are to be

Function Taylor_2(h, y_o, x_o, x_f) Function first_der(t) Function second_der(t)