Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function named gaussRule ( f , a , b , c , d ) . The function takes a bivariate function f ,

Create a function named gaussRule(f, a, b, c, d). The function takes a bivariate function f, represented as an anonymous function, and the numbers a, b, c,d, defining the rectangle [a,b][c,d]. The function should calculate the integral of function f over the given rectangle using the Gauss quadrature rule with three points, as presented in (3).
Write a function named nIntegral (f, ab, cd, k, h). This function, similar to the previous one, takes a two-variable function f represented as an anonymous function. Additionally, it takes two two-element vectors ab and cd, in which the intervals a,b and c,d are stored, respectively. Furthermore, it takes two natural numbers, k and h. The function should calculate the integral of the function f over the rectangle [a,b][c,d] using a composite Gaussian rule with three points. This means the function should divide the interval a,b into k subintervals and the interval c,d into h subintervals. Then, on each smaller rectangle, apply the rule (3), sum the results, and return an estimate for the integral abcdf(x,y)dxdy.
3
Let
f(x,y)=cos((c1+1)x)sin((c2+1)y),
where c1 in c2 are the last two digits of your enrolment number. Plot the graph of function f(x,y) on the rectangle [0,15][0,20]. Then numerically compute the integral
020015f(x,y)dxdy
using the built in function integral2. On how many subdivisions should we divide the interval a,b and on how many interval c,d so that the composite Gauss rule with three points gives a result that differs by less than 10-6 from the result obtained with the built-in function integral2?
image text in transcribed

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 Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions