0
$\begingroup$

If I have 2-D system difference equations x(n+1)=x(n)-5y(n) , y(n+1)= 2x(n)+y(n) I need to plot this system. I did :

StreamPlot[{x - 5 y , 2 x + y} == {x, y}, {x, -1, 1}, {y, -1, 1}]

Is this code correct ? Thank you so much

enter image description here

$\endgroup$
1
  • $\begingroup$ What about just solving that system with RSolve? $\endgroup$
    – Alx
    Mar 18 '20 at 2:09
2
$\begingroup$

I don't think this is quite correct. To test my hypothesis, I created this:

NextXY[{x_, y_}] := {x - 5 y, 2 x + y}

Then, I created some points:

somePoints = {#, NextXY[#]} & /@ 
   Flatten[Table[{x, y}, {x, -1, 1, .2}, {y, -1, 1, .2}], 1];

And plotted them with arrows:

Graphics[Arrow[#] & /@ somePoints]

enter image description here This looks a whole lot more like this stream plot:

StreamPlot[{x - 5 y, 2 x + y}, {x, -1, 1}, {y, -1, 1}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Interesting, seems like my (now deleted) comment wasn't right. But this doesn't exactly match up a trajectory either. Try pts = NestList[NextXY, {0.002, 0}, 5]; ListLinePlot[pts, PlotRange -> All]. Maybe a StreamPlot just isn't a good idea for a discrete-time system. $\endgroup$
    – Chris K
    Mar 18 '20 at 1:56
  • $\begingroup$ Hi guys, solving by hands, i got the eigenvalues are complex. {1 + I Sqrt[10], 1 - I Sqrt[10]}. so it looks spiral unstable? $\endgroup$
    – S A
    Mar 19 '20 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.