3
$\begingroup$

I typed

StreamPlot[{y, x-x^3-0.3y+0.5Cos[1.25t]}, {x, -2.5, 2.5}, {y, -2.5, 2.5}]

but all I got was a blank plot. What did I do wrong and can I fix it?

$\endgroup$
2

3 Answers 3

11
$\begingroup$

If you don't want to specify t there is e.g. ListAnimate (or Animate etc.)

ListAnimate[ 
    Table[ StreamPlot[{y, x - x^3 - 0.3 y + 0.5 Cos[1.25 t]}, 
                               {x, -2.5, 2.5}, {y, -2.5, 2.5}], {t, 0.1, 2, 0.05}]
           ]

enter image description here

$\endgroup$
1
  • $\begingroup$ it looks like that would make an interesting bifurcation plot ... $\endgroup$
    – rcollyer
    Jul 15, 2013 at 16:32
8
$\begingroup$

Or you could use the beautiful LineIntegralConvolutionPlot function - Documentation center link: Here

Manipulate[
LineIntegralConvolutionPlot[{y, 
x - x^3 - 0.3 y + 0.5 Cos[1.25 t]}, {x, -2.5, 2.5}, {y, -2.5, 2.5},
ColorFunction -> ColorData["Rose"], StreamPoints -> 10, 
StreamStyle -> White], {t, -2.5, 2.5}]

LineIntegralConvolutionPlot

$\endgroup$
2
  • $\begingroup$ Blagodarq ti, Nikola. $\endgroup$ Jul 16, 2013 at 6:09
  • $\begingroup$ Nyama zashto :) $\endgroup$
    – Sektor
    Jul 16, 2013 at 10:41
8
$\begingroup$

...Is there any other function I should use? Anything in 3D? – Student

One might stack the phase fields for a sequence of values of t, but as you can see, Artes's animation might be a better visualization.

Show[
 Table[
  Graphics3D[
   First@(StreamPlot[{y, x - x^3 - 0.3 y + 0.5 Cos[1.25 t]},
            {x, -2.5, 2.5}, {y, -2.5, 2.5}, 
            StreamStyle -> Hue[Rescale[t, {-1.2, 1.2}]]] /. 
          Arrow[pts_] :> 
            Arrow[Transpose[Transpose@pts~Append~ConstantArray[t, Length@pts]]])],
  {t, -1, 1, 0.5}],
 Axes -> True, BoxRatios -> {1, 1, 1}]

Mathematica graphics

See also some of the answers to this question for more on combining 2D plots into 3D graphics.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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