  Photoionisation is one of the main mechanisms at work in the gaseous
environment of bright astrophysical sources. Many information on the gas
physics, chemistry and kinematics, as well as on the ionising source itself,
can be gathered through optical to X-ray spectroscopy. While several public
time equilibrium photoionisation codes are readily available and can be used to
infer average gas properties at equilibrium, time-evolving photoionisation
models have only very recently started to become available. They are needed
when the ionising source varies faster than the typical gas equilibration
timescale. Indeed, using equilibrium models to analyse spectra of
non-equilibrium gas may lead to inaccurate results and prevents a solid
assessment of the gas density, physics and geometry. We present our novel
Time-Evolving PhotoIonisation Device (TEPID), which self-consistently solves
time evolving photoionisation equations (thermal and ionisation balance) and
follows the response of the gas to changes of the ionising source. The code can
be applied to a variety of astrophysical scenarios and produces time-resolved
gas absorption spectra to fit the data. To describe the main features of TEPID,
we apply it to two dramatically different astrophysical scenarios: a typical
ionised absorber observed in the X-ray spectra of Active Galactic Nuclei (e.g.
Warm Absorbers and UFOs) and the circumburst environment of a Gamma-Ray Burst.
In both cases, the gas energy and ionisation balances vary as a function of
time, gas density and distance from the ionising source. Time evolving
ionisation leads to unique ionisation patterns which cannot be reproduced by
stationary codes when the gas is out of equilibrium. This demonstrates the need
for codes such as TEPID in view of the up-coming high-resolution X-ray
spectrometers onboard missions like XRISM or Athena.
