| Author |
Comment/Response |
Denis
|
12/14/08 03:58am
Hi!
I have an assignment to calculate movement of particle in central spherical - symmetric gravitational field. All works well: plotting the whole potential, making contour plot (2D and 3D), force calculation, and solving differential equation. Even when I use parametricplot it shows me sth, but when I try to make parametricplot3D it just shows me empty box... Does that have anything to do with the initial values or am I missing sth??
Here's portion of the code:
solution =
NDSolve[{x''[t] == sila[[1]], y''[t] == sila[[2]], x[0] == 0.4,
y[0] == 7, x'[0] == 100, y'[0] == 2.5}, {x[t], y[t]}, {t, 0, 10}]
where sila= {x[t]/(x[t]^2 + y[t]^2)^2 - x[t]/(x[t]^2 + y[t]^2)^(3/2),
y[t]/(x[t]^2 + y[t]^2)^2 - y[t]/(x[t]^2 + y[t]^2)^(3/2), 0}
paramplt =
ParametricPlot[{Flatten[
Evaluate[{{x[t], y[t]} /. solution} /. t -> 1]]}, {t, 0, 100},
AspectRatio -> 1/GoldenRatio] (works)
ukupnipotencijal /. {x -> x[t], y -> y[t]}
paramp3D =
ParametricPlot3D[
Flatten[{{x[t], y[t], ukupnipotencijal} /. solution}], {t, 0, 10},
PlotStyle -> {Thick, Red}] (shows just a box...)
Is there sth wrong with the code, because it doesn't show that anything is wrong... I'm trying it on Mathematica 6 and 7.
URL: , |
|