- #1
Dustinsfl
- 2,281
- 5
I am getting this error in Mathematica from the code below:
Computed derivatives do not have dimensionality consistent with the initial conditions
Computed derivatives do not have dimensionality consistent with the initial conditions
Code:
ClearAll["Global`*"]
\[Mu] = 398600;
s = NDSolve[{x1'[t] == x2[t],
y1'[t] == y2[t],
z1'[t] == z2[t],
x2'[t] == -\[Mu]*x1[t]/(x1[t]^2 + y1[t]^2 + z1[t]^2)^{3/2},
y2'[t] == -\[Mu]*y1[t]/(x1[t]^2 + y1[t]^2 + z1[t]^2)^{3/2},
z2'[t] == -\[Mu]*z1[t]/(x1[t]^2 + y1[t]^2 + z1[t]^2)^{3/2},
x1[0] == -201000*Sqrt[3],
y1[0] == 201000,
z1[0] == 0,
x2[0] == -2.04119,
y2[0] == 0.898024,
z2[0] == 0}, {x, y, z}, {t, 0, 50}];