[Mesa-users] Limiting the final radius of a simulation

Ali Pourmand pourmand at ualberta.ca
Thu Feb 16 00:21:40 UTC 2023


Hi Ebraheem,

Thank you so much! This helped!

Best
Ali

On Wed, Feb 15, 2023 at 1:18 PM Ebraheem Farag <ekfarag at asu.edu> wrote:

> Hello Ali,
>
> It looks to me like you are currently only using "when_to_stop_atol =
> 0.0001d0", and the error is calculated using both "when_to_stop_atol" and
> "when_to_stop_rtol":
>
> "The system will automatically redo with a smaller timestep to hit a
> stopping target. It calculates the following “error” term and retries if it
> is > 1"
>
> error = abs(value - target_value)/ &        (when_to_stop_atol + when_to_stop_rtol*max(abs(value),abs(target_value)))
>
>
> Since the default "when_to_stop_rtol = 1d99", your stopping condition is
> not being satisfied.
>
> Try setting  "when_to_stop_atol = 0.0001d0", with "when_to_stop_rtol =
> 0d0" or vice versa, as per your goals. Just check the error equation to
> make sure you're getting what you want!
>
> In my inlists, I use:
>
> ! tolerances on stopping conditions
>
>       when_to_stop_rtol = 1d-3
>
>       when_to_stop_atol = 1d-3
>
>
>
> Cheers,
> EbF
>
>
> On Wed, Feb 15, 2023 at 12:54 PM Ali Pourmand <pourmand at ualberta.ca>
> wrote:
>
>> Dear Ebraheem and Francis,
>>
>> Thank you very much for your replies!
>> I had one question though, how do we specify what variable we are using
>> "when_to_stop_rtol" for? I tried it several times but it didn't have any
>> effect.
>> I have attached a sample inlist I am using.
>>
>>
>> On Wed, Feb 15, 2023 at 12:02 PM Ebraheem Farag <ekfarag at asu.edu> wrote:
>>
>>> Hello Ali,
>>>
>>> If you're trying to stop at a specific radius, there are a few &controls
>>> <https://urldefense.com/v3/__https://docs.mesastar.org/en/release-r22.11.1/reference/controls.html*photosphere-r-upper-limit__;Iw!!IKRxdwAv5BmarQ!d9I8umjyHg_Q5_hKiVe8qANnh3lSmfTP1-XEoKkhASa17Whom0yL-TS_x1TMC8Xtdhm94pM92aWt9s9nKOU$> that
>>> can help:
>>>
>>> stop when photosphere_r is greater than this limit, in Rsun units
>>>
>>> photosphere_r_upper_limit = 1d99
>>>
>>>
>>> stop when photosphere_r is less than this limit, in Rsun units
>>>
>>> photosphere_r_lower_limit = -1d99
>>>
>>>
>>>
>>> You can set a tolerance on your stopping condition using the &controls
>>> <https://urldefense.com/v3/__https://docs.mesastar.org/en/release-r22.11.1/reference/controls.html*when-to-stop-rtol__;Iw!!IKRxdwAv5BmarQ!d9I8umjyHg_Q5_hKiVe8qANnh3lSmfTP1-XEoKkhASa17Whom0yL-TS_x1TMC8Xtdhm94pM92aWtLZtw6Vo$>
>>>  'when_to_stop_rtol':
>>>
>>> Relative error criteria when hitting stop target time. The system will
>>> automatically redo with a smaller timestep to hit a stopping target. It
>>> calculates the following “error” term and retries if it is > 1.
>>>
>>> error = abs(value - target_value)/ &        (when_to_stop_atol + when_to_stop_rtol*max(abs(value),abs(target_value)))
>>>
>>> when_to_stop_rtol = 1d99
>>>
>>>
>>> in your case you could set.
>>>
>>> when_to_stop_rtol = 1d-2 # for 0.01 precision, I use 1d-3 typically...
>>>
>>>
>>> 'delta_lgR_limit' adjusts how large of a logarithmic change in the
>>> stellar radius is allowed in each solver timestep, so it might help the
>>> time resolution of your models, but won't exactly improve your stopping
>>> condition.
>>>
>>> I hope this helps!
>>>
>>> -EbF
>>>
>>>
>>> On Wed, Feb 15, 2023 at 11:24 AM Ali Pourmand via Mesa-users <
>>> mesa-users at lists.mesastar.org> wrote:
>>>
>>>> Hello,
>>>>
>>>>  I want to stop several different MESA runs at the same final
>>>> (photospheric) radius (with a certain precision), but since the physics is
>>>> slightly different in each, I can't stop at the exact same radius. I
>>>> realize that one could decrease the timesteps of evolution to achieve this,
>>>> but was wondering if there is an easier way to achieve this.
>>>>
>>>> I am already using the stop to limit the photospheric radius command,
>>>> but it always stops with a certain precision.
>>>>
>>>> What I want is a way to tell the code to stop when the photosphere
>>>> reaches 7+-0.01 solar radii , is there any command that could achieve that?
>>>> I tried delta_lgR_limit, but I don't think that does what I have in my
>>>> mind.
>>>>
>>>> best
>>>> Ali Pourmand
>>>> M.Sc. Student
>>>> University of Alberta
>>>> _______________________________________________
>>>> mesa-users at lists.mesastar.org
>>>>
>>>> https://urldefense.com/v3/__https://lists.mesastar.org/mailman/listinfo/mesa-users__;!!IKRxdwAv5BmarQ!YmagYdCG8_pS3vclu4IVf5A1KVI4YnXJrDXsGkGxNAo1nXX0t8RniyeS5XH7dQ03YuyYGOKa06ZVymwG9BU-jP-j$
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20230215/2bdf80cf/attachment.htm>


More information about the Mesa-users mailing list