Professional Documents
Culture Documents
Outline
Numerical Integration with
Unequal Segments
Matlab
Multiple Integrals
Matlab
In-Class Problem due
Thursday, November 13th
I ba
n1
f x 0 f xi f xn
i1
2n
h f x f x ... h f x f x
f x 0 f x1
2
n1
z = trapz(x,y)
x and y are vectors of data
z is a scalar value of the integral
Works for both equal and unequal segments
Double Integral
f x,y dx dy f x,y dy dx
2xy 2x x
0 0
2y 72 dxdy
2
6 0 8 0
x
2
2
2
x
y
2xy
72x dy
3
0
0
6 0 8 0
512
16y
2
512
2
32y
64y
576y
60 80
60 80
6
58.67
48
48
2xy 2x x
0 0
2y 2 72 dxdy
6 0 8 0
f(x,y)
72
54
64
70
40
24
54
48
f(x,y)
72
54
64
70
40
24
54
48
54 2 70 54
y = 3: I 8
496
y = 6: I 8
0 2 40 48
256
I 6
Average
2544
53 58.67
48
2544
q = dblquad(fun,xmin,xmax,ymin,ymax,tol)
Example: q = (@(x,y) 2*x*y + 2*x x^2 2y^2 + 72, 0, 8, 0, 6)