Skip to content
Projects

opencr.analysis.transient

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).

Classes

NameDescription
TransientResultThe populations against time.

TransientResultclass#

class TransientResult(model: Model, conditions_at: Callable[[float], Conditions], system_at: Callable[[float], PopulationSystem], times: np.ndarray, evolving: np.ndarray, report: TransientReport)

The populations against time.

Attributes

NameDescription
modelThe model solved.
timesThe output times in s.
evolvingThe densities of the evolving states, shape (times, states).
reportThe integrator’s report.

evolvingattributeinstance attribute#

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

modelattributeinstance attribute#

model = model

reportattributeinstance attribute#

report = report

timesattributeinstance attribute#

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

conditionsproperty#

conditions: Conditions

The conditions at the first time.

electron_densitypropertycached#

electron_density: np.ndarray

n_e against time in m^-3.

populationspropertycached#

populations: dict[str, np.ndarray]

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

atmethod#

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).

conditions_atmethod#

def conditions_at(time: float) -> Conditions

Return the conditions at time.

populationmethod#

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

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

to_datasetmethod#

def to_dataset() -> xr.Dataset

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