Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this matlab problem. Consider again the error function integral from PA 6 : erf ( x ) = 2 2 0

I need help with this matlab problem. Consider again the error function integral from PA6:
erf(x)=220xe-t2dt
For this problem you'll use the following numerical integration approaches to evaluate this integral and generate values for a table similar to what you worked with in PA6.
Composite trapezoid rule (MATLAB trapz and/or cumtrapz functions).
Three point Gauss-Legendre quadrature.
MATLAB's built-in integral function (Adaptive Gauss-Kronrod Quadrature).
Write a function that receives the following single input:
A column vector of one or more x values at which erf(x) is to be computed.|
Your function should return the following outputs (in order, column vectors when input x is a vector):
The estimate(s) for erf (x) calculated using composite trapezoid rule between 0 and each of the elements in x. Evaluate the integrand at 0 and at the input x-values to compute y-values for the trapezoid rule.
The estimate(s) of erf (x) calculated using three-point Gauss-Legendre quadrature. Work by hand to develop the shifted integrand (in terms of xd) and use the appropriate constants and function evaluations.
The estimate(s) of erf(x) calculated using MATLAB's built-in integral function.
Note: The first three test cases use a scalar input for x and check each of the methods separately. Code to call your function (e)
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

More Books

Students also viewed these Databases questions

Question

=+What does this say for the future of the business case for CSR?

Answered: 1 week ago