Question
Answered step-by-step

Matlab function Simpson given below implements Simpson's 1/3 Rule to estimate

Image transcription text

Problem 5. Matlab function Simpson given below implements Simpson's 1/3 Rule to estimate I = So f(x)dx using n odd points. function I = Simpson (fun, a, b, n) % simpson Composite Simpson's rule %% % Synopsis: I = simpson (fun, a, b, npanel) % Input : fun = (string) name of the function that evaluates f (x) % a, b = lower and upper limits of the integral n = number of nodes, odd and > 2. % Output : I = approximate value of the integral from a to b of f(x)*dx if (mod (n, 2) == 0) || (n < 3) disp(' Warning: n must be > 1 and odd, program terminates . .. ') ; return; end dx = (b-a) / (n-1) ; % stepsize x = a: dx: b; divide the interval f = feval (fun, x) ; % evaluate integrand I = (dx/3) *(f(1) + 4*sum(f (2:2:n-1) ) + 2*sum(f (3:2:n-2) ) + f(n)); Now, it is desired to estimate the definite integral I 1 = 37 sin(x/3) da 2 - cos(2/2) (6) correct to at least 4 significant digits, by the use of Simpson's 1/3 rule. For this purpose start with n = 3 and increase n by 2 at a time until your result meets the required accuracy. Use Matlab function Simpson given above for the solution of this problem. Compare your answer with Matlab's quad () function. Comment on your computation.

... Show more

Answer & Explanation
Verified Solved by verified expert

llentesque dapibus efficitur laoreet. Nam risus ante, dapi

entesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac,

l

sus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum

Unlock full access to Course Hero

Explore over 16 million step-by-step answers from our library

Subscribe to view answer
Step-by-step explanation


congue vel

pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus a


m ipsum dolor sit amet, consect

icitur laoreet. Nam risu

molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel

itur laoreet. N

at,

llentesque dapi

onec aliq

m risus ante, d

icitur laoreet. Nam risus ante, dapibus a molestie conse

at,


ce dui lectus, congue vel laoreet ac, dictum vitae odio.


s a molest

fficitur laoreet. Nam risus ante,

sus ante, d

ce dui lectus, co

ongue ve

at, ultrices ac magna. Fus

m ipsum dolor sit ame

, consectetu

entesq

at,


, dictum vitae odio. Donec aliquet. Lorem ipsum

ur laoreet. Nam risus ante, dapibus a molestie consequat,

or nec facilisis. Pellentesque dap

ac, dictum vitae odio. Donec aliquet. Lorem ipsum dol







s a m



tesque dapibus efficiturffic

entesque dapibus efficitur laoreeffic

Fusce duiultrices

rem ipsum dolor sit amet, conso



iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus

Other answer

amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. P


Fusce dui lectus

e vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante,

Unlock full access to Course Hero

Explore over 16 million step-by-step answers from our library

Subscribe to view answer
Step-by-step explanation

e vel laoreet ac, dictum vita


e vel laoreet ac, dictum vitae odio. Donec aliquet. Lo


amet, consectetur adipiscing el

inia pulvinar tortor nec facil

ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, con

ipsum dolor si

icitur

ongue vel laoreet a

a. Fusce dui l

, ultrices ac magna. F

pulvinar tortor nec faci

icitur

, ultrices

icitur laoreet.

s a molestie consequat, u

Fusce dui lectus, congue vel

ce dui lectus, congue vel laoreet

icitur

ec aliquet. Lorem ipsum dolor sit amet, consectet

ac,


consectetur adipiscing elit. Nam lacinia pu


ipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam rec fact,txlicexltx,tittoix,t,tec facec facipsum dolor sit amet, consectetur adipisci

image.jpg


ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellen


a. Fusce dui lectu


risu

Donec al

a. Fusce dui lec

ur laoreet. Nam risus ante, da

icitur laoree

risus ante, dapibus

entesq

icitur laoreet. Nam risu

Fusce dui lectus, congue vel laoreet ac

fficitur laoreet. Nam risus ante, dapibus a molestie c

ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit ame

, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit

ipiscing

tesque dapibus efficitur laoreet. Nam risus ante, dapibus

nec facilisis. Pellentesque dapibus efficitur la

s a molestie consequat, ultr


ongue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consec

screen.jpg

2 Attachments
image.jpg
jpg
screen.jpg
jpg