You are on page 1of 2

Adama Science and Technology University

School of Electrical Engineering and Computing


Department Of Electronics And Communication Engineering
Course Title: - Engineering Application Software

Course Number: -ECE2208

Section: - 1

Project

Prepared by
Name ID No.

1.Elias Beyene UGR/20525/12

2. Yididya Getachew UGR/19767/12

3. Theoplos Habtmu UGR/20088/12

4.Eba Derese UGR//19622/12

5.Abenezer Ayele UGR/19607/12

6.Nigussie Shalamo UGR/17540/12

Submitted to: Mr. Tewodros Endale Date of submission: Sep 6, 2021


4. What is the value of: ∫ ⁄ ? Use trapz or quad. Compute and display the
difference between your numerical answer and the analytical answer.

quad method
function y = fun(x) %This MATLAB function declares a function named fun.
y = x.*exp(-x/3); %This is the equation to be executed.
We insert the integral limits by Q = quad(@fun,0,5) .

trapz method
function T= funct(x,y)
n=length(x);
T=0;
for i=1:n-1
T=T+(y(i) + y(i+1))*(x(i+1) -x(i)); %Is used to calculate the
area.

end
T=T/2;
end
We insert and run x=(0:0.1:5), y = x.*exp(-x/3),funct(x,y)respectively.

For both we get the result 4.4660 when we use mathlab. When we do it using calculator we got
4.4671, and in trapz we have observed when we minimize the gap of points between x the
result becomes more precise. To show this we used x=(0:0.00001:5) and got the result 4.4670
which is closer to the one done by calculator.

You might also like