I'm a high school student and currently I'm trying to use Baade-Wesselink method to independently derive period-luminosity relation of Cepheid variables. I noticed that to get the linear radius variation of a Cepheid, I need to integrate its radial velocity over its period.

The problem is, I don't know which program/software I should use to plot the best-fit line going through the points of the raw data of radial velocity over the phase. Even more, the thing is I need to integrate that best-fit line and plot the integrated curve as well.

Can anybody recommend good software that I can use?

(I've tried the integration with a program called Logger Pro but it was not successful. )

  • 2
    $\begingroup$ Sounds like you want some sort of programming language that can handle this like Mathematica, R, Python, Matlab, etc. There are numerous choices. It just depends on which one you have access to and are comfortable learning. $\endgroup$
    – zephyr
    Commented Aug 10, 2016 at 19:32
  • $\begingroup$ I agree, you will probably have to program it yourself. I don't know Matlab or R, but for python there's the astropy package that might have some building blocks for you to get started, so you won't have to do everything from scratch. From a quick look, it has model fitting and ploting tools. $\endgroup$
    – Alex
    Commented Aug 11, 2016 at 8:14
  • $\begingroup$ Use Simpson's rule or the Trapezium rule. Could be trivially done in a spreadsheet. $\endgroup$
    – ProfRob
    Commented Aug 18, 2016 at 22:44
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because it isn't about astronomy, it is about numerical methods. $\endgroup$
    – ProfRob
    Commented Aug 19, 2016 at 8:01
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because this question belongs on the Software Recommendations Stack Exchange. $\endgroup$
    – Timtech
    Commented Aug 22, 2016 at 14:04

1 Answer 1


I'm not sure what you are actually trying to do. Radial velocity isn't generally measured, it is computed from the projected velocity. But if I take you at your word, that your raw data is radial velocity, then that simplifies things.

If you know the period, $P$, and you know the $v$ AND if you know the theoretical relationship between them $v = f(p)$ then you can use linear least squares to compute the adjustable parameters of $f(p)$ by plotting $v$ (measured) vs $v$(calculated).

Any 'best fit' equation is able to interpolate values of $v$ so all you need to divide up the period into small intervals and approximate the area under the curve using its two end-points (it is rarely necessary to use parabolic fits that also use the mid-points of those small intervals).

Thus the problem of integration becomes one of simple geometry (you have a tall thin rectangle with a triangle on top of it for each interval). Let's think about a star with a 30 day period. That's ~40,000 minutes, so I'd probably use 5 or 8 minute intervals ...starting at minute 0 what's the area under the curve from t=0 to t=8 minutes? then from 8 to 16, all the way up to 43,200th minute. Sum of those areas is total area. An Excel spreadsheet can easily do that.

Actually, if you also use 5 minute intervals and compare the results you'll see how much better (hopefully NOT much) a smaller interval is...analytical integration is this taken to the limit of the interval approaching zero, but in real life, numerical integration is necessary for almost all 'interesting' problems. Here are 2 links, fwiw:

  • 1
    $\begingroup$ Far too complicated. $\endgroup$
    – ProfRob
    Commented Aug 18, 2016 at 22:45

Not the answer you're looking for? Browse other questions tagged .