I'm trying to solve the following formula for i, given values for all other variables. There are two equations, the first one is a formula to show the transit duraction of a planet, the second one is Kepler's third law.

G = Quantity[1 , "GravitationalConstant"];
Ms = Quantity[1, "SolarMass"];
Rs = Quantity[1, "SolarRadius"];
P = Quantity[6, "Days"];
Tdur = Quantity[4, "Hours"];

  {Tdur == P/π (Sin^-1)[Sqrt[(Rs + Rp)^2 - a^2 (Cos^2)[i]]/a],
   a^3/P^2 == (G Ms)/(4 π^2) }, 
  {i, a}] 

Mathematica is struggling to create an output as can be seen below and is definitely not solving for i. It gives me the error message:

Solve::units: Solve was unable to determine the units of quantities that appear in the input

Any suggestions what I can do differently are greatly appreciated.

enter image description here


1 Answer 1


Use UnitConvert on all of the constants

G = Quantity[1, "GravitationalConstant"] // UnitConvert;
Ms = Quantity[1, "SolarMass"] // UnitConvert;
Rs = Quantity[1, "SolarRadius"] // UnitConvert;
P = Quantity[6, "Days"] // UnitConvert;
Tdur = Quantity[4, "Hours"] // UnitConvert;

You used the wrong syntax for ArcSin and Cos[i]^2

sol = Solve[{Tdur == P/π*ArcSin[Sqrt[(Rs + Rp)^2 - a^2 Cos[i]^2]/a], 
   a^3/P^2 == (G Ms)/(4 π^2)}, {i, a}, Reals]

enter image description here

Adding constraints on a and/or i would probably simplify the results.

  • $\begingroup$ thanks for the answer, //Unitconvert doesn't seem to make any difference. $\endgroup$
    – Nickpick
    Dec 30, 2020 at 22:54
  • $\begingroup$ On my system, without UnitConvert you end up with SolarRadius in the result rather than its value in Meters. Depends on how you want the result displayed. $\endgroup$
    – Bob Hanlon
    Dec 30, 2020 at 23:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.