0% found this document useful (0 votes)
29 views3 pages

Lab 10. Differential Equations: Name: 1 Instructions

This document provides instructions for Lab 10 on numerical methods for solving differential equations. Students are asked to solve problems using Euler's method, Heun's method, and the fourth-order Runge-Kutta method. They must write a report in PDF format explaining their solutions and include any MATLAB code. The purposes of the lab are to understand and apply numerical methods for solving differential equations and to implement some of these methods in MATLAB. Students must answer conceptual questions about the methods and use them to solve sample differential equations with initial values. They are also asked to create MATLAB functions implementing Euler's method, Heun's method, and RK4 and demonstrate them by solving problems from the lab instructions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Lab 10. Differential Equations: Name: 1 Instructions

This document provides instructions for Lab 10 on numerical methods for solving differential equations. Students are asked to solve problems using Euler's method, Heun's method, and the fourth-order Runge-Kutta method. They must write a report in PDF format explaining their solutions and include any MATLAB code. The purposes of the lab are to understand and apply numerical methods for solving differential equations and to implement some of these methods in MATLAB. Students must answer conceptual questions about the methods and use them to solve sample differential equations with initial values. They are also asked to create MATLAB functions implementing Euler's method, Heun's method, and RK4 and demonstrate them by solving problems from the lab instructions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Universidad Industrial de Santander, Colombia

Numerical Analysis, 2020-2


Henry Arguello
February 24, 2021

Lab 10. Differential Equations

Name:

1 Instructions
ˆ Make a pdf report including the solution to each point of the practice with name
Lab10 name lastname.pdf.
ˆ Send the report and all created files in a rar or zip file with name Lab10 name lastname.rar
in the Moodle.
ˆ You are allowed to use internet, notes, and .m files that you have created before.

2 Purposes
ˆ To understand some numerical methods for solving differential equations.

ˆ To apply some numerical methods for solving differential equations.

ˆ To implement some numerical methods for solving differential equations in Matlab.

3 Practice
3.1 Understanding
Answer with your own words the following questions:
ˆ (0.2 points) How to solve a differential equation with initial value by using Euler’s method?

ˆ (0.2 points) How to solve a differential equation with initial value by using Heun’s method?

1
ˆ (0.2 points) How to solve a differential equation with initial value by using forth-order Runge-
Kutta method?

ˆ (0.2 points) What applications do the differential equations have?

3.2 Applying
ˆ (1.2 points) Solve the differential equation using the forth-order Runge-Kutta method (RK4).

y 0 = e−2t − 2y (1)
1 −2t
with y(0) = 1
10 , y(t) = 10 e + te−2t .

– Take h = 0.2 and take two steps calculating the values. Then, take h = 0.1 and take four
steps calculating the values.
– Compare the exact solution y(0.4) with the two approximations calculated in the previous
point.
– Does the final global error of the approximations obtained in the previous points behave,
as expected when h is divided between two?

ˆ (1.2 points) Let M (t) be the amount of a product that decreases with time t and the rate of
decrease is proportional to the amount M .
– Determine a differential equation that models the phenomena.
– Solve the differential equation to determine the amount of material at time t = 1. Use
the Euler method with a step of h = 0.2. Consider that M (0) = 300.
– Solve the differential equation to determine the amount of material at time t = 1. Use
the Heun method with a step of h = 0.2. Consider that M (0) = 300.

2
3.3 Implementing
ˆ (0.6 points) Create a Matlab function called my euler function name lastname() using Euler’s
method to approximate the solution of the initial value y 0 = f (t, y) with y(a) = y0 over [a, b]
for k = 0, 1, · · · , M − 1. Make a script called run 3a name lastname.m in which you use the
created function to solve the exercise in 3.2. For instance,
fun = @ XXXXXX;
a = XX;
b = XX;
y0 = XX;
M = X;
E=my euler function name lastname(fun,a,b,y0 ,M );

ˆ (0.6 points) Create a Matlab function called my heun function name lastname() using Heun’s
method to approximate the solution of the initial value y 0 = f (t, y) with y(a) = y0 over [a, b]
for k = 0, 1, · · · , M − 1. Make a script called run 3b name lastname.m in which you use the
created function to solve the exercise in 3.2. For instance,
fun = @ XXXXXX;
a = XX;
b = XX;
y0 = XX;
M = X;
H=my heun function name lastname(fun,a,b,y0 ,M );

ˆ (0.6 points) Create a Matlab function called my RK4 function name lastname() using RK4
method to approximate the solution of the initial value y 0 = f (t, y) with y(a) = y0 over [a, b]
by using the formula yk+1 = yk + h6 (k1 + 2k2 + 2k3 + k4 ) for k = 0, 1, · · · , M − 1. Make a
script called run 3c name lastname.m in which you use the created function to solve the
exercise in 3.2. For instance,
fun = @ XXXXXX;
a = XX;
b = XX;
y0 = XX;
M = X;
R=my Rk4 function name lastname(fun,a,b,y0 ,M );

You might also like