# Binary - semi-major axis computation

I tried this formula for WW Aur:

$$a(R_\mathrm{nom}) = \sqrt[3]{\frac{P(\mathrm{d})^2}{365.2564^2}[M_1(M_{\mathrm{nom}})+M_2(M_{\mathrm{nom}})]} \cdot \frac{149597870.7}{695700}$$

What is wrong, please?

# WW Aur test

R_sol_km = 695700
year_day = 365.2564
AU_km = 149597870.7

P = 2.52501941 # d
M1 = 1.964     # M_sol
M2 = 1.814     # M_sol
a = 12.15      # R:sol

print('a: should be:', a, 'is:', (P**2/year_day**2*(M1+M2))**(1/3)*AU_km/R_sol_km)


Output:

a: should be: 12.15 is: 0.012941299276573308

• It's unit conversion. You're squaring the period in days, but you're not squaring the number of years per day. As a result, the formula you're using is giving an incorrect value. Commented Jul 6, 2022 at 13:19
• Thank you very much. And now? Is factor 1000 missing somewhere, please? Commented Jul 6, 2022 at 13:47
• You're probably hitting an Order of operations issue with your exponentiation occurring before the division, so you need to wrap parentheses around (1/3). I also have no idea why you're multiplying the result by AU_km/R_sol_km Commented Jul 6, 2022 at 14:33
• You aren't showing the values you are using for year_day, AU_km, or R_sol_km in your python code snippet. You should indeed get about 12.15 solar radii. Commented Jul 6, 2022 at 14:51
• @notovny The questioner is trying to express the semi-major axis length of the orbit of the two components of WW Aur about one another in units of solar radii. Commented Jul 6, 2022 at 14:52

a: should be: 12.15 is: 12.153517320591716