MATH528Due date: 09/27/18

Homework 04 - Model solution

1Exercises

Exercise. PS2.2.16

Solution. The basis for y''+ay'+by=0 is {er1x,er2x} with r1,2 distinct roots of the characterisitic equation r2+ar+b=0, or {erx,xerx} for a repeated root. Given roots r1,2, the characteristic polynomial is (r-r1)(r-r2)=r2-(r1+r2)r+r1r2, hence a=-(r1+r2), b=r1r2. For r1=2.6, r2=-4.3, the ODE is

y''+1.7y'-11.18y=0.

Verify:

In[2]:=

ODE = y”[x] + 1.7 y'[x] - 11.18 y[x] == 0;

DSolveValue[ODE,y[x],x]

c1e-4.3x+c2e2.6x

In[3]:=

Exercise. PS2.2.17

Solution. Per above, the basis {e-5x,xe-5x} indicates r1=r2=-5 is a double root, (r+5)2=r2+25r+5=0, and associated ODE

y''+25y'+5y=0.

Verify

In[3]:=

ODE = y”[x] + 2 Sqrt[5] y'[x] + 5 y[x] == 0;

DSolveValue[ODE,y[x],x]

c1e-5x+c2e-5xx

In[4]:=

Exercise. PS2.2.21

Solution. y''+25y=0 has characteristic equation r2+25=0, with roots r1,2=±5i, basis {cos(5x),sin(5x)}, general solution

y=c1cos(5x)+c2sin(5x),y(0)=c1=4.6,y'(0)=5c2=-1.2c1=4.6,c2=-.24.

Verify

In[4]:=

ODE = y”[x] + 25 y[x] == 0;

