Message Boards Message Boards

Plot solution curves from a differential equation?

Posted 9 years ago

I am new to Mathematica and I am trying to plot some solution curves but I am only getting a straight line solution, can anyone help me with what I am doing wrong? Here is the code that I was trying to get to work:

Show[{VectorPlot[Normalize[{y, -8 y - 7 x}], {x, -3, 3}, {y, -3, 3}, 
   VectorPoints -> 14, VectorStyle -> Arrowheads[0.015], 
   VectorScale -> 0.035], 
  Table[ParametricPlot[
    Evaluate[{x[t], y[t]} /. 
      NDSolve[{x'[t] == y[t], y'[t] == -8 y[t] - 7 x[t], x[0] == a, 
        y[0] == b}, {x, y}, {t, -3, 5}]], {t, -3, 5}, 
    PlotStyle -> Thick, AxesLabel -> {x, y}, PlotRange -> 3], {a, -2, 
    2, 1}, {b, -2, 2, 1}], 
  Graphics[{Blue, PointSize[Large], Point[{0, 0}]}]}, PlotRange -> 3]
POSTED BY: Kai Miller

It looks like a vector plot here (Mathematica 10.4.1.0 Windows 10 Prof 2^6 Bit)

Show[{VectorPlot[Normalize[{y, -8 y - 7 x}], {x, -3, 3}, {y, -3, 3}, 
   VectorPoints -> 14, VectorStyle -> Arrowheads[0.015], 
   VectorScale -> 0.035], 
  Table[ParametricPlot[
    Evaluate[{x[t], y[t]} /. 
      NDSolve[{x'[t] == y[t], y'[t] == -8 y[t] - 7 x[t], x[0] == a, 
        y[0] == b}, {x, y}, {t, -3, 5}]], {t, -3, 5}, 
    PlotStyle -> Thick, AxesLabel -> {x, y}, PlotRange -> 3], {a, -2, 
    2, 1}, {b, -2, 2, 1}], 
  Graphics[{Blue, PointSize[Large], Point[{0, 0}]}]}, PlotRange -> 3]

and the picture is

enter image description here

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract