2
$\begingroup$

I have the equation $$\dot{x}=F(x(t);\mu,\lambda)=\mu x-\lambda x^2+3$$ and I want to use StreamPlot and Manipulate to vary $\lambda$ and $\mu$.

The code for an example how it should look like:

Manipulate[
StreamPlot[{y, -λ - μ x + x^3}, {x, -3, 3}, {y, -3, 3}, 
   StreamScale -> Large, 
   PlotLabel -> Row[{"λ = ", λ, " ,  μ = ", μ}]], 
{λ, -1, 1}, {μ, -1, 1}]
$\endgroup$
  • $\begingroup$ How does your function depend upon $y$? $\endgroup$ – David G. Stork Mar 16 '17 at 18:43
  • $\begingroup$ It only depends on x, no y. $\endgroup$ – Manu Mar 16 '17 at 18:46
  • $\begingroup$ So why use a StreamPlot, which displays functions of two variables ($x$ and $y$)? $\endgroup$ – David G. Stork Mar 16 '17 at 18:47
  • $\begingroup$ Is there any other possibility to show the field lines with varying $\lambda$ and $\mu$? And when I use $y$ for a Dummy? $\endgroup$ – Manu Mar 16 '17 at 18:48
  • $\begingroup$ It makes no sense to use $y$ for a "dummy". You can plot ${\partial x \over \partial t}$ versus $x$. (See solution.) $\endgroup$ – David G. Stork Mar 16 '17 at 18:51
1
$\begingroup$

The problem as stated makes little sense. A StreamPlot shows $y$ and $x$. If you let the horizontal axis be $x$ and the vertical be the derivative of $x$, then:

Manipulate[
 StreamPlot[{x, -λ x^2 + μ x + 3}, 
    {x, -3, 3}, {y, -3, 3},
    StreamScale -> Large, 
    PlotLabel -> Row[{"λ = ", λ, " ,  μ = ", μ}]], 
  {λ, -1, 1}, {μ, -1, 1}]
$\endgroup$
  • $\begingroup$ I tried it with Manipulate[StreamPlot[{y, -λ x^2 + μ x + 3}, {x, -3, 3}, {y, -3, 3}, StreamScale -> Large, PlotLabel -> Row[{"λ = ", λ, " , μ = ", μ}]], {λ, -1, 1}, {μ, -1, 1}] I want to characterize my equlibrium points with analysing the and direction of the field lines, and this only possible when I use $y$ instead of $x$ in your code... I dont know if this make sense, but I get my fieldlines. $\endgroup$ – Manu Mar 16 '17 at 18:59

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.