E880 Problem Set 6 Solved

30.00 $

Category:

Description

Rate this product

1 Integration

Evaluate􏰈1 x1/3dx using(A)Trapezoidrule,(B)Gauss-ChebyshevQuadratureand(C)Gauss-Legendre 0

quadrature. Try 3, 5 and 11 nodes with each approach. Compute the exact integral, report relative errors for each method & number of nodes, and comment on relative precision of the methods.

You have to code everything yourself here, but you can take the Gaussian quadrature nodes and weights from the table in the Judd textbook).

2 Monte-Carlo

Evaluate􏰈 3 ex+2y+3zdxdydz using(A)pseudo-randomnumbersfromMatlab’srand(),(B)uni- [0,1]

formly spaced grid. For (A), use the number of draws of the form 100n with n = 1, 2, …, 30. For (C ), use n equally spaced nodes along each dimension with n ≥ 5 and n3 ≤ 3000. Compute the true value of the integral, and plot the relative errors vs. number of integrand evaluations. Comment on precision of different methods, and ease of implementation.

You have to code everything yourself here other than obtaining the pseudo-random numbers.

1

  • PS6-ckd8um.zip