Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution...

6

Click here to load reader

Transcript of Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution...

Page 1: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

Hwk #6 solution notebookPlots for 5.3.2 (a)

In[1]:= Ψ@n_, x_D = Sin@n Pi xD

Out[1]= sinHn Π xL

In[2]:= Λ@n_D = n^2 Pi^2

Out[2]= n2 Π2

In[3]:= fn@n_D = 2 Integrate@Sin@n Pi xD Exp@xD, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n > 0<D

Out[3]= ��������������������������������������������������������������2 I1 - H-1L

nãM n Π

Π2 n2 + 1

In[4]:= fSum@M_, x_D := Sum@fn@nD Ψ@n, xD, 8n, 1, M<D

In[41]:= Plot@8fSum@4, xD, fSum@8, xD, Exp@xD<, 8x, 0, 1<D

Out[41]=

0.2 0.4 0.6 0.8 1.0

0.5

1.0

1.5

2.0

2.5

In[7]:= uSum@M_, x_D := Sum@fn@nD Ψ@n, xD � Λ@nD, 8n, 1, M<D

In[8]:= uEx@x_D = w@xD �. DSolve@8-w’’@xD � Exp@xD, w@0D � 0, w@1D � 0<, w@xD, xD@@1DD

Out[8]= ã x - x - ãx + 1

Page 2: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

In[43]:= Plot@8uSum@2, xD, uSum@4, xD, uSum@8, xD, uEx@xD<, 8x, 0, 1<D

Out[43]=

0.2 0.4 0.6 0.8 1.0

0.05

0.10

0.15

0.20

Problem 5.3.4In each of these problems, we follow the procedure outlined in the solution to 5.3.2 (a):

(1) Find eigenfunctions and eigenvalues of the operator(2) Represent the RHS as a series of those eigenfunctions(3) Use superposition to compute the solution as

uHxL = Ún=0¥

������fn

Λn ΨnHxL.

The derivation of the eigenfunctions and eigenvalues is the usual exercise in differential equations: assume atrig solution, use the BCs to determine the constants (up to a scalar multiple). You’ve seen an example in classso I won’t work through it for each problem (if you didn’t understand the example in class, working throughfinding the eigenthingies in these four problems will be good practice for you).

� Part (a)

The eigenfunctions are the nontrivial solutions to

Ψ ’’ + ΛΨ = 0ΨH0L = ΨH1L = 0

so the eigenfunctions are Ψn = sinHn Π xL, n = 1, 2, ..., and the eigenvalues are Λn = n2 Π2.

In[11]:= fa@x_D = x^2

Out[11]= x2

In[12]:= uaEx@x_D = wa@xD �. DSolve@8-wa’’@xD � x^2, wa@0D � 0, wa@1D � 0<, wa@xD, xD@@1DD

Out[12]= ���������1

12Ix - x4 M

In[13]:= Ψa@n_, x_D = Sin@ n Pi xD

Out[13]= sinHn Π xL

2 hwk6Soln.nb

Page 3: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

In[14]:= Λa@n_D = Hn PiL^2

Out[14]= n2 Π2

In[15]:= faCoeff@n_D = Integrate@fa@xD Ψa@n, xD, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n > 0<D �Integrate@ Ψa@n, xD^2, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n > 0<D

Out[15]= ����������������������������������������������������������������������������������2 IH-1L

nH2 - n2 Π2 L - 2M

n3 Π3

In[16]:= uaSum@M_, x_D := Sum@faCoeff@nD � Λa@nD Ψa@n, xD, 8n, 1, M<D

In[17]:= Plot@8uaEx@xD, uaSum@2, xD, uaSum@4, xD<, 8x, 0, 1<D

Out[17]=

0.2 0.4 0.6 0.8 1.0

0.01

0.02

0.03

0.04

� Part (b)

The eigenfunctions are the nontrivial solutions to

Ψ "+HΛ-2LΨ=0Ψ(0)=Ψ(2)=0

so ΨnHxL = sinI �������n Π

2 xM, n = 1, 2, ..., and Λn = 2 + ������������

n2 Π2

4.

In[18]:= Ψb@n_, x_D = Sin@n Pi x�2D;

In[19]:= Λb@n_D = 2 + n^2 Pi^2�4;

In[20]:= fb@x_D = 1�2 - x;

In[21]:= ubEx@x_D = wb@xD �. DSolve@8-wb’’@xD + 2 wb@xD � 1�2 - x, wb@0D � 0, wb@2D � 0<, wb@xD, xD@@1DD

Out[21]= ����������������������������������������������������1

4 J-1 + ã4�!!!!!

2 Nã-

�!!!!!2 x J2 ã

�!!!!!2 x x - 2 ã

�!!!!!2 x+4

�!!!!!2 x - ã

�!!!!!2 x + ã2

�!!!!!2 x + ã

�!!!!!2 x+4

�!!!!!2 + 3 ã2

�!!!!!2 x+2

�!!!!!2 - ã4

�!!!!!2 - 3 ã2

�!!!!!2 N

In[22]:= fbCoeff@n_D = Integrate@fb@xD Ψb@n, xD, 8x, 0, 2<, Assumptions ® 8Element@n, IntegersD, n > 0<D �Integrate@ Ψb@n, xD^2, 8x, 0, 2<, Assumptions ® 8Element@n, IntegersD, n > 0<D

