Math 230, Spring 2000
Mathematica assignment 4
Solutions

The following problems are taken from pages 179 to 193 of the Differential Equations with Mathematica book.

Needs["Graphics`PlotField`"]

Problem 1.

Part a.

A1  =  {{2, -1}, {3, -2}};
A2  =  {{1, -1}, {5, -3}};
A3  =  {{-3, 5/2}, {-5/2, 2}};
MatrixForm[A1]
MatrixForm[A2]
MatrixForm[A3]

Eigensystem[A1]

\(\(\(So\)\(\ \)\(the\)\(\ \)\(general\)\(\ \)\(solution\)\(\ \)\(to\)\(\ \)\(the\)\(\ \)\(first\)\(\ \)\(system\)\(\ \)\(is\)\(\ \)\)\)

mysoln1[t_] = a(({{1}, {3}}))(e^(-t))+b(({{1}, {1}}))(e^t)

Eigensystem[A2]

So the general solution to the second system is 
a(({{2 - i}, {5}}))(e^((-1 - i) t))+b(({{2 + i}, {5}}))(e^((-1 + i) t)) 
\(which\ can\ be\ written\ in\ real\ form\ as\)

mysoln2[t_]= c (e^(-t))⟨(({{2}, {5}}))Cos[t] - (({{1}, {0}}))Sin[t]⟩+ d (e^(-t)) ⟨-(({{1}, {0}}))Cos[t] - (({{2}, {5}}))Sin[t]⟩

Eigensystem[A3]

So the general solution  has the form
(e^(t/2)) (v  +  tw)
\(for\ some\ vectors\ v\ and\ w . \ \ When\ I\ compute\ these\ vectors\ by\ hand, \ I\ get\)

mysoln3[t_]=(e^(t/2))⟨ a(({{1}, {1}}))+ b(({{-2/5}, {0}})) + b t(({{1}, {1}})) ⟩

Part b

sys1  =  {x'[t] == 2  x[t] - y[t], y'[t] == 
          3  x[t] - 2  y[t]}
sys2  =  {x'[t] == x[t] - y[t], y'[t] == 
          5  x[t] - 3  y[t]}
\(sys3\  = \ {\(x'\)[t] == \(-3\) x[t] + 5/2  y[t], \(y'\)[
            t] == \(-5\)/2  x[t] + 2  y[t]}
\)

First system:

soln1[t_]  = {x[t], y[t]} /. 
        First[DSolve[sys1, {x[t], y[t]}, t]]

To find the relationship between the constants in my solution to the first system and the constants in the computer'solution, I set t=0 in both
and compare:

mysoln1[0]
soln1[0]

Therefore C[1] = a+b and C[2] = 3a+b.

Second system:

\(soln2[
        t_]\  = 
	\ FullSimplify[{x[t], y[t]} /. 
          First[DSolve[sys2, {x[t], y[t]}, t]]]\)

To find the relationship between the constants in my solution to the first system and the constants in the computer'solution, I set t=0 in both
and compare:

mysoln2[0]
soln2[0]

Therefore C[1] = -d + 2c and C[2] = 5c.

soln3[t_]  =  
      Simplify[{x[t], y[t]} /. 
          First[DSolve[sys3, {x[t], y[t]}, t]]]

To find the relationship between the constants in my solution to the first system and the constants in the computer'solution, I set t=0 in both
and compare:

mysoln3[0]
soln3[0]

Hence C[1] = a - 2b/5 and C[2] = a.

Part c

To get the plots I put the Mathematica solutions in slightly different form:

sol1[a_, b_]  =  
      soln1[t] /. {C[1] -> a, C[2] -> b}
sol2[a_, b_]  =  
      soln2[t] /. {C[1] -> a, C[2] -> b}
sol3[a_, b_]  =  
      soln3[t] /. {C[1] -> a, C[2] -> b}

