Как я могу добавить горизонтальную линию (равновесие) в Vector Plot в Mathematica - PullRequest
0 голосов
/ 09 июня 2018

Равновесное решение для y '= 3-2y при y = 3/2, и я хотел бы добавить линию y = 3/2 в поле направления, построенное с использованием функции VectorPlot.Как сделать?

Дополнительный код ниже делает это.

points = {{0, 0}, {1, 0}, {2, 0}, {0, 1}, {1, 1}, {2, 1}, {0, 2}, {1, 
    2}, {2, 2}};

datplot = 
  VectorPlot[{1, 3 - 2 y}, {x, 0, 2}, {y, 0, 2}, 
   VectorPoints -> points, VectorScale -> {Automatic, Automatic, None},
   Epilog -> {Red, PointSize[Medium], Point[points]}];

fitplot = Plot[y = 3/2, {y, 0, 2}];
{Show[datplot, fitplot]}

Мэри А. Мэрион

Ответы [ 2 ]

0 голосов
/ 10 июня 2018

Следующий код вычислит решение *:

points = {{0, 0}, {1, 0}, {2, 0}, {0, 1}, {1, 1}, {2, 1},
    {0, 2}, {1,2}, {2, 2}};

datplot = 
  VectorPlot[{1, 3 - 2 y}, {x, 0, 2}, {y, 0, 2}, 
  VectorPoints -> points, VectorScale -> {Automatic, Automatic, None},
  Epilog -> {Red, PointSize[Medium], Point[points], 
    Line[{{0, 3/2}, {2, 3/2}}]}]
  • См. Ввод Билла выше.
0 голосов
/ 09 июня 2018

Изменить

Epilog -> {Red, PointSize[Medium], Point[points]}

на

Epilog -> {Red, PointSize[Medium], Point[points], Line[{{0,3/2},{2,3/2}}]}
...