Teopengco - CE50P-2 Week 11 Laboratory Activity Numerical Sol of ODE

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Name Score

Teopengco, Alec John M.

Course/Section: CE50p-2/E01 Date: October, 28, 2022

CE50P-2
Week 11 Laboratory Activity
Numerical Methods for Solving ODE

1. Consider the ODE


𝑦𝑦 ln 𝑦𝑦 𝑑𝑑𝑑𝑑 − 𝑥𝑥𝑥𝑥𝑥𝑥 = 0
With initial condition: 𝑦𝑦(2) = 𝑒𝑒

a. Determine the general solution using appropriate analytical process.


b. Find the particular solution using the given initial condition.

c. Using Euler method, approximate the solution at 𝑥𝑥 = 3.0 using a step size ℎ = 0.1

𝑦𝑦 ≈? ? ?

d. What is the relative absolute error at 𝑥𝑥 = 3.0 using a step size ℎ = 0.1?

%𝐸𝐸𝐸𝐸𝐸𝐸𝑎𝑎𝑎𝑎𝑎𝑎 =? ? ?
e. Repeat (c) and (d) using a step size ℎ = 0.05.

f. Repeat (c) and (d) using a step size ℎ = 0.025.


g. What can you conclude from the results in (d), (e) and (f)?

More accuracy can be achieved by lowering or reducing the value of the step-size.

2. Consider the ODE


2 3
𝑦𝑦 ′ + 𝑦𝑦 = 3 + 1
𝑥𝑥 𝑥𝑥

With the initial condition that y=1 when x = 1.

1
a. Show that the particular solution is 𝑦𝑦 = (ln 𝑥𝑥 9 + 𝑥𝑥 3 + 2).
3𝑥𝑥 2
b. Use the 2nd, 3rd and 4th Runge-Kutta methods to approximate the value of y at x = 2 using a step
size of ℎ = 0.1. Complete the table below.

RK Method Step size Approx. value of y Abs. Err. Rel. Abs. Err. (%)

RK-2 0.1 1.34949 0.0370 0.0273

RK-3 0.1 1.35334 0.00015 0.0100

RK-4 0.1 1.3532 0.000 0.0004

Show details of computation below (or paste a screenshot of Excel computation).

You might also like