Model.estimate_step_size#
- Model.estimate_step_size(local_error=1e-06, dz=1e-05, n=10, a_v=None, z=0, db=False)[source]#
Estimate the step size that yields the target local error.
This method uses the same adaptive step size algorithm as the main simulation. For a more accurate estimate, increase n to iteratively approach the optimal step size.
- Parameters:
- local_errorfloat, optional
The relative local error. The default is 1e-6.
- dzfloat, optional
An initial guess for the optimal step size. The default is 10e-6.
- nint, optional
The number of times the algorithm iteratively executes. The default is to iterate 10.
- a_varray_like of complex, optional
The spectral amplitude of the pulse. The default is to use the spectral amplitude of the input pulse.
- zfloat, optional
The z position in the mode. The default is 0.
- dbbool, optional
Debugging flag which turns on printing of intermediate results.
- Returns:
- dzfloat
The new step size.