Purchase Solution

Quadrature (Matlab) Intergral Evaluated Forms

Not what you're looking for?

Ask Custom Question

a) Approximate the integral I= integral evaluated from -1 to 1 of f(x) dx
with f(x) = 1/(1+x^2) by the composite trapezoidal, midpoint and Simpson's rule using subintervals with lengths h = 1/2, 1/4, 1/8, 1/16, 1/32, 1/64. To this end you may use the analytic result or a very accurate numerical result to compute the error. Plot the error for the different methods as a function of h. Comment on the order of accuracy and efficiency of the different methods.

b) Repeat with the function f(x) = the square root of the absolute value of (x-alpha) with alpha=pi/4 and alpha=0. Comment on the results.

c) Repeat with the function f(x) = e^sin*6*pi*x, comment.

d) Adaptive quadrature. Below is a naive implementation of an adaptive version of forward Euler quadrature. The program checks the if the tolerance TOL is met and recursively performs divide and conquer if it is not. Modify the program so that it uses the trapezoidal rule instead. You can plot the
errors as a function of the effective h = 2/(# fun. evals).
a = -1;
b = 1;
TOL = 1e-2;
I = adFwdE(@myfun,a,b,TOL);
function I = adFwdE(myfun,a,b,TOL);
h = b-a;
m = 0.5*(b+a);
fa = myfun(a);
fm = myfun(m);
I = h*fa;
Ie = 0.5*h*(fa+fm);
if (abs(Ie-I) < TOL)
I = Ie; % use the better value
plot(a,fa,'k*',m,fm,'k*')
hold on
drawnow
else
I = adFwdE(myfun,a,m,TOL/2) + adFwdE(myfun,m,b,TOL/2);
end.

Purchase this Solution

Solution Summary

The solution examines integral evaluated forms for quadratures (MATLAB).

Purchase this Solution


Free BrainMass Quizzes
Solving quadratic inequalities

This quiz test you on how well you are familiar with solving quadratic inequalities.

Probability Quiz

Some questions on probability

Know Your Linear Equations

Each question is a choice-summary multiple choice question that will present you with a linear equation and then make 4 statements about that equation. You must determine which of the 4 statements are true (if any) in regards to the equation.

Geometry - Real Life Application Problems

Understanding of how geometry applies to in real-world contexts

Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.