NUMERICAL COMPUTATION Homework 11

$24.99 $18.99

Implement the following numerical methods for approximating integrals: (i) trapezoidal rule, (ii) Simpson’s rule, and (iii) Clenshaw-Curtis rule. Code for generating the points and weights of the Clenshaw-Curtis rule is available on Canvas. Consider the function f(x) = sin(2 x) + cos(3 x); x 2 [ 1; 1]: Using calculus, compute the de nite integral…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)
  1. Implement the following numerical methods for approximating integrals: (i) trapezoidal rule, (ii) Simpson’s rule, and (iii) Clenshaw-Curtis rule. Code for generating the points and weights of the Clenshaw-Curtis rule is available on Canvas.

Consider the function

f(x) = sin(2 x) + cos(3 x); x 2 [ 1; 1]:

    1. Using calculus, compute the de nite integral of f(x) on the interval [ 1; 1].

    1. For n = 2k + 1 with k = 1; : : : ; 20, use the three numerical integration methods to estimate the integral with n points. Plot the relative error as a function of n on a log-log scale.

    1. Identify the values of n that constitute the asymptotic regime. For each of the three methods, what convergence rate do you observe?

  1. Repeat the previous numerical study for the function

f(x) = sign (x

0:2) + 1;

x 2 [ 1; 1]

where

8

0;

y = 0

sign (y) =

<

1;

y > 0

1;

y < 0

:

How do the observed convergence rates di er from the rst function? Why do they di er?

1

NUMERICAL COMPUTATION Homework 11
$24.99 $18.99