Question: Please use matlab to sove this question, I post the function you gonna use in this question above the question. Please answer each of the




Please use matlab to sove this question, I post the function you gonna use in this question above the question. Please answer each of the question (a), (b), (d). It's a numerical computational question. Please make graphs and a statement of the order of convergence that you measure.
Function 5.6.1 (trapezoid) Trapezoid formula for numerical integration function [T,t,y] trapezoid(f,a,b,n) = BTRAPEZOID Trapezoid formula for numerical integration % Input: integrand (function) % a, b interval of integration (scalars) % n number of interval divisions % Output: approximation to the integral of f over (a, b) vector of nodes used % y vector of function values at nodes h = (b-a); t = a + h*(0: n)'; y = f(t); T = h * ( sum (y(2:n)) 0.5*(y(1) + y(n+1)) ); + Function 5.6.1 (trapezoid) Trapezoid formula for numerical integration function [T,t,y] trapezoid(f,a,b,n) = BTRAPEZOID Trapezoid formula for numerical integration % Input: integrand (function) % a, b interval of integration (scalars) % n number of interval divisions % Output: approximation to the integral of f over (a, b) vector of nodes used % y vector of function values at nodes h = (b-a); t = a + h*(0: n)'; y = f(t); T = h * ( sum (y(2:n)) 0.5*(y(1) + y(n+1)) ); +
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
