# solve

`modax.solve` is the primary function modax exposes. It integrates an ensemble of
trajectories of one right-hand side function, using the specified method, `method=`:
{py:class}`~modax.Tsit5`, {py:class}`~modax.Rodas5P` (the default) or
{py:class}`~modax.Auto`, which switches between them. Each method carries its own
options (see {doc}`methods`). Importing `modax` enables JAX float64 by default, and the solvers compute in
double precision unless {py:func}`modax.set_precision` is called to override it to single precision.

```{eval-rst}
.. autofunction:: modax.solve
```

Every problem size and set of options compiles a kernel of its own, cached
for the life of the process. A process that sweeps problem sizes can drop
them.

```{eval-rst}
.. autofunction:: modax.clear_caches
```

## Step control

```{eval-rst}
.. autoclass:: modax.PIDGains
```

## Composing solves

One-way coupled ODEs can be solved together as a graph of systems, with each block's callbacks
taking the outputs of input blocks as a fourth argument. See
[Composing solves](../usage/sparse.md#composing-solves).

```{eval-rst}
.. autoclass:: modax.Block

.. autofunction:: modax.by_forward_mode
```

## Precision

```{eval-rst}
.. autofunction:: modax.set_precision

.. py:data:: modax.precision
   :type: str

   The precision in force, ``"double"`` or ``"single"``. It reads the
   setting each time, so it follows :func:`modax.set_precision`.
```
