Question: a) [20 points] Consider a domain [a, b] discretized into N unevenly spaced subintervals, as shown in the figure. The formula for the composite trapezoidal

 a) [20 points] Consider a domain [a, b] discretized into N

a) [20 points] Consider a domain [a, b] discretized into N unevenly spaced subintervals, as shown in the figure. The formula for the composite trapezoidal rule to approximate an integral is given by: N -=[*r6wdx = f(x) dx = = f(xx) + f(x+1)] (*x+1 xv) k=1 f(x) Evaluate So fundo where a=x, b= %N+I X, X2 X3 --- XN-1 XN XNti N sub intervals Write a MATLAB user-defined function trap_uneq to implement the above formula. A partially completed m-file is provided. The numerical solver has the following input/output structure: function I = trap_uneq(fun,x) where fun is an anonymous function and x is a vector of the values for the discretized domain. Note that (Xk+1 Xk) is the step size of the interval between Xk and Xk+1 b) [15 points] Apply the trapezoidal rule algorithm to evaluate the following integral using 25 equally spaced subintervals. x3 dx 10 I = so 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!