Answered step by step
Verified Expert Solution
Link Copied!

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 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

Demonstrate three aspects of assessing group performance?

Answered: 1 week ago