Answered step by step
Verified Expert Solution
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 PA:
erf
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 PA
Composite trapezoid rule MATLAB trapz andor cumtrapz functions
Three point GaussLegendre quadrature.
MATLAB's builtin integral function Adaptive GaussKronrod Quadrature
Write a function that receives the following single input:
A column vector of one or more values at which erf is to be computed.
Your function should return the following outputs in order, column vectors when input is a vector:
The estimates for erf calculated using composite trapezoid rule between and each of the elements in Evaluate the integrand at and at the input values to compute values for the trapezoid rule.
The estimates of erf calculated using threepoint GaussLegendre quadrature. Work by hand to develop the shifted integrand in terms of and use the appropriate constants and function evaluations.
The estimates of erf calculated using MATLAB's builtin integral function.
Note: The first three test cases use a scalar input for and check each of the methods separately. Code to call your function e
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started