Answers for exercises for part 4
Answers for exercises for part 4
Here we take questions 1a-1h and give the answers bit by bit. Do not worry about the code here!!
First of all the Eigenvalues and Eigenvectors:
In[]:=
print[x_]:=Print[Style[x,Blue,15]];printes[mat_,number_]:=Module[{},es=Eigensystem[mat];print[number];print["Eigenvalues are "<>ToString[es[[1,1]]]<>" and "<>ToString[es[[1,2]]]];print[StringReplace["Eigenvectors are "<>ToString[es[[2,1]]]<>" and "<>ToString[es[[2,2]]],{"{"->"<","}"->">"}]];If[Head[es[[1,1]]]===Complex,If[Re[es[[1,1]]]<0,print[Style["Stable Spiral",Blue]],If[Re[es[[1,1]]]==0,print["Centre"],print["Unstable Spiral"]]]];If[Head[es[[1,1]]]=!=Complex,If[es[[1,1]]==es[[1,2]],print["Degenerate node"],If[es[[1,1]]==0||es[[1,2]]==00,Print[Style["Non isolated Fixed Point",Blue]],If[es[[1,1]]>0||es[[1,2]]>0,print["Saddle node"],print["Stable node"]]]]]]printes[{{0,1},{-2,-3}},"1a:"]printes[{{5,10},{-1,-1}},"1b:"]printes[{{3,-4},{1,-1}},"1c:"]printes[{{-3,2},{1,-2}},"1d:"]printes[{{5,2},{-17,-5}},"1e:"]printes[{{-3,4},{-2,3}},"1f:"]printes[{{4,-3},{8,-6}},"1g:"]printes[{{0,1},{-1,-2}},"1h:"]
1a:
Eigenvalues are -2 and -1
Eigenvectors are <-1, 2> and <-1, 1>
Stable node
1b:
Eigenvalues are 2 + I and 2 - I
Eigenvectors are <-3 - I, 1> and <-3 + I, 1>
Unstable Spiral
1c:
Eigenvalues are 1 and 1
Eigenvectors are <2, 1> and <0, 0>
Degenerate node
1d:
Eigenvalues are -4 and -1
Eigenvectors are <-2, 1> and <1, 1>
Stable node
1e:
Eigenvalues are 3 I and -3 I
Eigenvectors are <-5 - 3 I, 17> and <-5 + 3 I, 17>
Centre
1f:
Eigenvalues are -1 and 1
Eigenvectors are <2, 1> and <1, 1>
Saddle node
1g:
Eigenvalues are -2 and 0
Eigenvectors are <1, 2> and <3, 4>
Non isolated Fixed Point
1h:
Eigenvalues are -1 and -1
Eigenvectors are <-1, 1> and <0, 0>
Degenerate node
Next we show where each of them appears on the classification picture:
In[]:=
pl1=ShowShowPlot
4Δ
,-4Δ
,0,{Δ,0,10},AspectRatio1,PlotStyleBlue,AxesLabel(Style[#,20]&/@{"Δ","τ"}),Graphics[{Style[Text["Unstable Spirals",{6,2}],20]}],Graphics[{Style[Text["Stable Spirals",{6,-2}],20]}],Graphics[{Style[Text["Centers",{6,0}],20]}],Graphics[{Style[Text["Unstable nodes",{3,5}],20]}],Graphics[{Style[Text["Stable nodes",{2,-5}],20]}],Graphics[{Style[Text["Non-isolated fixed points",{2.8,6.5}],20]}],Graphics[{Style[Text["stars and degenerate nodes",{8,-4.5}],20]}],Graphics[Arrow[{{9,-5},{9,-6}}]],Graphics[Arrow[{{0.5,6.5},{0,6}}]],Graphics[{Thick,Blue,Line[{{0,-6},{0,6}}]}],ImageSize->600;list={{{0,1},{-2,-3}},{{5,10},{-1,-1}},{{3,-4},{1,-1}},{{-3,2},{1,-2}},{{5,2},{-17,-5}},{{-3,4},{-2,3}},{{4,-3},{8,-6}},{{0,1},{-1,-2}}};lab={"a","b","c","d","e","f","g","h"};Show[pl1,Table[Show[Graphics[Style[Text["1"<>lab[[n]],{Det[list[[n]]]+0.3,Tr[list[[n]]]+0.3}],20]],ListPlot[{{Det[list[[n]]],Tr[list[[n]]]}},PlotStyle->{Red,PointSize[0.02]}]],{n,Length[list]}],pl1,AxesLabel(Style[#,20]&/@{"Δ","τ"}),PlotRange->All]Out[]=
And finally we give the phase portraits for each of them:
These are just some functions defined to help draw the arrows and set the boundary conditions.
inborder=Union[Flatten[{#,Reverse[#]}&/@Flatten[Table[{#,n},{n,-1,1,0.5}]&/@{1.,-1.},1],1]];outborder=Union[Flatten[{#,Reverse[#]}&/@Flatten[Table[{#,n},{n,-0.1,0.1,0.025}]&/@{0.1,-0.1},1],1]];at0p5[c1_,c2_]:=Module{},tmid=Casest/.NSolve
Total[]
==0.5,t,_Real[[1]];(func[t,c1,c2]/.t->#)&/@{0.9tmid,1.1tmid}arrow[c1_,c2_]:=Graphics[Arrow[at0p5[c1,c2]]]at0p52[c1_,c2_]:=Module{tmid},tmid=t/.FindRoot2
func[t,c1,c2]
Total[]
-0.5,{t,1};(func[#,c1,c2])&/@{0.999tmid,1.001tmid}arrow2[c1_,c2_]:=Graphics[Arrow[at0p52[c1,c2]]]at0p53[c1_,c2_]:=Module[{},tmid=t/.FindRoot[func[t,c1,c2][[1]],{t,1}];(func[t,c1,c2]/.t->#)&/@{tmid-0.01,tmid+0.01}]arrow3[c1_,c2_]:=Graphics[Arrow[at0p53[c1,c2]]]at0p54[c1_,c2_]:=Module[{},tmid=t/.FindRoot[func[t,c1,c2][[2]],{t,1}];(func[t,c1,c2]/.t->#)&/@{tmid-0.01,tmid+0.01}]arrow4[c1_,c2_]:=Graphics[Arrow[at0p54[c1,c2]]]2
func[t,c1,c2]
1a:
In[]:=
StreamPlot[{y,-2x-3y},{x,-1,1},{y,-1,1},AxesLabel(Style[#,15]&/@{"x","y"}),AxesOrigin->{0,0},Axes->True,StreamScale->Full]
Out[]=
1b:
1c:
1d:
1e:
1f:
1g:
1h: