Question: Problem 2: Construction of functions (numerical solvers) for numerical computations a) Based on what is learned in class about the left-Riemann sum algorithm, construct a

Problem 2: Construction of functions (numerical solvers) for numerical computations a) Based on what is learned in class about the left-Riemann sum algorithm, construct a MATLAB function (numerical solver) that performs the numerical integration using the right Riemann sum. The formula (algorithm) for the composite right Riemann sum for a set of N+1 equally spaced data points (or discretized domain points) is: N+1 = f(x)h k=2 1 => sx) dx = f(x)h f(x) a Evaluate ( f(x) dx Ja where a=x, b = XN+I X, X2 X3 -- XN-1 XN XNti N sub intervals This numerical solver has the following input/output structure: function I = RightRiemann Sum (fun, a, b, N) where fun is an anonymous function and x is a vector of the values for the discretized domain. Note that h=Xk+1 xk is the step size of the subinterval between xk and Xk+1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
