<p>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. </p>

<p>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). </p>

<p>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). </p>

<p>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. </p>

<p>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: </p>

<ul>
<li><a href="https://www.physicsforums.com/threads/finding-periodic-best-fit-equation-for-data-set.715638/" rel="nofollow">https://www.physicsforums.com/threads/finding-periodic-best-fit-equation-for-data-set.715638/</a></li>
<li><a href="http://www.aanda.org/articles/aa/pdf/2004/08/aah4718.pdf" rel="nofollow">http://www.aanda.org/articles/aa/pdf/2004/08/aah4718.pdf</a> ← see page 537 and references noted there.</li>
<li>The Institute for Astronomy (IFA) at the University of Hawaii <a href="https://www.google.com/search?q=Baade-Wesselink+site%3Ahawaii.edu" rel="nofollow">has several pdfs on BW</a> that may be helpful</li>
</ul>

CC BY-SA 3.0
2016-08-18T22:45:20.887Z
Far too complicated.
ProfRob
CC BY-SA 3.0
2016-08-12T01:09:48.423Z
2016-08-18T19:27:20.687Z
2016-08-18T19:27:20.687Z
Li Zhi
<p>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. </p>

<p>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.</p>

<p>Can anybody recommend good software that I can use?</p>

<p>(I've tried the integration with a program called <a href="http://www.vernier.com/products/software/lp/" rel="nofollow">Logger Pro</a> but it was not successful. )</p>

CC BY-SA 3.0
2016-08-10T19:32:59.010Z
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.
zephyr
CC BY-SA 3.0
2016-08-11T08:14:13.993Z
I agree, you will probably have to program it yourself. I don't know Matlab or R, but for python there's the [astropy](http://www.astropy.org/) 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.
Alex
CC BY-SA 3.0
2016-08-18T22:44:42.577Z
Use Simpson's rule or the Trapezium rule. Could be trivially done in a spreadsheet.
ProfRob
CC BY-SA 3.0
2016-08-19T08:01:30.743Z
I'm voting to close this question as off-topic because it isn't about astronomy, it is about numerical methods.
ProfRob
CC BY-SA 3.0
2016-08-22T14:04:40.600Z
I'm voting to close this question as off-topic because this question belongs on the Software Recommendations Stack Exchange.
Timtech
<star><distances><velocity><cepheids>
Which software is appropriate to integrate radial velocity with respect to time
7_G.S.N
# Which software is appropriate to integrate radial velocity with respect to time

(Asked by: username_0 on 2016-08-10)

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](http://www.vernier.com/products/software/lp/) but it was not successful. )

**Tags:** star, distances, velocity, cepheids
> **Comments:**
> **username_1**: 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.  
> **username_2**: I agree, you will probably have to program it yourself. I don't know Matlab or R, but for python there's the [astropy](http://www.astropy.org/) 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.  
> **username_3**: Use Simpson's rule or the Trapezium rule. Could be trivially done in a spreadsheet.  
> **username_3**: I'm voting to close this question as off-topic because it isn't about astronomy, it is about numerical methods.  
> **username_4**: I'm voting to close this question as off-topic because this question belongs on the Software Recommendations Stack Exchange.  

---

## 1 answers

### Answer by username_5 on 2016-08-12. Score: 2

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:

* <https://www.physicsforums.com/threads/finding-periodic-best-fit-equation-for-data-set.715638/>
* <http://www.aanda.org/articles/aa/pdf/2004/08/aah4718.pdf> ← see page 537 and references noted there.
* The Institute for Astronomy (IFA) at the University of Hawaii [has several pdfs on BW](https://www.google.com/search?q=Baade-Wesselink+site%3Ahawaii.edu) that may be helpful

> **Comments:**
> **username_3**: Far too complicated.  

---

