Skip to content
Snippets Groups Projects
  • Ben Cumming's avatar
    Padé approximation of exp in 'cnexp' integration (#268) · 5b254146
    Ben Cumming authored and Sam Yates's avatar Sam Yates committed
    Fixes #265.
    
    In the `modcc`-generated mechanism code, the `cnexp` solver method uses an expensive call to `exp` to integrate dependent variables over one time step. This commit replaces the exponential with a second-order Padé approximation.
    
      * Modify `modcc` to insert `exp_pade_11` and `exp_pade_22` functions into every module, which define Padé approximations of second and fourth order respectively (m=n=1 and m=n=2).
      * Have `cnexp` solver use `exp_pade_11` instead of the built in `exp` unary operator.
    
    The validation tests pass for both the 2nd and 4th order approximations; the second order approximation will suffices.
    5b254146