Question: USE MATLAB! USE MATLAB! QUESTION 3: The methods that we used for approximating single integrals all have counterparts for double integrals. The Midpoint Rule for
USE MATLAB!



USE MATLAB!
QUESTION 3: The methods that we used for approximating single integrals all have counterparts for double integrals. The Midpoint Rule for double integrals is given in the following equation. SF F(x,y)dA=DES(5,7, hray (3) i=1 ;=1 where x is the midpoint of [xi-1, xi] and y, is the midpoint of [yj-1, y;] For example, eq. (3) can be applied to estimate the volume of the solid (see Fig. 1) that lies above the square R= [0, 2] x [0, 2] (see Fig. 2) and below the elliptic paraboloid x,y)= 16 - x - 2y?. = midpoint of each square y d=2 . . b=2 Fig. 1 Fig. 2 Write a function that will return the final value of the double integral given in (3). Start with the function definition shown below. The function will receive 6 input arguments: 1. the original function f(x,y), 2. the lower bound of the double integral in the x-direction (a), 3. the upper bound of the double integral in the x-direction (b), 4. the lower bound of the double integral in the y-direction (c), 5. the upper bound of the double integral in the y-direction (d), 6. number of sub-intervals (n). We assume that the number of sub-intervals are the same in both x and y direction. function (output] = intdouble (f, a,b,c,d,n) $ (OUTPUT] = INTDOUBLE (F,A,B,C,D,N) evaluates and returns the final value of the double integral of any functions (1) end To evaluate the function, you can define a function for the elliptic paraboloid, as given below: function [z] elliptic(x,y) z = 16-x^2-2+y^2; end Then in the Command Window: >> intdouble (@elliptic, 0,2,0,2,2) ans = 49
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
