# How can I draw phase portrait of a matrix with given several initial points?

m1 = {{1, 0.2}, {0.5, 0.8}}
m2 = {{0.5, 0.9}, {0.7, 0.7}}
m3 = {{1.0, 0.2}, {-0.2, 1.0}}
m4 = {{-0.5, 1.0}, {0.5, 0.8}}

pt1 = {1, 1};
pt2 = {1, 0.5};
pt3 = {1.3, 0.7};
pt4 = {0.7, 1.3};


I have tried ParametricPlot, DiscretePlot, StreamPlot, VectorPlot and thought that VectorPlot would fit, but I guess there's a better way. 'Cause VectorPlot shows the vectors, not the real-line trajectories. I mean for each matrix, the trajectories will show how the points will go. So there should be 4 pictures separately.

• Could you clarify what the phase portrait of a matrix is? Oct 13, 2017 at 8:39
• I mean the phase portrait as a picturized set of trajectories, each made by a particular initial point. Oct 13, 2017 at 8:47
• Still not quite sure what you mean... something along these lines? Oct 13, 2017 at 9:05
• Yeah you are right. Do you think the picture that I added will work? Oct 13, 2017 at 9:08
• @J.M. It's 'DiscreteTime Models' from "A course in mathematical biology" that my Linear Algebra Professor provided us. Oct 13, 2017 at 11:20

With my phase portrait package it would be done like this:

<< PhasePortrait

Show[
VectorPlot[m2.{x, y}, {x, -4, 4}, {y, -4, 4}],
PhasePortrait[
{x, y}, t, {{-4, -4}, {4, 4}},
GenerateInitialValues -> False,
InitialValues -> {pt2},
PlotStyle -> Green
]
]


I believe you have several sets of trajectories and you want to plot them together.

Let's assume your trajectories are trj[1],.... You can use Arrow to plot them with Graphics.

Table[trj[n] = Table[t {Cos[2 Pi t + n], Sin[2 Pi t + n]}, {t, 0.2, 1.2, 0.05}]
, {n, 5}];

Graphics[{Arrowheads[{0, 0.05, 0.05, 0.05}], Table[Arrow[trj[n]], {n, 5}]}, Frame -> True]


I am not sure if this is what you want. If you can provide more details, I can modify my answer.

for your case, you can try

pts = {pt1, pt2, pt3, pt4};
ms = {m1, m2, m3, m4};

Do[{A[1], B[1]} = pts[[i]];
trj[i] = Table[{A[n + 1], B[n + 1]} = ms[[i]].{A[n], B[n]}, {n, 100}], {i, 4}]

Graphics[{Arrowheads[{0, 0.05, 0.05, 0.05}], Table[Arrow[trj[i]], {i, 4}]},
Frame -> True, PlotRange -> {{-20, 20}, {-20, 20}}]

• The picture looks like it is what I want to mimic.... Thanks. Though, all I need is one variable 'n'. For example, {A(n+1), B(n+1)}=m1.{A(n), B(n)} where {A(1),B(1)}={1,1} (something like this). With this information, what I want to demonstrate is one axis with A(n) and the other with B(n) just like cosine and sine on your instance. Oct 13, 2017 at 9:14
• Your answer really helped me much Oct 13, 2017 at 11:18

You can try the option StreamPoints with VectorPlot:

VectorPlot[m2.{x, y}, {x, -4, 4}, {y, -4, 4},
StreamPoints -> {{{pt2, Directive[Thick, Green]}}, Automatic}]


For all four pairs of matrices and points:

data = Transpose[{{m1, m2, m3, m4}, {pt1, pt2, pt3, pt4}, {Red, Green, Blue, Orange}}];

Row[VectorPlot[#.{x, y}, {x, -4, 4}, {y, -4, 4},
StreamPoints -> {{{#2, Directive[Thick, #3]}}, Automatic}, ImageSize -> 250] & @@@ data]
`

• Thank you so much!! Oct 13, 2017 at 11:18
• @Aliicia, my pleasure. Welcome to mma.se.
– kglr
Oct 13, 2017 at 11:27