nichollsh / AGNI

A 1D radiative-convective model for the atmospheres of hot terrestrial planets.
https://nichollsh.github.io/AGNI/
1 stars 1 forks source link

Implement/test a monte-carlo solver #33

Closed nichollsh closed 3 hours ago

nichollsh commented 2 months ago

Constructing a jacobian is quite expensive, since it requires a lot of flux evaluations. A semi-random approach might be valuable, at least for providing an initial guess to the model.

Randomising the temperatures is one option, but maybe randomising the lapse rate (and keeping it constant at all levels) is more reasonable.

This could also be used for when the solver gets stuck in other methods.

hinnes97 commented 1 month ago

On this point, the exo-k radiative transfer code used by Jeremy Leconte (which seems to use a similar method) doesn't recalculate the Jacobian until the max temperature difference between the current temperature and the one used to calculate the Jacobian exceeds a certain value:

https://perso.astrophy.u-bordeaux.fr/~jleconte/exo_k-doc/exo_k_evol.html#using-the-jacobian-to-compute-fluxes

nichollsh commented 1 month ago

Ah I see - very interesting! Thanks for the suggestion. It sounds somewhat similar to Broyden's method, actually.

Along these lines, maybe another thing to consider would be to only calculate a jacobian corresponding to levels which need updating. Rather than making it a binary thing, we could check which levels see significant change (c.f. Exo_K) and then only calculate the jacobian and update those levels.

nichollsh commented 3 hours ago

Implemented Hamish's suggestion above into the existing nonlinear solver, which works well. A new solver type is not required.