# opencr.analysis.transient

*module*

The result of a time-dependent solve.

A `TransientResult` keeps the densities of every state at the output
times, the electron density, the conditions and the integrator's report. Any
output time can be turned into a steady-state-like `Result`
(`TransientResult.at`) for fluxes, dominant processes and emission, and
the whole history into an xarray dataset (`TransientResult.to_dataset`).

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L1-L1)

## opencr.analysis.transient.TransientResult

*class*

```python
class TransientResult
```

The populations against time.

**Attributes**

- `model` — The model solved.
- `times` — The output times in s.
- `evolving` — The densities of the evolving states, shape ``(times, states)``.
- `report` — The integrator's report.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L32-L144)

### opencr.analysis.transient.TransientResult.evolving

*attribute* · *instance attribute*

```python
evolving = np.asarray(evolving, dtype=float)
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L56-L56)

### opencr.analysis.transient.TransientResult.model

*attribute* · *instance attribute*

```python
model = model
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L52-L52)

### opencr.analysis.transient.TransientResult.report

*attribute* · *instance attribute*

```python
report = report
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L57-L57)

### opencr.analysis.transient.TransientResult.times

*attribute* · *instance attribute*

```python
times = np.asarray(times, dtype=float)
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L55-L55)

### opencr.analysis.transient.TransientResult.conditions

*property*

```python
conditions: Conditions
```

The conditions at the first time.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L60-L62)

### opencr.analysis.transient.TransientResult.electron_density

*property* · *cached*

```python
electron_density: np.ndarray
```

``n_e`` against time in m^-3.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L86-L93)

### opencr.analysis.transient.TransientResult.populations

*property* · *cached*

```python
populations: dict[str, np.ndarray]
```

The density of every state against time (m^-3), by name, in network order.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L69-L79)

### opencr.analysis.transient.TransientResult.at

*method*

```python
def at(index: int = -1) -> Result
```

Return the state at output time ``index`` as a `Result`.

Its report says how far the populations are from a steady state (the
relative residual at that moment).

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L95-L114)

### opencr.analysis.transient.TransientResult.conditions_at

*method*

```python
def conditions_at(time: float) -> Conditions
```

Return the conditions at ``time``.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L64-L66)

### opencr.analysis.transient.TransientResult.population

*method*

```python
def population(state: str) -> np.ndarray
```

Return the density of ``state`` against time in m^-3.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L81-L83)

### opencr.analysis.transient.TransientResult.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

Return the populations and ``n_e`` against time as an xarray dataset.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/analysis/transient.py#L116-L137)
