I have existing code to plot bifurcation diagram for coupled first order differential equations. It seems to work for coupled differential equations. To test the code further, I use the simplest case which is a logistic map. However, it is in iteration format. Therefore, it needs to be converted to first order differential equation form. The plot shows me incorrect results. I still want to use the same code because I can use it for coupled differential equations. I do not understand why it does not work for single differential equation.

 Remove[x, data1, dsol, xt];

 LogisticODE[r_] := x'[t] - r*x[t] (1 - x[t]) + x[t] == 0;

 solution2[r_] := 
 NDSolve[{LogisticODE[r], x[0.] == 0.5}, x, {t, 0, tmax}, 
 MaxSteps -> Infinity]; 

 (* Bifurcation Plot *)

 tmax = 1000 T; tmin = tmax - 50 T;
 w = 7;
 T = 2 Pi/w;

 data1 = {};

 For[A1 = 0.0, A1 <= 4.0, A1 += 0.01,
 dsol = solution2[A1];
 xt = x[t] /. dsol[[1]];
 For[t = tmin, t <= tmax, t += T, AppendTo[data1, {A1, N[xt]}]]; 
 Clear[t]] // AbsoluteTiming

 {8.58766, Null}

 ListPlot[data1, PlotRange -> Automatic, Frame -> True, Axes -> False, 
 PlotStyle -> {PointSize[0.006]}]  

enter image description here

I have tried $ x'[t]- r x[t] (1 - x[t])$ and $ x'[t]- (r x[t] (1 - x[t])-x[t])/T^2$ But still, I do not get a proper bifurction diagram for logistic map because I believe that transformation from map to ODE is incorrect or code need to change slightly for single ODE equation. Why I am not getting a correct bifurcation diagram? What I am missing?

  • 1
    $\begingroup$ The code will be different depending on what you want -- the bifurcation diagram for the logistic equation (differential equation) or logistic map (difference equation). As it is, this looks like the correct diagram for the logistic equation with density-independent mortality, $dx/dt=rx(1-x)-x$, which you've got encoded in LogisticODE[r]. $\endgroup$
    – Chris K
    Nov 16, 2021 at 0:59
  • $\begingroup$ How can one have different bifurcation diagram for the same equation? Both differential and difference represent the same equation but in different format. Then how can one get different results? $\endgroup$
    – Aschoolar
    Nov 16, 2021 at 14:35
  • 1
    $\begingroup$ The differential and difference equations are related but not the same. One is $dx/dt=rx(1-x)$, the other is $x_{t+1}=x_t+rx_t(1-x_t)$ (or something like it). They have the same equilibria, but the stability differs. Assuming $r>0$, the differential equation has an unstable equilibrium at $x=0$ and a stable one at $x=1$. The difference equation is much more complicated, because the positive equilibrium can undergo a series of period-doubling bifurcations leading to chaos, which is impossible in the differential equation. $\endgroup$
    – Chris K
    Nov 16, 2021 at 14:44
  • $\begingroup$ see abel.harvard.edu/archive/118r_spring_05/docs/may.pdf for more info $\endgroup$
    – Chris K
    Nov 16, 2021 at 14:45


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.