Composite 3/8 Simpson Method N-1 N-2 3 I(f) Δοξάτο Στ h] fi + 3 Σ fitfiti fi ] + fN+1 i=2,5,8,... i=4,7,10,... +2
Composite 3/8 Simpson Method N-1 N-2 3 I(f) Δοξάτο Στ h] fi + 3 Σ fitfiti fi ] + fN+1 i=2,5,8,... i=4,7,10,... +2
Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
Related questions
Question
How would I enter this formula into matlab
![**Composite 3/8 Simpson Method**
The formula for the Composite 3/8 Simpson Method is given by:
\[
I(f) \approx \frac{3}{8} h \left[ f_1 + 3 \left( \sum_{i=2,5,8,\ldots}^{N-1} f_i + f_{i+1} \right) + 2 \left( \sum_{i=4,7,10,\ldots}^{N-2} f_i \right) + f_{N+1} \right]
\]
**Explanation:**
This formula is used for numerical integration, a method of approximating the integral of a function. It is particularly suitable for integration over a range where the function is not easily integrated analytically. The approximation takes into account:
- \( h \) is the width of each subinterval.
- \( f_i \) represents the function evaluated at specific points.
- The terms inside the square brackets \([ \cdots ]\) add contributions from:
- The first point \( f_1 \)
- A weighted sum of the function values at points indexed by \( i = 2, 5, 8, \ldots \) using a factor of 3
- A weighted sum of the function values at points indexed by \( i = 4, 7, 10, \ldots \) using a factor of 2
- The last point \( f_{N+1} \)
The Composite 3/8 Simpson Method is a higher-order rule compared to the basic Simpson's Rule, using cubic polynomials for better accuracy over each subinterval.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffa3769d6-5bdb-4366-8adb-dd8310df7605%2Fd62cbe03-e840-4a29-9d52-c3a8655fa112%2Fbaqnq3b_processed.png&w=3840&q=75)
Transcribed Image Text:**Composite 3/8 Simpson Method**
The formula for the Composite 3/8 Simpson Method is given by:
\[
I(f) \approx \frac{3}{8} h \left[ f_1 + 3 \left( \sum_{i=2,5,8,\ldots}^{N-1} f_i + f_{i+1} \right) + 2 \left( \sum_{i=4,7,10,\ldots}^{N-2} f_i \right) + f_{N+1} \right]
\]
**Explanation:**
This formula is used for numerical integration, a method of approximating the integral of a function. It is particularly suitable for integration over a range where the function is not easily integrated analytically. The approximation takes into account:
- \( h \) is the width of each subinterval.
- \( f_i \) represents the function evaluated at specific points.
- The terms inside the square brackets \([ \cdots ]\) add contributions from:
- The first point \( f_1 \)
- A weighted sum of the function values at points indexed by \( i = 2, 5, 8, \ldots \) using a factor of 3
- A weighted sum of the function values at points indexed by \( i = 4, 7, 10, \ldots \) using a factor of 2
- The last point \( f_{N+1} \)
The Composite 3/8 Simpson Method is a higher-order rule compared to the basic Simpson's Rule, using cubic polynomials for better accuracy over each subinterval.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
Step 1: 3/8 Simpson method Matlab code
f=@(x)exp(x)./(1+x); %Defining the function, for example is taken
a= input('Enter lower limit a: ');
b=input('Enter upper limit limit b: ');
n=input('Enter the no of subinterval n: ');
h=(b-a)./n;
if rem(n,3)==0
fprintf('\n Its a valid n');
else
fprintf('\n Its a invalid n');
n= input('\n Enter n as a multiple of 3');
end
k= 1: 1: n-1;
S=f(a+k.*h);
I=3:3:n-1;
S3= sum(S(I));
S(I)=sum[];
So=sum(S)
%Writing Simpson 3/8 formula
out= (3*H./8).*(f(a)+f(b)+3.*So+2.*S*3);
fprintf('The value of the integration is %f\n', out);
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
![Mathematics For Machine Technology](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
![Basic Technical Mathematics](https://www.bartleby.com/isbn_cover_images/9780134437705/9780134437705_smallCoverImage.gif)
![Topology](https://www.bartleby.com/isbn_cover_images/9780134689517/9780134689517_smallCoverImage.gif)