0
|
11601 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# How can I solve this ImplicitRegion Error in NDSolve?

Posted 10 years ago
 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] 
3 Replies
Sort By:
Posted 10 years ago
 The easiest way to set up the equations of motion in polar co-ordinates is to use the Euler-Lagrange equation.http://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equationThe Mathematica function EulerEquations will generate them from the Lagrangian, which is the kinetic energy minus the potential energy, in the coordinates of interest. The analytic solution, an ellipse, is obtained by a change of variable u = 1/r.
Posted 10 years ago
 Well that's true but I think the Hamiltonian is the more powerful representation and perhaps we should consider the symmetry elements? Functionals and extreemals?Any thoughts on my random jottings, fae bonnie scotland?
Posted 10 years ago