# Getting error Solve::units [closed]

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.

Clear["Global*"]
G = Quantity[1 , "GravitationalConstant"];
Ms = Quantity[1, "SolarMass"];
P = Quantity[6, "Days"];
Tdur = Quantity[4, "Hours"];

Solve[
{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.

Clear["Global*"]


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]


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

• thanks for the answer, //Unitconvert doesn't seem to make any difference. Dec 30, 2020 at 22:54
• 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. Dec 30, 2020 at 23:06