I'd like to solve a differential equation with some initial conditions to get an eclipse curve for Earth's orbit using Newton's Law in a cylindrical coordinate.
NDSolve gave me two more useless solutions, so I added ImplicitRegion option. But, if I run the following code, I get an error message like this.
"The function [Rho][t] does not have the same number of arguments as independent variables (3)". >>
x[t_] := rho[t] Cos[theta[t]]
y[t_] := rho[t] Sin[theta[t]]
r[t] = ( {
{Cos[theta[t]], Sin[theta[t]]},
{-Sin[theta[t]], Cos[theta[t]]}
} ).( {
{x[t]},
{y[t]}
} ) // Simplify // Flatten
vCylinderical[t] = ( {
{Cos[theta[t]], Sin[theta[t]]},
{-Sin[theta[t]], Cos[theta[t]]}
} ).( {
{D[x[t], {t, 1}]},
{D[y[t], {t, 1}]}
} ) // Simplify // Flatten
aCylinderical[t] = ( {
{Cos[theta[t]], Sin[theta[t]]},
{-Sin[theta[t]], Cos[theta[t]]}
} ).( {
{D[x[t], {t, 2}]},
{D[y[t], {t, 2}]}
} ) // Simplify // Flatten
Thread[({x[t], y[t]} /. t -> 0) == {149.6 10^6, 0}]
Thread[(D[{x[t], y[t]}, t] /. t -> 0) == {0, 29.786 3600 }]
initialConditions = Union[%, %%];
G = 3600^2 6.673 10^-20;
M = 1.989 10^30;
interval = 9000;
diffEqs = Thread[aCylinderical[t] == {-((G M)/rho[t]^2), 0}];
Rgn = ImplicitRegion[
0 <= rho[t] <= 149.6 10^6 && 0 <= theta[t] <= 2 \[Pi], {rho[t],
theta[t]}]
NDSolve[{diffEqs, initialConditions}, {rho, theta}, {t, 0,
interval}, {rho[t], theta[t]} \[Element] Rgn]