Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on what is learned in class about the left - Riemann sum algorithm, construct a MATLAB function ( numerical solver ) that performs the

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 +1 equally
spaced data points (or discretized domain points) is:
=()
\cong ()
+1
=2
This numerical solver has the following input/output structure:
function [I]= frmrsum(fun,a,b,N)
where fun is an anonymous function and x is a vector of the values for the discretized domain. Note
that =+1 is the step size of the subinterval between and +1.
Critical thinking: Follow the example discussed in class for the left Riemann sum. Both the left and
right Riemann sums represent numerical algorithms, which when coded properly, can be used to
perform numerical integration of functions that cannot be evaluated analytically.
The key is to understand that functions are blind to their input variables (the input variables could
also include functions as in this case). In other words, while the output results depend on the inputs, the
algorithms are independent of the inputs.
Learn how (and why) to define inputs for functions and how to perform the summation in this
algorithm using the MATLAB function sum instead of a for-loop to understand and appreciate the
simplicity and intuitiveness of MATLAB programming.
Instructor: Professor C. A. Tan Copyrighted Materials Lab-Homework 01
ME2500: Numerical Methods Using MATLAB Winter 2024 Term
Lab-HW01 In-Lab and Post-Lab Page 11 of 11
b) The force per unit length that is exerted by the wind
on a 26 ft tall sail as a function of its height is given by:
=175
+5/9 lb/ft
The total force F on the sail is calculated by:
=
26
0
Estimate the total force by applying the right Riemann sum with 10 subintervals (=10).
Compare your result with that obtained by the MATLAB built-in function integral. Assume that
the result from applying the function integral is exact, what is the relative percentage error in
using the Riemann sum with 10 subintervals?
c) Increase to 50, what is the relative percentage of error? Plot the relative percentage error as a
function of up to 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

Have you got a one page summary that you are happy with?

Answered: 1 week ago