Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

By Trapezoidal rule and Simpson's rule. approximation and error. f(x)=e^(2x), -1

By Trapezoidal rule and Simpson's rule. approximation and error. f(x)=e^(2x), -1

New Matlab ideas . A For Loop Repeat the code between for and end' once for each number between 1 and N the fprintf statement. This is a formatted printing statement, which uses almost identical syntax to the C programming language. It is used here to format the output for display. You should be able to use this part of the program without modifying it. Parameters used in this program a,b: the limits or integration . x: the variable of integration . f: the integrand .N: the number of sub-intervals h: the width of each sub-interval T: the trapezoidal approximation IS: the Simpson approximation Your assignment After running the above example, do the following to hand in: (Consult the Matlab TA if you have any questions.) Approximate the integral of Answer the following questions . Run the code with N-16, N-32, and N-64 - For each approximation, when coes the resurt agree with the exact value of the integral to 4 digits? How much better is the Simpson's rule than the trapezoidal rule? Explain this resuit using the theory given in the textoook and in lecture. Be quantitatve. Calculate the ratios between the errors each time the number of points is doubled New Matlab ideas . A For Loop Repeat the code between for and end' once for each number between 1 and N the fprintf statement. This is a formatted printing statement, which uses almost identical syntax to the C programming language. It is used here to format the output for display. You should be able to use this part of the program without modifying it. Parameters used in this program a,b: the limits or integration . x: the variable of integration . f: the integrand .N: the number of sub-intervals h: the width of each sub-interval T: the trapezoidal approximation IS: the Simpson approximation Your assignment After running the above example, do the following to hand in: (Consult the Matlab TA if you have any questions.) Approximate the integral of Answer the following questions . Run the code with N-16, N-32, and N-64 - For each approximation, when coes the resurt agree with the exact value of the integral to 4 digits? How much better is the Simpson's rule than the trapezoidal rule? Explain this resuit using the theory given in the textoook and in lecture. Be quantitatve. Calculate the ratios between the errors each time the number of points is doubled

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

3. Discuss the process of behavior modeling training.

Answered: 1 week ago