  We have studied the thermal instabilities in the context of Active Galactic
Nuclei (AGN), addressing the cases of thin and thick (stratified) X-ray
illuminated media. For that, we have compared the behaviour of different models
in pressure equilibrium. Ionized gas in pressure equilibrium show temperature
discontinuities which, however difficult to tackle, can be modelled with the
transfer-photoionization code TITAN. Our code allows to choose between the hot
and the cold stable solutions in the multi-branch regime of the S-curve, and
then to compute a fully consistent photoionisation model with the chosen
solution. For the first time, it is now possible to compare the true stable
solution models with the approximate solution model normally used. Our studies
may be applied to media in any pressure equilibrium conditions, e.g. constant
gas pressure, constant total pressure, or hydrostatic pressure equilibrium;
they can be used to model irradiated accretion discs in AGN, the Warm Absorber
in type 1 AGN, or the X-ray line-emitting gas in type 2 AGN.
