deeplink to this page         astro 465         teaching

Astro 465

Computational assignment 1

CA1.1

  • To find where a model matches the Sun, you can use the star.plt1 file. By default it saves every fifth model. If you want to change that to every model, set the parameter KT4 to 1. This ought to be a short run; you can monitor the age of the model with tail as discussed before. As soon as you see that the model has passed the age of the Sun, you can stop the code as discussed here.
  • In order to make the code stop when the model reaches a certain age, you can use the parameter UC(2) in the file init.run (see the manual).
  • Remember that the stellar-structure output of the code is saved in the file star.mdl1.
  • By default, the code does not save every structure model it computes; for most models the output would take up too much disc space. The parameter KT1 in init.dat ensures that every KT1-th model gets saved. You can set it to 1 to save every model.

CA1.2

Abundances

  • You need a model with helium abundance Y and metallicity Z. These two numbers determine the hydrogen abundance X, which can be set in the code as the parameter CH in init.dat (the default value, -1, tells the code to use the value from the ZAMS model).
  • However, to make the code realise you change the abundances at startup, we need to tell it to fully mix the ZAMS model in order to create a homogeneous composition with the proper abundances. To do so, set JCH in init.dat to 4.
  • The model may not converge when the initial time step is too large. Start the code and see whether it exits after a few seconds or not. If so, see which time step was used (e.g. in star.out1, first column second row). The initial time step is specified in init.run by setting the parameter DTY to a positive number (in years). Try setting it to an order if magnitude lower than what the code tried initially, and keep doing that until it works. This initial time step may scale with the main-sequence lifetime and hence be shorter for more massive stars. I would be very surprised though if you'd need an initial time step smaller than 1 yr.
  • For some combinations of X, Y, Z and M, especially (it seems) around M=0.75-0.95Mo, a ZAMS model may never converge. A solution may be to set in init.run ML1 to a value for which the ZAMS model does converge (e.g. ML1=0.0 if a 1.0Mo does converge) while setting SM to the desired mass (e.g. SM=0.80).

Isochrones

  • When you're creating isochrones, specifying a final age for your model, as explained in CA1.1, may come in handy.
  • As with time, we can tell the code to stop evolution at a certain core hydrogen abundance. Look up the parameter UC(15) in init.run. Note that it needs to be positive to work, so set it to a small positive value if you need 0.
  • In order to create an isochrone, you'll probably want to copy the last line (which should have the right age) of each *.plt1 file to a new file, e.g. iso.plt1:
    echo " 83" > iso.plt1 #to create the first line tail -n1 mass01.plt >> iso.plt1 tail -n1 mass02.plt >> iso.plt1 ...
    Note that cat simply prints what follows and > redirects the output to a new file. tail returns the last line of a file, -n1 makes sure it's the last 1 line(s) and >> appends to file rather than overwriting the existing one.

ZAMS

  • To create a ZAMS, think about using the first models of each of your tracks. Selecting the second line from a file (the first is taken by the number of columns), can be done by:
    head -n2 mass1.plt1 | tail -n1
    where head the same as tail, but on the other end, and the symbol | is called a pipe and pipes the output of one command to be used as input for another command.
  • if you look very carefully at the beginning of each of your tracks, you'll see that for some in the first few steps, L and Teff change significantly, but in very little time. This is because the ZAMS model was taken from a library of models with a range of discrete masses, and it was scaled in mass before starting the evolution. If you want a nice ZAMS, look where these variables stop changing rapidly and take that model (changing the numbers 1 and 2 in tail and head above to n and n+1 to get the n-th model).

plotpltn

  • To plot more than one evolutionary track (e.g., iso.plt1 and zams.plt1) in one figure, see the program plotpltn.