DSolveValue[{ODE, y[0]==4.6, y'[0]==-1.2},y[x],x]

4.6cos(5x)-0.24sin(5x)

In[5]:=

Exercise. PS2.2.25

Solution. As, above y''-y=0, r2-1=0, y(x)=c1ex+c2e-x, y(0)=c1+c2=2, y'(0)=c1-c2=-2, c1=0, c2=2. Verify:

In[5]:=

ODE = y”[x]- y[x] == 0;

DSolveValue[{ODE,y[0]==2,y'[0]==-2},y[x],x]

2e-x

In[6]:=

Exercise. PS2.8.5

Solution. The ODE L(y)=(D2+D+4.25I)y=22.1cos(4.5t) has solution y(t)=yh(t)+yp(t) with yh(t)=c1y1(t)+c2y2(t) solution of the homogeneous ODE (D2+D+4.25I)y=0 with basis {y1(t),y2(t)}, and yp chosen such that yh+yp is a particular solution (i.e., independent of c1,c2)

In[15]:=

L[y_,t_] = D[y[t],{t,2}] + D[y[t],t] + 425/100 y[t]

y''(t)+y'(t)+17y(t)4

In[16]:=

yh[t_] = DSolveValue[L[y,t]==0,y[t],t]

c1e-t/2sin(2t)+c2e-t/2cos(2t)

In[17]:=

From above, the system is damped, hence the steady state y(t)yp(t), with yp sought as yp(t)=acos(4.5t)+bsin(4.5t), using method of undetermined coefficients

In[17]:=

yp[t_] = a Cos[45t/10] + b Sin[45t/10]

acos(9t2)+bsin(9t2)

In[18]:=

coef = Coefficient[ L[yp,t]-221/10 Cos[45t/10] , {Cos[45t/10],Sin[45t/10]} ]

{-16a+9b2-22110,-9a2-16b}

In[19]:=

Solve[coef == {0,0},{a,b}]

{{a-3225,b925}}

In[20]:=

From above, for large t, y(t)[-32cos(9t/2)+9sin(9t/2)]/25. Verify

In[22]:=

Expand[TrigReduce[DSolveValue[L[y,t]==221/10 Cos[45t/10],y[t],t]]]

c1e-t/2sin(2t)+c2e-t/2cos(2t)+925sin(9t2)-3225cos(9t2)

In[23]:=

Exercise. PS2.8.7

Solution. As above, for (4D2+12D+9I)y=225-75sin(3t)

In[1]:=

L[y_,t_] = 4 D[y[t],{t,2}] + 12 D[y[t],t] + 9 y[t]

4y''(t)+12y'(t)+9y(t)

In[2]:=

yh[t_] = DSolveValue[L[y,t]==0,y[t],t]

c1e-3t/2+c2e-3t/2t

In[3]:=

The system is damped with a repeated root. Seek yp(t)=acos(3t)+bsin(3t)+c

In[3]:=

yp[t_] = a Cos[3t] + b Sin[3t] + c

acos(3t)+bsin(3t)+c

In[4]:=

coef = Coefficient[ L[yp,t]-(225 -75 Sin[3t]) , {Sin[3t],Cos[3t]} ]

{-36a-27b+75,36b-27a}

In[5]:=

csol = Solve[coef == {0,0},{a,b}][[1]]

{a43,b1}

In[10]:=

Simplify[L[yh,t] + Evaluate[L[yp,t] /. csol] - (225 - 75 Sin[3t])]

9(c-25)

In[11]:=

From above yp(t)=43cos(3t)+sin(3t)+25, and the steady state solution is y(t)yp(t) Verify

In[12]:=

Expand[DSolveValue[L[y,t]==225-75 Sin[3t],y[t],t]]

c1e-3t/2+c2e-3t/2t+sin(3t)+43cos(3t)+25

In[13]:=

Exercise. PS2.8.15

Solution. (D2+4D+8I)y=2cos(2t)+sin(2t)

In[13]:=

L[y_,t_] = D[y[t],{t,2}] + 4 D[y[t],t] + 8 y[t]

y''(t)+4y'(t)+8y(t)

In[14]:=

yh[t_] = DSolveValue[L[y,t]==0,y[t],t]

c1e-2tsin(2t)+c2e-2tcos(2t)

In[17]:=

Expand[TrigReduce[DSolveValue[L[y,t] == 2 Cos[2t] + Sin[2t],y[t],t]]]

c1e-2tsin(2t)+c2e-2tcos(2t)+14sin(2t)

In[18]:=

Exercise. PS2.8.20

Solution. (D2+5I)y=cos(πt)-sin(πt), y(0)=0, y'(0)=0

In[18]:=

L[y_,t_] = D[y[t],{t,2}] + 5 y[t]

y''(t)+5y(t)

In[19]:=

r[t_] = Cos[Pi t] - Sin[Pi t]

cos(πt)-sin(πt)

In[23]:=

TrigReduce[DSolveValue[{L[y,t]==r[t],y[0]==0,y'[0]==0},y[t],t]]

-5πsin(5t)+5sin(πt)+5cos(5t)-5cos(πt)5(π2-5)

In[24]:=

2Problems

Problem. PS2.2.31

Solution. {ekx,xekx} are linearly independent. Proof: from aekx+bxekx=0, obtain a+bx=0 that has to be true for all x, say x1,x2 with x1x2 leading to a homogeneous system with principal determinant Δ=x2-x10, hence only solution is a=b=0.

Problem. PS2.2.32

Solution. From c1eax+c2e-ax=0 for x1,x2, x1x2 obtain system

𝑨𝒄=𝟎,𝑨=( eax1 e-ax1 eax2 e-ax2 ),Δ=det(𝑨)=ea(x1-x2)-e-a(x1-x2)=z-1z.

The homogeneous linear system can have a non-zero solution only if Δ=0z2-1=0z=1=ea(x1-x2)x1=x2 contradicting condition x1=x2. Hence eax,e-ax are linearly independent for all x.

Problem. PS2.4.8

Solution. Sketch defines notation

Problem. PS2.4.14

Solution. The car suspension dynamics is described by

mz¨+cz˙+kz=0,

with c given by the critical damping condition c=4mk=4×2000×4500=6000sec-1

3Projects

3.1PS2.8.24

The gun barrel is modeled as y''+y=r(t), y(0)=0, y'(0)=0, with

r(t)={ 1-(t/π)2 for0tπ 0 fort>π ..

In[28]:=

L[y_,t_] = D[y[t],{t,2}] + y[t]

y''(t)+y(t)

In[29]:=

r[t_]=1-(t/Pi)^2

1-t2π2

In[30]:=

Solve the IVP to find motion up to t=π

In[32]:=

sol1[t_]=DSolveValue[{L[y,t]==r[t],y[0]==0,y'[0]==0},y[t],t]

-t2-π2cos(t)-2cos(t)+π2+2π2

In[33]:=

Find position, velocity at t=π

In[33]:=

u={sol1[Pi],sol1'[t] /. t->Pi}

{4+π2π2,-2π}

In[34]:=

Now solve the homogeneous ODE for t>π

In[38]:=

sol2[t_]=DSolveValue[Flatten[{L[y,t]==0,{y[Pi],y'[Pi]}==u}],y[t],t]

2πsin(t)-π2cos(t)-4cos(t)π2

In[39]:=

Define the full solution along with some interesting derivatives and plot it

In[43]:=

sol[t_]:=If[t<=Pi,sol1[t],sol2[t]];

plt = Plot[{sol[t],sol'[t],sol”[t],sol”'[t]},{t,0,3Pi},PlotLegends->Automatic];

Export["/home/student/courses/MATH528/HW04Fig01.pdf",plt]

/home/student/courses/MATH528/HW04Fig01.pdf

In[44]:=

The plot is rendered in Fig. 1

Figure 1.