[go: up one dir, main page]

Menu

#65 Disable detection of bifurcations

---
open
nobody
None
2025-07-03
2025-05-14
Marc
No

According to this question, bifus should be used to disable the detection of bifurcations during continuation:
'bifus', 'log|on', true, 'switch', {}, 'enable/disable detection of bifurcations'
In the tutorials, I find both
prob = coco_set(prob, 'po', 'bifus', 'off');
and
prob = coco_set(prob, 'po', 'bifus', false);
Are both syntaxes correct?
Can this be used with all po constructions, including ode_PD2po?
(I tried and EP, PD, SN were still detected during continuation.)

Discussion

  • Marc

    Marc - 2025-05-14

    *all po constructors

     
  • Harry Dankowicz

    Harry Dankowicz - 2025-05-15

    Yes, both syntaxes are correct. This is the meaning of 'log|on', as in logical (true/false) or on/off.

    A cursory glance suggests that this should work for all po constructors and I have no reason to believe this is not the case. If you are willing to share your script, I can have a look.

    Best,

    Harry

     
  • Marc

    Marc - 2025-06-30

    Hi
    Thanks for confirming the syntax.
    A quick test with coco/po/examples/hopf/demo.m confirmed that order matters.

    prob = coco_prob();
    %prob = coco_set(prob, 'po', 'bifus', 'off'); %test 1: OK
    prob = ode_HB2po(prob, '', 'ep_run', HBlab);
    %prob = coco_set(prob, 'po', 'bifus', 'off'); %test 2: too late
    
    fprintf(...
      '\n Run=''%s'': Continue periodic orbits from point %d in run ''%s''.\n', ...
      'po_run', HBlab, 'ep_run');
    
    bd3  = coco(prob, 'po_run', [], 1, 'p1', [-1 1]);
    

    The error was that I tried to add bifus after ode_HB2po. After putting it in the right place, the bifurcations are no longer detected indeed.

    This question can be closed.

    Best regards
    Marc

     
  • Marc

    Marc - 2025-06-30

    Or first a follow-up question, still in the file coco/po/examples/hopf/demo.m, where I have added following lines to plot po_run:

    figure(2); clf;
    thm = struct('special', {{'EP'}});
    coco_plot_bd(thm, 'po_run', 'p1', 'p2', '||x||_{2,MPD}')
    

    When po_run has been calculated with 'bifus', 'off', the plotting function gives following error:

    Error using coco_bd_col>coco_get_col
    coco_bd_col: column not found: 'po.test.USTAB'
    
    Error in coco_bd_col (line 32)
      col = coco_get_col(bd, name, cat_flag);
    
    Error in coco_plot_bd (line 195)
      S   = thm.ustabfun(coco_bd_col(bd, thm.ustab));
    

    Maybe the problem is related to the plotting of stable (full line) and unstable (dashed line) parts of the branch?
    What would be the easiest way to still plot the branch corresponding to po_run?

     
    • Harry Dankowicz

      Harry Dankowicz - 2025-07-02

      Hi Marc,

      Yes, the problem is that when the solution type is a periodic orbit, the plotting routine by default assumes the existence of a po.test.USTAB column in the corresponding bifurcation data array. You can turn this off by changing

      thm = struct('special', {{'EP'}});
      

      to

      thm = struct('ustab', '', 'special', {{'EP'}});
      

      I hope that helps.

      /Harry

       
      • Marc

        Marc - 2025-07-03

        Perfect, thank you!

         

Log in to post a comment.