Page 457 - Applied Numerical Methods Using MATLAB
P. 457
446 PARTIAL DIFFERENTIAL EQUATIONS
where the first input argument ABC is supposed to carry the vector containing
three coefficients A, B,and C. Use the routine to solve the following PDEs
and plot the solutions by using the MATLAB command “mesh()”.
2
2
∂ u(x, y) ∂ u(x, y)
(a) + 2 = 10 for 0 ≤ x ≤ 1, 0 ≤ y ≤ 1 (P9.2.2)
∂x 2 ∂y 2
with the boundary conditions
2
2
u(0,y) = y , u(1,y) = (y + 2) ,
(P9.2.3)
2
u(x, 0) = 4x , u(1,y) = (2x + 1) 2
Divide the solution region (domain) into M x × M y = 20 × 40 sections.
2
2
2
∂ u(x, y) ∂ u(x, y) ∂ u(x, y)
(b) + 3 + 2 = 0 for 0 ≤ x ≤ 1, 0 ≤ y ≤ 1
∂x 2 ∂x∂y ∂y 2
(P9.2.4)
with the boundary conditions
y
u(0,y) = e + cos y, u(1,y) = e y−1 + cos(y − 2) (P9.2.5)
u(x, 0) = e −x + cos(−2x), u(x, 1) = e 1−x + cos(1 − 2x) (P9.2.6)
Divide the solution region into M x × M y = 40 × 40 sections.
2
2
2
∂ u(x, y) ∂ u(x, y) ∂ u(x, y)
(c) + 3 + 2 = x sin y
∂x 2 ∂x∂y ∂y 2
(P9.2.7)
for 0 ≤ x ≤ 2, 0 ≤ y ≤ π
with the boundary conditions
u(0,y) = (3/4) cos y, u(2,y) =− sin(y) + (3/4) cos y (P9.2.8)
u(x, 0) = 3/4, u(x, π) =−3/4 (P9.2.9)
Divide the solution region into M x × M y = 20 × 40 sections.
2
2
2
∂ u(x, y) ∂ u(x, y) ∂ u(x, y)
(d) 4 − 4 + = 0 for 0 ≤ x ≤ 1, 0 ≤ y ≤ 1
∂x 2 ∂x∂y ∂y 2
(P9.2.10)
with the boundary conditions
2y
u(0,y) = ye , u(1,y) = (1 + y)e 1+2y ,
(P9.2.11)
x x+2
u(x, 0) = xe , u(x, 1) = (x + 1)e
Divide the solution region into M x × M y = 40 × 40 sections.

