Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 : Multiple Segment Simpson's Rule
Aside from applying the trapezoidal rule with finer segmentation, another way to obtain a more
accurate estimate of an integral is to use higherorder polynomials to connect the points.
Simpson's rule results when a secondorder 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 Rule
Write a matlab functioncode that does calculates the integral of a function in a given interval
with multiplesegment Simpson's rule, where the approximating the integral is as follows:
~
Generate a matlab functioncode 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 Because of the need for three points for application of
rule each segment, the method is limited to odd number of points even number of
segments
sinput all the constants in your function
sinput is the integrand
and are lower and upper limits of integration
is the number of segments
Output is the simpson rule sum.
sl; in inial sum for the odd terms set to be zero
; 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started