1
$\begingroup$

This is a repost of a question I posted on MathOverflow, but was suggested to post here due to relevance.

I am trying to reproduce Figure 1 in the paper "Chaos in learning a simple two-person game" (English) Proc. Natl. Acad. Sci. USA 99, No. 7, 4748-4751 (2002) (MR1895748, Zbl 1015.91014), by Sato, Akiyama, and Doyne Farmer, showing the Poincare section of a two-player replicator dynamics in rock-paper-scissors game.

I am not able to reproduce the clean, axis aligned orbits. I'm not sure if this is happening because I'm not using a fourth order symplectic integrator or because of some other issue in my code. My code is available here. Any help would be greatly appreciated! For comparison, you can see below the relevant figures:

Figure in the paper

My figure

Edit My code was incorrectly computing $y^{\top} A x$ as $x^{\top} A y$, and the step-size was set too high, as per the comments by Lutz Lehmann below. Fixing these problems results in the following image:

Fixed plot

$\endgroup$
4
  • $\begingroup$ Did you check that xTAy is correctly computed? The .dot method can be strange if not used for scalar products, I would not be surprised if the result was yTAx. Better, more explicit, would be x.T @ A @ y but atm I'm not sure how arrays translate to column vectors, so that might also not work as expected. // Or use the products in the next lines, xTAy = x.dot(Ay). $\endgroup$ Commented Oct 19 at 6:13
  • $\begingroup$ Your time resolution of dt = 2 might be too coarse to approximate the Poincaré points by linear interpolation, making the image fuzzy. You might even miss some intersections because the solution crosses the plane twice on the segment? The better variant, but probably slower, is to use solve_ivp with section_condition as event function. Then you can also prescribe the crossing direction, so that you only get one shape instead of two. $\endgroup$ Commented Oct 19 at 6:25
  • $\begingroup$ These suggestions worked! Thank you for your help. $\endgroup$ Commented Oct 21 at 1:05
  • $\begingroup$ @LutzLehmann could you post your suggestion as an answer? I would upvote :) $\endgroup$
    – Anton Menshov
    Commented Oct 23 at 20:20

0

Your Answer

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