You are on page 1of 4

DEPARTMENT OF MECHATRONICS ENGINEERING

UNIVERSITY OF ENGINEERING & TECHNOLOGY, PESHAWAR

MtE 350L Numerical Method


Student Name: Mian Sayaf Ali Shah Reg. No: 18PWMCT0612

Lab Tittle: Initial value problem by Euler method

Lab No: 11

LAB REPORT RUBRICS:


Excellent (4) Proficient (3) Basic (2) Below Basic
Student’s
Criteria (1)
Score

Report is mostly Report is


Report is as per
as per the disorganized
the guidelines. Sections/Steps
To organize the lab guidelines and and follows
All are not ordered
report and practice most some guidelines
sections/steps are and Report is
the writing skills as sections/steps are but most of the
clearly organized not as per the
per the guidelines ordered well but guidelines are
in a logical guidelines
requires minor missing
order.
improvements.
The report
completely
The report
discusses the The report is
The report discusses the lab
To discuss the actual required task in totally
discusses the work but have
task own words with irrelevant to
required task irrelevant
some relevant the lab work
information
additional
information
Calculations and
Calculations and Most data and
data analysis were
data analyses observations
performed
were were recorded Calculations
To perform accurately, but
performed adequately, but and data
calculations and minor errors were
clearly, with several analyses of lab
data analysis made both in
concisely, and significant were missing
calculations and
accurately, with errors or
in applying
correct units. omissions.
correct units
Graphs, if
necessary, were Graphs, if Major
To present results Graphs, if
drawn accurately necessary, were components of
in the form of necessary, were
and neatly and drawn but lab were
graphs drawn adequately
were clearly inadequately. missing
labelled.
Numerical Methods
Lab Report # 11

Initial value problem by Euler method

Submitted by: Mian Sayaf Ali Shah(18PWMCT0612)

Submitted to: Dr. Shahzad Anwar

Section: A

Submission Date (February 11, 2021)

DEPARTMENT OF MECHATRONICS ENGINEERING


University of Engineering and Technology, Peshawar, Pakistan
Objective:
 To know about the Euler method and Euler modified method.
 To write the code for determining solution of initial value problem by Euler method.
 To know about importance of Euler and Euler modified method.

Software:
 MATLAB

Theory:
Initial Value Problems:
An initial value problem consists of
1. A first-order differential equation y =f (x, y), and
2. An initial condition of the form y(a) =b.
Euler Method:
Euler’s Method, is just another technique used to analyze a Differential Equation, which uses
the idea of local linearity or linear approximation, where we use small tangent lines over a
short distance to approximate the solution to an initial-value problem
Yn+1 =Yn+h*f(xn,yn)
Where xn=x0+n*h

Post Lab Tasks:


Write down MATLAB code for Euler ODE to solve given problem

dy/dt+20y=7e-0.5t;
y(0)=5
MATLAB Code
f = input ('Enter your function:');
t0 = input ('Enter initial value of independent variable:');
y0 = input ('Enter initial value of dependent variable:');
h = input ('Enter step size:');
tn = input ('Enter point at which you want to find the solution:');
n = (tn - t0)/h %No. of iterations
t(1) = t0;
y(1) = y0;
for i = 1:n
y(i+1) = y(i) + h*f(t(i),y(i));
t(i+1) = t0 +i*h;
fprintf ('y(%.2f) = %.4f\n',t(i+1),y(i+1));
end
Results:

Figure 1 Result of Task 1

Conclusion:
After performing this lab, we come to know about the computations in MATLAB and basic
operations that we did on initial value problems in MATLAB. We write the code for Euler
method to determine the solution of ODE and initial value problem.

You might also like