Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to plot a flip bifurcation diagram for a dynamical system of equations as follows:

x'[t] == v[t]
v'[t] == x[t] - A x[t]^3 + R*Cos[\[Omega]*t] - B v[t]

but am having trouble writing the code to get a bifurcation diagram to plot. I have numerical values for A,B, & Omega, and am trying to plot the diagram for R.

Other similar questions and references online don't seem to be helpful (either not nonlinear or not a system of equations).

share|improve this question
some code here… – Nasser Nov 21 '13 at 4:44
This seems to be the Rayleigh equation. You might be interested to look up its bifurcations. They should be studied pretty well. By the way, you might want to remove one parameter by rescaling. – Alexei Boulbitch Nov 21 '13 at 10:02

You will have to solve this equation using NDSolve and the several plot functions in Mathematica can take care of the visualization. Here is a sample code:

Let me put some number for the parameters in the equation:

A = 10;
B = 5;
R = 2;
\[Omega] = 2;

Using NDSolve to find the numeric solution, which is a interpolation object in Mathematica:

sol =
    x'[t] == v[t], v'[t] == x[t] - A x[t]^3 + R*Cos[\[Omega]*t] - B v[t], 
    x[0] == 0, v[0] == 0
{x[t], v[t]}, {t, 0, 10}]

To extract the solution, use ReplaceAll (/.) and Rule (->) functions. Here you have

{x[t], v[t]} /. sol[[1]]

Now insert the above to ParametricPlot function:

ParametricPlot[Evaluate[{x[t], v[t]} /. sol[[1]]], {t, 0, 10}]

For this particular set of parameters, I have: bifur plot

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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