\(\(ParametricPlot[
\ \ Evaluate[
          Flatten[
	
            Table[sol1[a, b], {a, \(-2\), 2,  .5}, {b, \(-2\), 2,  .5}
	], 
            1]], 
	{t, \(-5\), 
          5}, 
\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 
              2}}, 
\ \ Ticks -> None, 
\ \ Frame -> 
          True	\ \ \ 
];\)\)

The origin is a saddle point--in particular, it's an unstable critical point.

\(\(ParametricPlot[
\ \ Evaluate[
          Flatten[
	
            Table[sol2[a, b], {a, \(-2\), 2,  .5}, {b, \(-2\), 2,  .5}
	], 
            1]], 
	{t, \(-5\), 
          5}, 
\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 
              2}}, 
\ \ Ticks -> None, 
\ \ Frame -> 
          True	\ \ \ 
];\)\)

The origin is a stable spiral point.

\(\(ParametricPlot[
\ \ Evaluate[
          Flatten[
	
            Table[sol3[a, b], {a, \(-2\), 2,  .5}, {b, \(-2\), 2,  .5}
	], 
            1]], 
	{t, \(-5\), 
          5}, 
\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 
              2}}, 
\ \ Ticks -> None, 
\ \ Frame -> 
          True	\ \ \ 
];\)\)

The origin is an  unstable improper node.

Problem 4.

Part a.

\(sys1\  = \ {\(x'\)[t]\  == \ 
          2  x[t] - y[t]\  + \ E^t, 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[
            t] == 3  x[t] - 2  y[t] + t, 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[
            0]\  == \ a, y[0] == b}\)
\(sys2\  = \ {\(x'\)[t]\  == \ 
          2  x[t] - 5  y[t]\  - 
            Cos[t], 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[t] == 
          1  x[t] - 2  y[t] + Sin[t], 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[
            0]\  == \ a, y[0] == b}\)
\(sys3\  = \ {\(x'\)[t]\  == \ \(-3\) x[t] + Sqrt[2]*y[t] + 
            E^\((\(-t\))\)\ , 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[
            t] == Sqrt[2]*x[t] - 2  y[t]\  - \ 
            E^\((\(-t\))\), 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[0] == 
          a, y[0] == b}\)

sol1[a_, b_]  =  {x[t], y[t]} /. 
        Simplify[First[DSolve[sys1, {x[t], y[t]}, t]]]

sol2[a_, b_]  =  {x[t], y[t]} /. 
        Simplify[First[DSolve[sys2, {x[t], y[t]}, t]]]

sol3[a_, b_]  =  {x[t], y[t]} /. 
        First[DSolve[sys3, {x[t], y[t]}, t]]

Part c.

\(\(ParametricPlot[
\ \ Evaluate[sol1[1, 1]], 
	{t, \(-1\), 
          1}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000	\ \ \ 
];\)\)

\(\(ParametricPlot[
\ \ Evaluate[sol1[1, 1]], 
	{t, \(-3\), 
          3}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000	\ \ \ 
];\)\)

Looks like the solution is headed to infinity asymptotic to a line of slope about 1 as t goes to infinity, 
and that as t goes to negative infinity,the solution goes to infinity asymptotic to a line of slope 4.

\(\(ParametricPlot[
\ \ Evaluate[sol2[1, 1]], 
	{t, \(-1\), 
          1}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000	\ \ \ 
];\)\)

\(\(ParametricPlot[
\ \ Evaluate[sol2[1, 1]], 
	{t, \(-20\), 
          20}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000	\ \ \ 
];\)\)

It looks like the solution will generally spiral out to infinity as t goes to either positive or negative infinity.

\(\(ParametricPlot[
\ \ \ Evaluate[sol3[1, 1]], 
	{t, \(-1\), 
          1}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000
];\)\)

\(\(ParametricPlot[
\ \ \ Evaluate[sol3[1, 1]], 
	{t, \(-1.5\), 
          1}, 
\ \ Ticks -> None, 
\ \ Frame -> True, 
        PlotPoints -> 1000
];\)\)

It looks like the solution converges to the origin as t goes to positive infinity and tends to infinity with slope 
about -1 as t goes to negative infinity.