[mesa-users] Fixed Time Steps

Max Katz maxpkatz at gmail.com
Tue Aug 28 11:16:26 EDT 2012


Jeremy,

I can't say for sure, but I suspect that a requirement like this is
something you'll have to do within the code itself. It appears to me that
the rules for setting the next timestep live in star/private/timestep.f. In
particular, it looks like the following line of the code (in the
timestep_controller subroutine) does the final adjustment:

  s% dt_next = min(max_dt, max(s% dt_next, s% dt*s%
timestep_factor_for_backups))

You could simply add a line right after this with

  s% dt_next = your_new_dt_here

and then comment it out and recompile when you're done with your project.
For example, here's one way to implement what you're asking, I think. If
delta(log(t)) = const = a > 0, then this is equivalent to saying

  s% dt_next = (s% age)*secyer*(10.0**a - 1.0)

since the current model age (s% age) is recorded in years.

Now, I have absolutely no clue whether this will work. MESA has very
specific rules for how the next timestep is chosen so that hydrostatic
equilibrium is maintained, and picking a hardcoded timestep may result in
disaster for the algorithm even if you know that your timestep is
physically viable. My guess is that this is why there is no default option
for selecting your own timestep (or even feeding MESA a list of times to
evaluate the star at). You'd have to ask Bill, I'm sure. Furthermore, I do
not know how this will interact with the choice for the first time step but
you might be able to pick that up from the code.

Anyway, it's worth a try! I didn't do this to see if it would work, but I'd
be interested to see the results (hopefully star will at least re-compile
with this change!). A better approach would be if MESA could be told to
make sure to hit certain timestep milestones along the way, within a
certain precision, and record the results at just those milestones. This
sounds a lot harder than what I devised above, though.

Max

On Tue, Aug 28, 2012 at 4:32 AM, Jeremy Sakstein <
j.a.sakstein at damtp.cam.ac.uk> wrote:

> Hi All,
>
> I have some data that I would like to feed into MESA and it comes at
> discreet time-steps. Even more annoyingly, they are spaced in delta log and
> not t. I was wondering, is there anyway to force MESA to evaluate each
> model using a fixed time step in delta log t?
>
> Cheers,
>
> Jeremy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20120828/40867505/attachment.html>


More information about the Mesa-users mailing list