MATH 480: Homework 2 SPRING 2011

Assigned: January 26, 2011
Due: February 2, 2011
MATH 480: Homework 2
SPRING 2011
NOTE: For each homework assignment observe the following guidelines:
• Include a cover page and an assignment sheet.
• Always clearly label all plots (title, x-label, y-label, and legend).
• Use the subplot command from MATLAB when comparing 2 or more plots to make
comparisons easier and to save paper.
1. Consider the polar coordinates
x = r cos θ,
(a) Since r2 = x2 + y 2 , show that
y = r sin θ.
∂r
∂r
∂θ
cos θ
= cos θ,
= sin θ,
=
, and
∂x
∂y
∂y
r
∂θ
sin θ
=−
.
∂x
r
(b) Show that r̂ = cos θ î + sin θ ĵ
and
θ̂ = − sin θ î + cos θ ĵ.
∂
1 ∂
∂u
1 ∂u
+θ̂
and hence ∇u = r̂
+θ̂
.
∂r
r ∂θ
∂r
r ∂θ
~ = A1 r̂ + A2 θ̂, show that ∇ · A
~ = 1 ∂ (rA1 ) + 1 ∂ (A2 ), since ∂r̂ = θ̂ and
(d) If A
r ∂r
r ∂θ
∂θ
∂ θ̂
= −r̂ follows from part (b).
∂θ
1 ∂
∂u
1 ∂2u
2
(e) Show that ∇ u =
r
+ 2 2.
r ∂r
∂r
r ∂θ
(c) Using the chain rule, show that ∇ = r̂
2. Heat Equation with Circular Symmetry. Assume that the temperature is
circularly symmetric: u = u(r, t), where r2 = x2 + y 2 . Consider any circular annulus
a ≤ r ≤ b.
Rb
(a) Show that the total heat energy is 2π a cρur dr.
(b) Show that the flow of heat energy per unit time out of the annulus at r = b is
∂u φ = −2πbK0 .
∂r r=b
A similar results holds at r = a.
(c) Assuming the thermal properties are spatially homogeneous, use parts (a) and
(b) to derive the circularly symmetric heat equation without sources:
∂u
κ ∂
∂u
=
r
.
∂t
r ∂r
∂r
1
Assigned: January 26, 2011
Due: February 2, 2011
(d) Find the equilibrium temperature distribution inside the circular annulus a ≤
r ≤ b if the outer radius is insulated and the inner radius is at temperature T .
3. If Laplace’s equation is satisfied in 3D, show that
∇u · n̂ dS = 0 .
ZZ
for any closed surface. (HINT: use the divergence theorem.) Give a physical interpretation of this result in the context of heat flow.
4. Compute the following integrals where m and n are non-negative integers. Look out
for special cases.
RL
(a) 0 cos(nπx/L) cos(mπx/L) dx
RL
(b) −L cos(nπx/L) cos(mπx/L) dx (modified)
RL
(c) −L cos(nπx/L) sin(mπx/L) dx (modified)
5. Consider the boundary value problem:
PDE:
ut = uxx , (0 < x < 4)
BCs:
ux (0, t) = −2, ux (4, t) = −2
ICs:
(
0
u(x, 0) =
2x − 4
if 0 ≤ x ≤ 2
if 2 ≤ x ≤ 4.
(a) Find the steady-state solution. (NOTE: There are Neumann BCs at each end.
Generally, this would suggest that there would be no steady-state solution. In
this case, however, the same value of the derivative is given at each end, meaning
that heat leaves and enters at the same rate. You will find that the steady-state
solution contains an arbitrary constant. So how do you choose this constant?
Since the net heat flux into the interval 0 ≤ x ≤ 4 is 0, the total heat energy
must not depend on time. Choose the constant in the steady-state solution so
that the total energy as t → ∞ is the same as the energy at time t = 0.)
(b) Using separation of variables, find the solution u(x, t) to this problem. In order
to accomplish this do the following:
• Write u(x, t) = w(x) + v(x, t), where w(x) is the particular solution (also
the steady-state solution) and v(x, t) is the homogeneous solution.
• Write down the PDE and the BCs that v(x, t) must satisfy.
• Write down the solution for v(x, t) using the separation of variables results
we obtained in class.
• Choose the arbitrary constants in v(x, t) so that u(x, t) satisfies the initial
condition.
2
Assigned: January 26, 2011
Due: February 2, 2011
(c) Plot u(x, t) as a function of x for several values of t in order to see how the
temperature profile evolves from the inital condition towards the steady-state
solution. (NOTE: use the subplot command in MATLAB in order to save
paper. In each subplot window plot u(x, t) at a given instant in time.)
3
a,uq
aw"
{,/2"24- '"?-'E!gL
4?:
E :-a.e{r.t-,N
eqc? / -
44Q-
-aqq
44 a*oa --
Aetdy'
7A
aldd
4,2
yA
'/0
o
J&
Zg
4.1(/J
Srvo.4ozos
I
?fl /A/
'(0
=
t9
/6 tp2,t =
/
ryaaa
"OrPl
/
/tt"
lh)
1-tu /
/o')
lsvl
1
(- /"/
7-/
/u,
t//
Itzar/z{
ewal -tan9,7 -- r
g,V * /. -A'-
It / a
zttz,/ z'ez'6'
=.- 1-.f>n F,
f
t/7"atie* f-"'42
l*nn
- nhd/
l *
c.ee i\
-'s o +l
-
lt::-
4
^ -4
f -- ap+-o L -t din / I
$ ' = - a th 7 7 * ta+f
= e.?/€
7: ,ya l-a"zB 6
l:)in tzeeE
o#-t
-d,
/e
O- --/;,"e-l
t
:,__
auur- =
_14,
JAM; * s a<*-=g
l.,.tttt?
t-
7
+/ V =f
-f-,r
atlat / f
a.hr? +
::--4
4 ' --6
L/.!
'
E/2
t
lc
-tt
*
Z!,u*_'
7gz1:!l
9," 39'ri
;" +
/-
'4ft3t
7
-
Vie.wt
,J
€-331i1:"2:-
-a,tQ
.t Jt lt, ,'
j
6
u . 1 :(t; * ?; 6e)6,?.tA-A\=-t*1+,1 )+
* \'
": ' .3(- r y ' i *n , oo^)
t o ? !: -i{" uoo( ' * O
"-
D(
/"
tO
-JIu"
\/'l+
-
r
.t\,
A-4,i-1
:-
v4
::
Q
V'L( ,/\ , ULI
rT-
: ? l e r i* o r 0 l
I ELi A
A\ A
---.:-FQg
!
fl
--
I
\
_L
v
/\
iilc/
(t
-
n
t
HLI
C l. - a q \ \l
^,.
ALI-:
o-Lt
'd1J
l
--- r'
,
I
:l
t= zrh t.l
a 4rz4-
ox,--- t311f,
ft-l
'r/z'Zo-
at "dr
7c/"1 ltas
-:'a
4 zt / azJ'"1 .'ryz'"/ n' 4 '? fu;
Ut4,/&',L
r= d,
&t n4i
S= r g,
dS= r d*
/
,
O'
',
Dtt
'-Jixo6-,
U*
dt
-'7,.
Jrtu:?:-!rf ;;
'tzti;z
r
Of '
tr:-:b
(
'- Otr
d /t-r
-
o o1,
<,2 ;-:,
f,ut ul
4en
a/ ?blal
A/
tp r 4_y --42:&
"2"
A :Z- ! 1"22 )
_8E
41 -_O 4
)
84 t
4./r
''t=
rl-r
'?t"=(z?', r*
=g i
g4/€;r
C;
to
/a4/'/4
"tz
L4+
Q =-A d O-'O
4 Q:7
.tr-/x):V= 4A-:Za
4
tr4/-a'*"/
,v
--
I .r _
.
a [m-r)
,'/- - - ; ta
--.
=
,:--'--: , / o,- z( u *u )
z
- -;-Wv
f
44 tLu /u/
.'
7
d'4(k/-9- L' "
-
,jit'* E>!*ftnrf'
..7
tt/
:,4 a
f7.rau +[ a;*7,o77 = ?rat
, f*-zols
ut 7u '
/t' '/r to
1 ,f
;
t4"-{+dztt7e/
.
:1
-::"1
o+/u--/
l
q -n ,4 -u n J
l:1-lz-on
rou
w
"/
1.. .)
,..- /
f
_
(/J
4F-/
( =or,
/
a
_{_Aza
- prV2,'.zp1t2?2"7','?2furyA
z<zo-"2
t*>7r777ffi
o
r /
(z
a
aro Zr"u
)fZ L'
I
Z./
r4
nai
fr;zt +ea7f
-Lr/."""/,4;4?
'W?
'7'
-44
a: S/"g'tLA
o-SF g //-^
A.
!!2441a/11
-
6lt
./t P ,1'-A
= turA
fiaf^
J
o=
__;__
_ b,t
*
___-___.
: 4 ( r 4- / - / ) ' - - , f 4( k ' + d',
: 4".i;a
,/1?rza4v
//o
U/--/42
L tp
L//
w
2,6q
2ba
" .f4a
'frut
ft.tv2.
?fo lrul
-- fr,
-tU'-U
u/'
-7f 1f , -/
T+//-/J
-r
1/
7
=
i
-=
/
___,_
- -zlrr/t//E?
a/
iZr.A
,4
A=2z fur'e
rtV lda
o.=- 4?oo ./
,rz a
//
-:--;--=- P7
------:-
.r4- r /u-u)-
.tc?
.'4aA/t/)Lct
rZA'(q ffi m
7 . = r yt
t(
.,r4
o
l/
kr'4 =7
ka
V b ""t r 7 *
4 zxz o
xr-_a -ft4n e 9-/J
d?- (*p-t//
- [-l/,ry(/
-
-1,'
e S/-rJl =h e
't-X.f,/ / *.r./O
e
/
fizrr
/"
'=- 4Vz (6tUrz, d O
= T---
*r=n
e c'-
ee=?
-{(q1ua/t
42p-
tr' !r/-,/ + (/f/:ry = fil'tsr2
',t7.r7r 7-/7;
----:?z-r7-q- 'g
O</
O /x?24/
___-*_,_-__+_._
' ri z x z O
' t4/a' = " 72
\tI
^s
''d
I
t"
\
*
\
\
s
$
s
\-\
\
t\
-1,
{
\
s
\
.}
.>-
+
e
l
a
l)
'1r
\
I
I
l{.\
,'\
.\-
i\l
*
i'F
* t]
t-\t'
lsl
l "* l
iNi[t
st[
I i\
f
ei k
t]
j "l r
iS i* l
is
\l
-lr
\
+.
,Ti
'\l
\i
-:-\l
l-/i 1\l"$
i$
a
\ji
i-
i\
> - i\' l
l-
I
..< tf
+
.s
i ,')
\
Ni
Assigned: January 26, 2011
Due: February 2, 2011
Problem # 5 (c)
clear all
x=0:1e-3:4;
w=5-2*x;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t=0;
figure(1); clf(1)
for i=1:length(x)
if x(i)<2
u(i)=0;
else
u(i)=2*x(i)-4;
end
end
subplot(3,2,1), plot(x,u,’b’,x,w,’r-.’)
legend(’u(x,t)’,’w(x)’,3)
title(’u(x,t) at t=0’)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u=w; t=0.8;
for n=1:5
u=u-16/n^2/pi^2*(cos(n*pi/2)+1+2*(-1)^(n+1))*cos(n*pi*x/4)*exp(-(n*pi/4)^2*t);
end
subplot(3,2,2), plot(x,u,’b’,x,w,’r-.’)
title([’u(x,t) at t=’,num2str(t)])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u=w; t=1.6;
for n=1:5
u=u-16/n^2/pi^2*(cos(n*pi/2)+1+2*(-1)^(n+1))*cos(n*pi*x/4)*exp(-(n*pi/4)^2*t);
end
subplot(3,2,3), plot(x,u,’b’,x,w,’r-.’)
title([’u(x,t) at t=’,num2str(t)])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u=w; t=2.4;
for n=1:5
u=u-16/n^2/pi^2*(cos(n*pi/2)+1+2*(-1)^(n+1))*cos(n*pi*x/4)*exp(-(n*pi/4)^2*t);
14
Assigned: January 26, 2011
Due: February 2, 2011
end
subplot(3,2,4), plot(x,u,’b’,x,w,’r-.’)
title([’u(x,t) at t=’,num2str(t)])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u=w; t=3.2;
for n=1:5
u=u-16/n^2/pi^2*(cos(n*pi/2)+1+2*(-1)^(n+1))*cos(n*pi*x/4)*exp(-(n*pi/4)^2*t);
end
subplot(3,2,5), plot(x,u,’b’,x,w,’r-.’)
title([’u(x,t) at t=’,num2str(t)])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u=w; t=4.0;
for n=1:5
u=u-16/n^2/pi^2*(cos(n*pi/2)+1+2*(-1)^(n+1))*cos(n*pi*x/4)*exp(-(n*pi/4)^2*t);
end
subplot(3,2,6), plot(x,u,’b’,x,w,’r-.’)
title([’u(x,t) at t=’,num2str(t)])
print -depsc2 hw2_pr5c.eps
15
Assigned: January 26, 2011
Due: February 2, 2011
u(x,t) at t=0
u(x,t) at t=0.8
5
5
0
0
u(x,t)
w(x)
−5
0
1
2
3
−5
4
0
1
u(x,t) at t=1.6
5
0
0
0
1
2
3
−5
4
0
1
u(x,t) at t=3.2
5
0
0
0
1
2
4
2
3
4
3
4
u(x,t) at t=4
5
−5
3
u(x,t) at t=2.4
5
−5
2
3
−5
4
0
1
2
Figure 1: Evolution of u(x, t) compared with steady state solution w(x) in problem # 5
(c)
16