Skip to content

Commit d3093e3

Browse files
committed
[ci skip] if want to use one of when_to_stop_atol or rtol, you have to set the other to zero
1 parent 844f35a commit d3093e3

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

star/defaults/controls.defaults

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -955,35 +955,30 @@
955955

956956
! when_to_stop_rtol
957957
! ~~~~~~~~~~~~~~~~~
958-
959-
! Relative error criteria when hitting stop target time.
960-
! The system will automatically redo with a smaller timestep to hit a stopping target.
961-
! It calculates the following "error" term and retries if it is > 1.
962-
963-
! ::
964-
965-
! error = abs(value - target_value)/ &
966-
! (when_to_stop_atol + when_to_stop_rtol*max(abs(value),abs(target_value)))
967-
968-
! ::
969-
970-
when_to_stop_rtol = 1d99
971-
972-
973958
! when_to_stop_atol
974959
! ~~~~~~~~~~~~~~~~~
975960

976-
! Abolute error criteria when hitting stop target time.
977-
! The system will automatically redo with a smaller timestep to hit a stopping target.
978-
! It calculates the following "error" term and retries if it is > 1.
979-
980-
! ::
961+
! Relative (``rtol``) and absolute (``atol``) error criteria for
962+
! target stopping values. To compare how accurately the last
963+
! step satisfied a stopping condition, MESA evaluates ::
981964

982965
! error = abs(value - target_value)/ &
983-
! (when_to_stop_atol + when_to_stop_rtol*max(abs(value),abs(target_value)))
966+
! (when_to_stop_atol + when_to_stop_rtol*max(abs(value), abs(target_value)))
967+
968+
! and will redo with a smaller timestep if ``error`` is greater
969+
! than 1. The default values ``1d99`` for both guarantee that
970+
! ``error`` is tiny, so the run terminates as soon as a stopping
971+
! condition is reached.
972+
973+
! If you wish to use either ``rtol`` or ``atol``, you should
974+
! change the other to 0 (or your desired value). To see why,
975+
! suppose we only set ``when_to_stop_rtol = 1d-3``. Because
976+
! ``when_to_stop_atol`` is still ``1d99``, ``error`` will still
977+
! be very small and MESA won't redo the last step.
984978

985979
! ::
986980

981+
when_to_stop_rtol = 1d99
987982
when_to_stop_atol = 1d99
988983

989984

@@ -994,8 +989,8 @@
994989
! max_age_in_seconds
995990
! ~~~~~~~~~~~~~~~~~~
996991

997-
! Stop when the age of the star exceeds this value (in years).
998-
! only applies when > 0.
992+
! Stop when the age of the star exceeds this value in years, days, or seconds.
993+
! Only applies when > 0.
999994

1000995
! ::
1001996

0 commit comments

Comments
 (0)