These instructions are written with the assumption that code will be done in matlab. You might...

80.2K

Verified Solution

Question

Advance Math

These instructions are written with the assumption that codewill be done in matlab. You might find the following built incommands useful: length, plot, xlabel, ylabel, title, legend,fzero, plot, disp, axis, axes, min, max.

2. Numerical Integration (Quadrature). Write FOUR of your ownnumerical integration routines. One should use left-end, right-end,or mid-points, another should use the trapezoid method, anothershould use Simpson’s method, and the fourth should use eitherGuassian Quadrature or Romberg’s method. Use your four routines toapproximate two integrals numerically so that they are accurate to1 part in 1 billion (if possible, if this is not possible explainwhy). First use your routines to approximate f(x) = x 3 − x cos(x)on the interval [0, 2π], you can and should check that your answeris correct. Then use your routines to approximate f(x) = 4e −2x 2on the interval [−1, 1]. Use one of matlab’s built in integrationfunctions to approximate both integrals also. Each integral shouldbe: numerically approximated FOUR ways, checked vs one of matlab’sbuilt-in numerical integration methods, and the polynomial/trigfunction should be checked exactly.

Answer & Explanation Solved by verified expert
3.9 Ratings (392 Votes)
Matlab code for finding integration using 4 differentmethodclear allclose allfunctions for which integration have to dofun1x x3xcosx fun2x 4exp2x2 Number of steps in each methodsN100Limit of integration for function 1a10 b12piLimit of integration for function 2a21 b21fprintfnnFor 1st function fx dispfun1Exact integration for function 1Iext integralfun1a1b1fprintfnExact integration value for af to bf isfna1b1IextLeft Riemann integration for function 1Irmnleftriemannfun1a1b1NfprintfntLeft Riemann integration for function 1 for Nd isfnNIrmnfprintfError in Left Riemann integration isenabsIextIrmnTrapizoidal integration for function 1Itrptrapizoidalfun1a1b1NfprintfntTrapizoidal integration for function 1 for Nd    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students