Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use matlab program Please do not attempt if you cannot use Matlab program Numeri

ID: 2083007 • Letter: U

Question

Use matlab program Please do not attempt if you cannot use Matlab program Numerical methods only for experts I will give you negative review if you ask for more info. DO NOT ATTEMPT if you dont know MATLAB! Fully developed flow moving through a 40am dameter pipe has the following velooity profile r (om) 00 26 50 75 100 125 15.0 175 20.0 (m/s) 0.914 0800 0.87 0.705 0719 0.613 427 0204 0 problem using three different approaches 1. Use tapz function 2. Fita quadratic polynomial ourve to the veiooty data and then evaluate the integral using the analytical solution. 3 Use quad function to integrate the polymomial A r 0.01100, 25. 76 100 125, 160 176 200:

Explanation / Answer

1) enter the following code in matlab to get the integral using traps function

% Integral using trapz function

r=0.01*[0,2.5,5,7.5,10,12.5,15,17.5,20];

v=[0.914,0.890,0.847,0.795,0.719,0.543,0.427,0.204,0];

Q=2*pi*r.*v;

I=trapz(Q)

the answer is

I =

2.2855

2) for the polynomial fit method enter the following code in matlab

% Integral using polynomial fit and the integration

r=0.01*[0,2.5,5,7.5,10,12.5,15,17.5,20];

v=[0.914,0.890,0.847,0.795,0.719,0.543,0.427,0.204,0];

p4 = polyfit(r,v,3);

r1 = 0:0.025:0.2;

y2 = polyval(p4,r1);

Q=2*pi*r1.*y2;

I=sum(Q)

the result is as follows

I =

2.2855

3) enter the following code to get the result using quad function

% Integral using quad function

v=20*0.914;

Q=@(r)2*pi*r.*v;

I = quad(Q,0,.2)

the result is as follows

I =

2.2971