Numerical Analysis in Engineering
ME 140A, Fall 2007
Final Solution
December 15, 2007
Problem 1
Use the trapezoidal rule to integrate
I
=
2
0
3
0
xy dx dy
(1)
Use 3 intervals of equal size in the xdirection, and 2 intervals of equal size in
the ydirection.
Compare your result with the analytical result.
Discuss the
comparison.
Solution:
I
=
2
0
y
3
0
x dx
dy
(2)
First, use composite trapezoidal rule in xdirection:
I
=
2
0
y
0 + 1
×
1 + 1
×
2 +
1
2
×
3
dy
=
9
2
2
0
y dy
(3)
Now, use composite trapezoidal rule in ydirection:
I
=
9
2
0 + 1
×
1 +
1
2
×
2
=
9
(4)
Next, we can find the integral analytically as below:
I
=
2
0
y
3
0
x dx
dy
(5)
=
2
0
y
x
2
2

3
0
dy
(6)
=
9
2
y
2
2

2
0
(7)
=
9
(8)
Comparing the results, we get exact agreement between the numerical and ana
lytical result since the given function is linear both in terms of x and y. There
fore, the trapezoidal rule can reproduce the functions correctly.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Problem 2
The following first order ODE
dy
dx
=
2
x
y
+
x
2
y
,
y
(0) =

2
(9)
can be solved analytically using the separation of variables technique. Toward
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 Meiburg
 Derivative, Taylor Series, Natural logarithm

Click to edit the document details