Skip to content

Commit 1220f20

Browse files
committed
Updated documentation
1 parent 8a0fe09 commit 1220f20

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/Dense Output and t_eval.md

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Notes:
2626
- The dense outputs are relatively large and must be heap allocated at each time step. Therefore it is rather computationally expensive to store them. Leave `dense_output=False` unless required to improve performance.
2727
- This performance hit is much less noticeable if only `t_eval` is provided because in that case we can utilize a single stack allocation.
2828

29+
## Interpolating Extra Outputs with Dense Output
30+
31+
As discussed in the "Extra Output.md" documentation, CyRK can capture additional outputs from the differential equation process. These are non-dependent variables (non-y values) that are not used during integration error calculations but may be useful data for the user.
32+
This is triggered when `num_extra` is set to > 0 in either `pysolve_ivp` or `cysolve_ivp`. If `dense_output` is also set to True, then the final solution interpolators will also interpolate these extra outputs. This is done by making additional calls to the differential equation to determine what the values of the extra outputs are at each interpolated time step.
33+
More details can be found in "Extra Output.md"
34+
2935
### Using Dense Outputs
3036

3137
Example:
@@ -34,6 +40,10 @@ def cy_diffeq(dy, t, y):
3440
dy[0] = (1. - 0.01 * y[1]) * y[0]
3541
dy[1] = (0.02 * y[0] - 1.) * y[1]
3642

43+
# If using extra output: set `num_extra=2`
44+
# dy[2] = (1. - 0.01 * y[1])
45+
# dy[3] = (0.02 * y[0] - 1.)
46+
3747
import numpy as np
3848
from CyRK import pysolve_ivp
3949

0 commit comments

Comments
 (0)