Question: % Numerical Integration . . clear clc % xl is the lower bound, % xu is the upper bound, % and wid is the interval

% Numerical Integration ..
clear
clc
% xl is the lower bound,
% xu is the upper bound,
% and wid is the interval width
xl=0.2;
xu=10;
wid=1;
k=0;
I=0; % the integral needs to be initialized
for ii=xl:wid:xu-wid
k=k+1;
AI=((1/ii)+4*(1/(ii+wid/2))+(1/(ii+wid)))/6*wid;
I=I+AI
pp(k)=I;
end
plot(pp)
grid
% USe different fuctions
% Covert this to a function ..
% function [I,err]=int1x(xl,xu,wid)
% End ..
- Do the Numerical Differentiation and Numerical Integration for the same example (The given
function) by hand. Show your steps.
- Do Numerical Differentiation and Numerical Integration for the same example (The given
function) by computing coding (I prefer python). Show your steps.
- Explain the hand and code algorithms, and elaborate on the difficulties.
- Compare the two results.
 % Numerical Integration .. clear clc % xl is the lower

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!