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

Line search #22

Closed nichollsh closed 3 months ago

nichollsh commented 3 months ago

Sometimes the NR method struggles to converge the "final result", instead it bounces around it. This is particularly problematic when convection extends from the surface, which is expected to be common for many systems.

Since the NR method profiles a descent direction x_dif, we can scale this vector to obtain an optimal step size by using a line search method. I've already found that scaling this factor by 0.1x works well to improve model performance in some cases.

This should be relatively simple to implement:

  1. Start at x = x_old with residuals r = r_old
  2. Calculate NR step, providing x_dif and r_tst residuals
  3. Sample r_tst for various x = x_old + a * x_dif, where a is varied within the semi-closed interval (0,1].
  4. Select the best value of a (and thus the new x) based on the optimal r_tst. We could probably just use a handful of a values at each iteration, so the performance change from this should be minimal.