[Mesa-users] Fwd: Problem reading file
Swarnim Shashank
swarnim.shashank at cbs.ac.in
Tue Apr 17 06:58:52 EDT 2018
Hello,
Pablo, no I am not working on anything that the binary module would not do.
I actually did the problem on the using the binary module but then my
supervisor asked me to try doing it by writing a binary code myself as well.
Michael, thank you for your suggestion, I actually wrote a bash script
which uses sed to change the inlist file and it actually worked. I am aware
that it is not a very robust method and that with any changes in inlist or
run_star_extras I will have to change the bash script accordingly.
I would still like to ask one thing, when using run_star_extras, using
Fortran's file handling (open() and read()), I was able to read from a file
the mass_change and it worked but when I tried reading model_number and
provided stopping condition it did not work. Would you know why?
Thank you
Regards,
Swarnim
On 13 April 2018 at 06:21, Zhang, Zhaoxi M. (Michael) <mz at astro.caltech.edu>
wrote:
> Hi Swarnim,
>
>
> I agree with Pablo that it's much better to implement whatever new physics
> you want in run_star_extras. If you really insist on using a driver code
> to control MESA, you can use a shell script to dynamically generate an
> inlist with the appropriate max_model_number (possibly using sed's
> find-and-replace functionality), restart MESA from the latest photo, and
> repeat. This is very ugly and error-prone compared to modifying
> run_star_extras.
>
>
> Cheers,
>
>
> Michael
> ------------------------------
> *From:* Mesa-users <mesa-users-bounces at lists.mesastar.org> on behalf of
> Pablo Marchant via Mesa-users <mesa-users at lists.mesastar.org>
> *Sent:* Thursday, April 12, 2018 11:03:30 AM
> *To:* Swarnim Shashank
> *Cc:* mesa-users
> *Subject:* Re: [Mesa-users] Fwd: Problem reading file
>
> Hi Swarmin,
>
> it would appear you are essentially trying to recreate the binary module
> outside of MESA. This seems like a very hard task, and I would strongly
> recommend you against doing it unless there is a strong motivation for it.
> If it's just meant as an exercise, then you should implement what you have
> in run_star_extras for a single star model, instead of constantly stopping
> and restarting a simulation with different options.
>
> Do you have any strong reason to try this? Are you attempting something
> that can't be done with the binary module?
>
> Cheers
>
> On Thu, Apr 12, 2018 at 11:43 AM, Swarnim Shashank <
> swarnim.shashank at cbs.ac.in> wrote:
>
> Actually, I have been given this problem by my supervisor. He had asked me
> to write a code that would communicate to MESA in such a way apart from
> using the binary module provided with MESA.
>
> I am calculating accretion rate, orbital period, luminosity of the system
> and the binary separation. And I am evolving the companion using mesa star.
>
> Thanks
>
> *Swarnim Shashank*
> Fourth Year Integrated MSc. Student
> UM-DAE-Centre for Excellence in Basic Sciences
> Mumbai
>
> On 12 April 2018 at 20:32, Pablo Marchant <pamarca at gmail.com> wrote:
>
> Hi Swarnim,
>
> what do you mean by "calculating the binary parameters"? Are you trying to
> compute additional data that mesa does not provide?
>
> From what you say, I don't really understand why you need to stop the
> simulation at all. It seems you could simply evolve your system all the way
> to whatever terminating condition you want (without stopping in between),
> and then post-process the output files.
>
> cheers
>
> On Thu, Apr 12, 2018 at 9:55 AM, Swarnim Shashank <
> swarnim.shashank at cbs.ac.in> wrote:
>
> Sorry, by mistake I sent this mail only to Francis.
>
>
> ---------- Forwarded message ----------
> From: *Swarnim Shashank* <swarnim.shashank at cbs.ac.in>
> Date: 12 April 2018 at 20:06
> Subject: Re: [Mesa-users] Problem reading file
> To: Francis Timmes <fxt44 at mac.com>
>
>
> Hello,
>
> I am evolving a Low mass X-ray binary system. I have written a code for
> calculating the binary parameters. What I want to do is at after few steps
> stop MESA and provide MESA values such as mass loss rate. And then resume
> MESA again to evolve the companion. I thought of doing it by stopping MESA
> with max_model_number, run the binary code then make MESA read a new
> (greater) max_model_number (through a file) and resume MESA using ./re. I
> would provide value for max_model_number and run ./re through a driver code
> so that I wouldn't have to do it again and again.
> Sorry I was not clear earlier.
> I would welcome if you have any other suggestion for it as well.
>
> Thank you
>
> *Swarnim Shashank*
> Fourth Year Integrated MSc. Student
> UM-DAE-Centre for Excellence in Basic Sciences
> Mumbai
>
> On 12 April 2018 at 19:31, Francis Timmes <fxt44 at mac.com> wrote:
>
> hi swarnim,
>
> i’d like to ask why you want to read max_model_number from a file.
> what problem would it solve for you, or what feature would it add for you?
>
> fxt
>
>
>
>
>
> > On Apr 12, 2018, at 9:21 AM, Swarnim Shashank <
> swarnim.shashank at cbs.ac.in> wrote:
> >
> > Hello,
> >
> > I am an undergraduate student and I am using MESA for my project. I want
> MESA to read max_model_number from a file but I am unable to implement
> that. I tried doing that from run_star_extras but it didn't work.
> > I am using 10108 release.
> >
> > Please let me know of possible ways of doing it.
> >
> > Thank you
> > Regards
> > Swarnim Shashank
> > Fourth Year Integrated MSc. Student
> > UM-DAE-Centre for Excellence in Basic Sciences
> > Mumbai
>
>
>
>
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>
>
>
>
> --
> Pablo Marchant Campos
> M.Sc on Astrophysics, Universidad Católica de Chile
> PhD on Astrophysics, Argelander-Institut für Astronomie, Universität Bonn
>
>
>
>
>
> --
> Pablo Marchant Campos
> M.Sc on Astrophysics, Universidad Católica de Chile
> PhD on Astrophysics, Argelander-Institut für Astronomie, Universität Bonn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20180417/6e1353a8/attachment.html>
More information about the Mesa-users
mailing list