Package PyDSTool :: Package Toolbox :: Module PRCtools
[hide private]
[frames] | no frames]

Module PRCtools

source code

Toolbox for phase response curves measured by finite perturbations

Functions [hide private]
 
one_period_traj(model, ev_name, ev_t_tol, ev_norm_tol, T_est, verbose=False, initial_settle=6, restore_old_ics=False, use_quadratic_interp=False)
Utility to extract a single period of a limit cycle of the model using forward integration, up to a tolerance given in terms of both the period and the norm of the vector of variables in the limit cycle at the period endpoints.
source code
 
_default_pert(model, ic, pertcoord, pertsize, t0) source code
 
finitePRC(model, ref_traj_period, evname, pertcoord, pertsize=0.05, settle=5, verbose=False, skip=1, do_pert=<function _default_pert at 0x95002b0>, keep_trajs=False, stop_at_t=inf, force_T=nan)
Return a Pointset with dependent variable 'D_phase', measured from 0 to 1, where D_phase > 0 is an advance.
source code
 
compare_pert(model, ref_traj_period, evname, pertcoord, pertsize, t0, settle=5, do_pert=<function _default_pert at 0x95002b0>, fignum=None)
Show perturbed and un-perturbed trajectories starting at t0, with given perturbation function do_pert.
source code
 
fix_PRC(PRC, tol=0.01)
Experimental and hopefully unnecessary utility to 'fix' PRC data with phase jumps of 1/2 or a whole cycle due to computational problems.
source code
Function Details [hide private]

one_period_traj(model, ev_name, ev_t_tol, ev_norm_tol, T_est, verbose=False, initial_settle=6, restore_old_ics=False, use_quadratic_interp=False)

source code 

Utility to extract a single period of a limit cycle of the model using forward integration, up to a tolerance given in terms of both the period and the norm of the vector of variables in the limit cycle at the period endpoints.

Requires a non-terminal event in the model that is detected exactly once per period. Assumes model initial conditions are already in domain of attraction for limit cycle.

T_est is an initial estimate of period. use_quadratic_interp option (default False) indicates whether to make the returned trajectory interpolated more accurately using quadratic functions rather than linear ones. This option takes a lot longer to complete!

The model argument can be an instance of a Generator class or Model class.

Returned trajectory will have name 'one_period'.

finitePRC(model, ref_traj_period, evname, pertcoord, pertsize=0.05, settle=5, verbose=False, skip=1, do_pert=<function _default_pert at 0x95002b0>, keep_trajs=False, stop_at_t=inf, force_T=nan)

source code 
Return a Pointset with dependent variable 'D_phase', measured from 0 to 1,
where D_phase > 0 is an advance.

Pass a Generator or Model instance for model.
Pass a Trajectory or Pointset for the ref_traj_period argument.
Pass the event name in the model that indicates the periodicity.
Use skip > 1 to sub-sample the points computed along the trajectory at
 the skip rate.
Use a do_pert function to do any non-standard perturbation, e.g. if there
 are domain boundary conditions that need special treatment. This function
 takes four or five arguments (model, ic, pertcoord, pertsize, perttime=None)
 and returns the new point ic (not just ic[pertcoord]).
Use settle=0 to perform no forward integration before the time window in
 which the perturbation will be applied, or a fraction < 1 to ensure an
 integration past the event point (e.g. for non-cycles).
Use stop_at_t to calculate a partial PRC, from perturbation time 0 to this
 value.
Use force_T to force the period to be whatever value you like.

Note: Depending on your model, there may be regions of the PRC that are
offset by a constant amount to the rest of the PRC. This is a "wart" that
needs improvement.