15
Assigned: January 13, 2011 Due: January 26, 2011 MATH 480: Homework 1 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. Solve each of the following ODEs for y(x): (a) y 00 + 16y =0 with y(0) = 1 and y 0 (0) = 0. (b) y 00 +6y 0 +9y =0 with y(0) = 1 and y 0 (0) = 0. (c) y 000 - y 00 + y 0 - y =0 with y(0) = 1 and y 0 (0) = y 00 (0) = 0. 2. Integration by parts allows us to transfer the derivative from one part of the integrand to another: Z b a f (x) g 0 (x) dx = h f (x) g(x) i b a - Z b a f 0 (x) g(x) dx. Prove that the above statement is true. (HINT: think product rule!) 3. A linear PDE can be written in differential operator notation L(u)= f , where L is the linear differential operator, u is the unknown function, and f is the right- hand side function. For each of the following PDEs, determine the linear operator and the right-hand side function, the order of the PDE, and whether the PDE is homogeneous or nonhomogeneous: (a) u xxx + u yyy - u =0 (b) u tt - u xx + u yy + u zz = xyz (c) x 2 u xx - y 2 u y = cos(x) - sin(y) (d) y 2 u xx - x 2 u y = cos(y) - sin(x) (e) u t - cos(xt)u xxx - t 5 = t 2 u 4. The following convection-diffusion-decay equation appears in many physical appli- cations: u t = Du xx - cu x - λu . Show that this equation can be transformed into a heat equation for w(x, t) by applying the transformation u(x, t)= w(x, t)e αx-βt . HINT: You will only obtain a heat equation for w(x, t) with an appropiate choice for the constants α and β in terms of the constants D, c, and λ. Determine the choice for α and β that produces a heat equation for w(x, t). 1

MATH 480: Homework 1 SPRING 2011 - University of Idaho

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Assigned: January 13, 2011Due: January 26, 2011

MATH 480: Homework 1SPRING 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 makecomparisons easier and to save paper.

1. Solve each of the following ODEs for y(x):

(a) y′′ + 16y = 0 with y(0) = 1 and y′(0) = 0.

(b) y′′ + 6y′ + 9y = 0 with y(0) = 1 and y′(0) = 0.

(c) y′′′ − y′′ + y′ − y = 0 with y(0) = 1 and y′(0) = y′′(0) = 0.

2. Integration by parts allows us to transfer the derivative from one part of the integrandto another: ∫ b

af(x) g′(x) dx =

[f(x) g(x)

]ba−∫ b

af ′(x) g(x) dx.

Prove that the above statement is true. (HINT: think product rule!)

3. A linear PDE can be written in differential operator notation L(u) = f , where Lis the linear differential operator, u is the unknown function, and f is the right-hand side function. For each of the following PDEs, determine the linear operatorand the right-hand side function, the order of the PDE, and whether the PDE ishomogeneous or nonhomogeneous:

(a) uxxx + uyyy − u = 0

(b) utt − uxx + uyy + uzz = xyz

(c) x2uxx − y2uy = cos(x)− sin(y)

(d) y2uxx − x2uy = cos(y)− sin(x)

(e) ut − cos(xt)uxxx − t5 = t2u

4. The following convection-diffusion-decay equation appears in many physical appli-cations:

ut = Duxx − cux − λu .

Show that this equation can be transformed into a heat equation for w(x, t) byapplying the transformation

u(x, t) = w(x, t)eαx−βt .

HINT: You will only obtain a heat equation for w(x, t) with an appropiate choicefor the constants α and β in terms of the constants D, c, and λ. Determine thechoice for α and β that produces a heat equation for w(x, t).

1

Assigned: January 13, 2011Due: January 26, 2011

5. Consider the heat equation:

ut =(K0(x)ux

)x

u(0, t) = 0

u(1, t) = 1 ,

where K0(x) = K0(x) = ex/ cos(x).

(a) Determine the steady-state solution.

(b) Plot the steady-state solution in MATLAB. Always clearly label all plots.

6. Consider the heat equation:

ut =(K0(x)ux

)x

+Q(t)

u(1, t) = 0

u(2, t) = 1 ,

where K0(x) = x2.

(a) Under what condition on the heat source Q(t) does a steady-state solution existfor this problem? Clearly explain your answer.

(b) Under this condition, determine the steady-state solution.

7. Consider the function:u(x, t) = sin(4πx) e−πt .

(a) Plot this function in MATLAB over the domain (x, t) ∈ [0, 1]× [0, 1] using themesh command. Always clearly label all plots. (HINT: see page 4 of the“Introduction to Plotting with MATLAB” guide.)

(b) Explain what you observe.

8. If L is a linear operator, prove that L(∑M

n=1 cnun

)=(∑M

n=1 cnLun)

.

(HINT: use induction to prove this result.)

9. Evaluate (be careful if n = m)∫ L

0sin(nπxL

)sin(mπx

L

)dx

where n, m are both integers with n > 0 and m > 0. Use the trigonometric identity

2 sin a sin b = cos(a− b)− cos(a+ b).

10. Separation of Variables. By using u(x, t) = X(x)T (t) or u(x, y, t) = X(x)Y (y)T (t),separate the following PDEs into two or three ODEs for X and T or X, Y , and T .The parameters c and k are constants. You do not need to solve the equations.NOTE: one of the equations cannot be separated. Indicate this when you discoverthat equation.

2

Assigned: January 13, 2011Due: January 26, 2011

(a) utt = (xux)x

(b) utt = c2uxx

(c) ut = k(uxx + uyy)

(d) ut = k(yux + uy)

(e) ut + cux = kuxx

(f) ut = k(yux + xuy)

3

I

.">sk ):47 te J * f Qfrt2 4.r//r) = - / ?rah ?r a t/Qeaa ?*

=,t -> O =l

'Q)=o-*-+ ?!a=4 4-Q.ae

7a) =-6;

/e/-/ r '4 /toJ 7o ')

i///a.rh WO

a El /'ra:fJr) +/ril / 1!1

7-e ^- / r?Da/r)""r/ ( /

f, ' vv-- 4

142/ yr"r)/' aa-

-- ;- / 1t2s4

7 !o/ =

-2'L E -12,?-'/z A -- '2,

--r.rz

- -r,r]- J1.

/'aAr(7-

-t-v7"2'1,, ?J 2-7221- 17 -/t/W -'2

o?,-GV4,ar/

'2"?U V /q11'rq q -t2t -

4*-

c64 -sqp -

42', 4u4V 4o-</tF

<t,,f_Jc/-zz-11-z?'2/ '/nA4?

)-a-P-zt lhv+

,v-*-1- 4440 + trlp) -f -

,9

6

