Question on PyCont

  • Anonymous - 2011-12-13

    Hi Everyone,

    I had some trouble when going through the PyCont documentation, and wondered if anyone would be able to help me out.
    I have a system of ODEs and I'm looking to map out (as a function of two parameters) where the system has stable oscillations.

    Following the catalytic oscillator example, I am able to get the EQ1 curve that has (for one parameter) the Hopf bifurcation at the upper and lower bound of the first parameter. 

       1 PCargs = args(name='EQ1', type='EP-C')   # as many arguments can be supplied here as desired
       2 PCargs.freepars = ['q2']   # rest of the arguments created like a struct
       3 PCargs.StepSize = 1e-3
       4 PCargs.MaxNumPoints = 175
       5 PCargs.MaxStepSize = 1e-2
       6 PCargs.LocBifPoints = ['LP','H']
       8 PyCont.newCurve(PCargs)
       9 PyCont['EQ1'].forward()

    I then try to free the second parameter and compute the hopf curve, but I don't see where I could get a plot (x is first parameter, y is second) of where the solution has oscillations.

    [similar to:

       1 PCargs = args(name='HO1', type='H-C2')
       2 PCargs.initpoint = 'EQ1:H2'
       3 PCargs.freepars = ['q2', 'k']
       4 PCargs.MaxStepSize = 1e-2
       5 PCargs.LocBifPoints = ['GH', 'BT', 'ZH']
       6 PCargs.MaxNumPoints = 100
       8 PyCont.newCurve(PCargs)
       9 PyCont['HO1'].forward()

    Is this curve even the right thing to be calculating? Is there an easy way to see or get the data with respect to the two parameters?


  • Drew LaMar

    Drew LaMar - 2011-12-14

    Hi, Peter.  If you are looking for just a region in 2-parameter space where oscillations occur, then this (i.e. 'H-C2') is the right curve to be calculating.  The command to plot the hopf curve in parameter space is:

    PyCont['HO1'].display(('x','y'), figure='fig2');

    Here is what the plot looks like:

    The oscillations will be on one side of this curve.  You need to follow some limit cycles from one of the hopf points to figure out which side.  Also, when following this limit cycle curve, it can detect a change in stability through a LPC bifurcation point.  If you then follow the LPC curve in 2-parameter space, you should be able to see the region where stable oscillations occur. 

    To easily probe information from the HO1 curve, you just need to play with the following:


    Hope this helps!

    - Drew

  • Drew LaMar

    Drew LaMar - 2011-12-14

    One more thing.  I think the LPC curve will emanate from the GH points, so it's a good sanity check to make sure the LPC curve goes through these points.  Without following the LPC curves, the GH points at least give you some indication of where the stable/unstable regions are located.

    - Drew

  • Anonymous - 2011-12-14

    Great!! This explained a lot, thanks so much for your help.
    Is the speed of these calculations governed by the ODE integrator I use? (i.e. would it be much faster if I set up the C based integrators?)

    Thanks again,

  • Rob Clewley

    Rob Clewley - 2011-12-14

    Yes and no. For AUTO usage via PyCont (for non-fixed point continuation) the integrator is entirely independent of PyCont. In that case, PyCont will create the C code for your ODEs by itself (the same way as the C-based integrators). For the remaining simpler stuff, PyCont will call the RHS function from your existing model, so if that's a C-based integrator then that call will be slightly faster. Whether that will make a huge difference, given the heavy matrix algebra being done in the computations, I don't expect so. But I've never profiled it. You could try it and let us know what you find!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks