[mesa-users] mesa hint: stopping on a dime
paxton at kitp.ucsb.edu
Sat Jan 28 11:58:31 EST 2012
Did you ever want to stop a run at a specific value for something?
Such as at Teff = 3000, for example?
Assuming the Teff values are dropping, you can set
Teff_lower_limit = 3000
that will make the run terminate as soon as Teff drops below 3000,
but if the timesteps are large, the 1st value below 3000 can be
pretty far below -- too far if what you really want is Teff = 3000,
not just Teff <= 3000.
You could fiddle around setting timestep limits by hand and doing
a series of restarts until you get something close enough, but
better yet, you can set a couple of controls to get the system to do that
for you automatically!
Here's a case I ran recently of a cooling WD. With the default controls,
it jumped from Teff = 3036 to Teff = 2934 and stopped there.
Then I added these to the &controls inlist
when_to_stop_rtol = 1d-3
when_to_stop_atol = 1d-3
Now it knows how close I want to get when it stops.
So when it overshoots the target, it backups and
repeats from before the target with a smaller timestep.
In this case, it needed two backups: the first gave
Teff = 2992, which was close but but quite within
the tolerances. The second backup gave Teff = 2999,
and that was accepted.
Of course this isn't just for Teff --- the "when_to_stop" tolerances
apply to (just about) all of the stopping criteria that use limits,
such as abundances or luminosities or ...
Give it a try next time you need to stop on a dime!
More information about the Mesa-users