= /4I( f dddr-/t

,fX =/t,,(l

'/i< k4ab z / r l

- Atte

t*x * 6W J-e I rt; * G* q22-ae *.1) u-

Wrra da.*'ra'a d/a" ,122/ )*t M:bQaO. azrl zf ar{ O '," rt

__a"j4,,

=./ go 1r

A/*/z,O /

f//r)* "/r2z'z.rrrt/

/+JT->x,----7r -ffia:7:e -=@z{F-

Ft=:: , . - -

trotr)'4r"*

-

'A -rur)e*-/': z /a2'-1 .sd/t1..* d2zzj

= i* i-

Cr te,Y.4-/-----^r,fr"

, . I 1./ . : ' , -

J/ ( , t "J, ( ' , /a

( ;

,L(.t.. / / /J- i -,--) /r i ' / ) -: ' /

__J

i

l /L r4, / '

I'...''*'--'.

', ['"-" f'-xrlt" + " tr'"r ) t/

f '/ ,/r, i /' - tt.L I

1/

Assigned: January 13, 2011Due: January 26, 2011

Problem # 5 (b)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% HW#1: Problem 5 (b)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all; clf;

x=0:0.01:1;

w=exp(1)*(1+exp(-x).*(sin(x)-cos(x)))/(exp(1)+sin(1)-cos(1));

plot(x,w)

xlabel(’x’)

ylabel(’w(x)’)

title(’Problem 5(b): steady-state solution w(x) vs. x’)

print -depsc2 hw1_pr5b.eps

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

x

w(x

)

Problem 5(b): steady−state solution w(x) vs. x

Figure 1: Steady-state solution w(x) in problem # 5 (b)

8

f

/z l1J-

.u/+.tfq -ztkt*i=l

Kok)= t t-

fuz '-z6z>dr 69'{22.1)r>z ufk)=,hIn'%/r/A ) 147 "L/- T4'n

:(Kr(r)or"l" r W

tt, (14-- Q!=za.+

-ar/{6 C-4 4n 0//=qe=edw1.2 c- '

rta,klar-), v->r

-,totrJ u.r= - SFrrAr', / -xr

' 'l;-

t , /k:= r , 1- f x*Ca)--( * L' . / x 42_

(f)4 ?z /( 1u , L4 .

u/l,r/ =9 4rl4_4 -.!

/z lzA'

Assigned: January 13, 2011Due: January 26, 2011

Problem # 7 (a)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% HW # 1: Problem 7 (a)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all;

x=linspace(0,1,50);

t=linspace(0,1,50);

for i=1:50

for j=1:50

u(i,j)=sin(4*pi*x(i))*exp(-pi*t(j));

end

end

mesh(x,t,u);

xlabel (’x ’)

ylabel (’t’)

zlabel(’u(x, t)’)

title(’Problem 7 (a): u(x,t)’)

print -depsc2 hw1_pr7a.eps

00.2

0.40.6

0.81

0

0.2

0.4

0.6

0.8

1−1

−0.5

0

0.5

1

x

Problem 7 (a): u(x,t)

t

u(x,

t)

Figure 2: Plot of u(x, t) from problem # 7 (a)

Problem # 7 (b)

At t = 0, u = sin(4πx). This sine wave rapidly decays to 0 as t→∞, i.e. limt→∞

u(x, t) = 0.

10

Frodr ' /n

1( Z o-y. ): Z C, 4.2a,h-/

/ane n=' , t ,,( o 4- .hhz44- eEzaz,Av

tttz,e? rAe rzz*r-ef ( //o ma"d,*roah bal az aCczahim

hx /t-J. 4 larzrr+€z zr, I --_F/:fu/ ae{Zir/ //r/ dl t/aa

tn>/

Pr'xt'e * ) ar/ae t6, //= 4-r/. /to*e4

ha-- * n/.*1

NEr'

l+zh 4a-a" * &r+ /)zr.*, & /z--4-

-

.Z ( 2 /,q.q

Jll J!- [4-t,l

b7za7f-.=4Q/z- 1l:24:%

/t) / ft/ V /tq-!' ''/-- t

--?/t-/./

a//,, f'8 4[z2f_; P4tu'nUa/4(ryf-#tlTto

L1? -

f. 4 >''/ /a+2/lur- /9-a,ma / (-ZLla a'1+

L.t" ' 'Jr

-17/€) xs" i" ('4 :- \--') Y 4 4/ N4t t

.f,1

q7

7

t4 -// V =-Yr -3= ttq ,--z- trq,Y!t/ 4J! q

7 t//F. // uF:-

..,

-r_( y r=1,q,2_?_z/T=z

-17/):?"f 7 "'a" i

C>( to't/ ' Pza-z/ * 1t'/'k ; A2/44fU

+x;Y1'()-='o/ "U: l( - . t t / f+ a 7/t') --a

;rZ4 * n/t /--.1t

41. 7 ,4 7/r)--'ts

t6) z/O = rt /27*

tV -A

A+, C' &r) *t

4 * 37k/=OPk'

,__ ty/:/ yj//?Z_

-tr7'7 -aL4 ' lz

7-//7117* 4/r/

/1'?f

lL"{ ' t ' .* / " -al | / aq'L

/4/ tJ1lz -t'

t I 1.7/^, I

\.__ _- - -________:__

14:t7: , /sk-r) i , l" l, I7 ' / J ' - ' J

1

4'1g:zu-t 2,7)

y' 4r cz_+ .{ -/-d

-/17 2t/4- . ' / * J- ./ "d- '

a_L 71o

/,

kt /4+ 114-=421a.+ zzart= zTk) 712V /-) /-V ,ftrt r " / -77*c

ZZ 7117 :

:---:

714 4ff /

+- a T/f/ ,=ct

TrDfAT 4,tt'7

d.7.

i i Zt"J {i 7'1q

otY/,r- dy,

Y/.:zJ

" \ l -a7/4=o r*-=-

/ '