Out[22]= ���������������������������������������1 + 3 H-1L

n

n Π

In[23]:= ubSum@M_, x_D := Sum@fbCoeff@nD � Λb@nD Ψb@n, xD, 8n, 1, M<D

hwk6Soln.nb 3

Page 4: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

In[24]:= Plot@8ubEx@xD, ubSum@2, xD, ubSum@4, xD<, 8x, 0, 1<D

Out[24]=

0.2 0.4 0.6 0.8 1.0

-0.14

-0.12

-0.10

-0.08

-0.06

-0.04

-0.02

� Part (c)

The eigenfunctions are the nontrivial solutions to

Ψ ’’ + ΛΨ = 0ΨH0L = Ψ ’ H1L = 0

so the eigenfunctions are ΨnHxL = sinJJn + ���12

N РxN, n = 0, 1, 2, ..., and the eigenvalues are Jn + ���12

N2

Π2.

In[25]:= Ψc@n_, x_D = Sin@Hn + 1�2L Pi xD;

In[26]:= Λc@n_D = Hn + 1�2L^2 Pi^2;

In[27]:= fc@x_D = x + Sin@Pi xD;

In[28]:= ucEx@x_D = wc@xD �. DSolve@8-wc’’@xD � fc@xD, wc@0D � 0, wc’@1D � 0<, wc@xD, xD@@1DD

Out[28]= ���������������������������������������������������������������������������������������������������������������������-Π2 x3 + 3 Π2 x + 6 Π x + 6 sinHΠ xL

6 Π2

In[29]:= fcCoeff@n_D = Integrate@fc@xD Ψc@n, xD, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n ³ 0<D �Integrate@ Ψc@n, xD^2, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n ³ 0<D

Out[29]= 8 H-1Ln

i

k

jjjjjj ���������������������������������������1

H2 Π n + ΠL2

+ ����������������������������������������������������������������������1

-4 Π n2 - 4 Π n + 3 Π

y

{

zzzzzz

In[30]:= ucSum@M_, x_D := Sum@fcCoeff@nD � Λc@nD Ψc@n, xD, 8n, 0, M<D

4 hwk6Soln.nb

Page 5: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

In[31]:= Plot@8ucEx@xD, ucSum@2, xD, ucSum@4, xD<, 8x, 0, 1<D

Out[31]=

0.2 0.4 0.6 0.8 1.0

0.1

0.2

0.3

0.4

0.5

0.6

In[32]:= Plot@8ucSum@2, xD - ucEx@xD, ucSum@4, xD - ucEx@xD<, 8x, 0, 1<D

Out[32]=

0.2 0.4 0.6 0.8 1.0

-0.0004

-0.0002

0.0002

0.0004

� Part (d)

The eigenfunctions are the nontrivial solutions to

Ψ ’’ + ΛΨ = 0Ψ ’ H0L = ΨH1L = 0

so the eigenfunctions are ΨnHxL = cosJJn + ���12

N РxN, n = 0, 1, 2, ..., and the eigenvalues are Jn + ���12

N2

Π2.

In[33]:= Ψd@n_, x_D = Cos@Hn + 1�2L Pi xD;

In[34]:= Λd@n_D = Hn + 1�2L^2 Pi^2;

In[35]:= fd@x_D = Piecewise@881, x £ 1�2<<D;

In[36]:= udEx@x_D = wd@xD �. DSolve@8-wd’’@xD � fd@xD, wd’@0D � 0, wd@1D � 0<, wd@xD, xD@@1DD

Out[36]= �����1

8

i

k

jjjjjjjjj8

i

k

jjjjjjjjj

Ø≤≤≤≤∞

±

≤≤≤≤

- ������x2

2x £ ���

1

2

���1

8- ���

x

2True

y

{

zzzzzzzzz+ 3

y

{

zzzzzzzzz

hwk6Soln.nb 5

Page 6: Hwk #6 solution notebook - math.ttu.eduklong/5310-Fall10/hwk6Soln.nb.pdf · Hwk #6 solution notebook Plots for 5.3.2 (a) In[1]: ... In each of these problems, we follow the procedure

In[37]:= fdCoeff@n_D = Integrate@fd@xD Ψd@n, xD, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n ³ 0<D �Integrate@ Ψd@n, xD^2, 8x, 0, 1<, Assumptions ® 8Element@n, IntegersD, n ³ 0<D

Out[37]= ���������������������������������������������������������������

4 sinJ ���1

4H2 Π n + ΠLN

H2 n + 1L Π

In[38]:= udSum@M_, x_D := Sum@fdCoeff@nD � Λd@nD Ψd@n, xD, 8n, 0, M<D

In[39]:= Plot@8udEx@xD, udSum@2, xD, udSum@4, xD<, 8x, 0, 1<D

Out[39]=

0.2 0.4 0.6 0.8 1.0

0.05

0.10

0.15

0.20

0.25

0.30

0.35

In[40]:= Plot@8udSum@2, xD - udEx@xD, udSum@4, xD - udEx@xD<, 8x, 0, 1<D

Out[40]=

0.2 0.4 0.6 0.8 1.0

-0.0010

-0.0005

0.0005

0.0010

0.0015

6 hwk6Soln.nb