Skip to content
Snippets Groups Projects
Commit 5b254146 authored by Ben Cumming's avatar Ben Cumming Committed by Sam Yates
Browse files

Padé approximation of exp in 'cnexp' integration (#268)

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.
parent 07dd8f35
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment