Question: Part 1 : Multiple Segment Simpson's 1 / 3 Rule Aside from applying the trapezoidal rule with finer segmentation, another way to obtain a more

Part 1: Multiple Segment Simpson's 1/3 Rule
Aside from applying the trapezoidal rule with finer segmentation, another way to obtain a more
accurate estimate of an integral is to use higher-order polynomials to connect the points.
Simpson's 13 rule results when a second-order interpolating polynomial is used. And it can be
improved by dividing the integration interval into a number of segments of equal width (Multiple
Segment Simpson's 1/3 Rule)
Write a matlab function/code that does calculates the integral of a function in a given interval
with multiple-segment Simpson's 13 rule, where the approximating the integral is as follows:
I~=(b-a)f(x0)+4i=1n-1,3,5f(xi)+2j=2n-2,4,6f(xj)+f(xn)3n
Generate a matlab function/code and call it: simpson.m
An algorithm (for a matlab function) you use may start as follows (you need to complete the
remaining part according to Equation 1). Because of the need for three points for application of
13 rule each segment, the method is limited to odd number of points (even number of
segments).
sinput -all the constants in your function
sinput -f is the integrand
x0 and xn are lower and upper limits of integration
n is the number of segments
Output -S is the simpson rule sum.
sl=0; in inial sum for the odd terms set to be zero
s2=0; initial sum for the even terms set to be zero
s you need to write two "for loop" for the sum of the odd and even terms
COMPLETE the program script on your own
 Part 1: Multiple Segment Simpson's 1/3 Rule Aside from applying the

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!