Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-l] solving an energy equation



Thanks to John Denker for such a clear exposition. Very helpful.

In my case, we have V as a function of y, so it's known at all points. We conclude that we know all we need to know, indeed. So why can't Mathematica "figure out" how to do the numerical timestepping? In other words, why can't it do whatever derivatives it needs to solve the following problem?

It complains about the following:

f[t] := (x'[t])^2 == 1 - 2x[t]
g[t] := D[f[t], t]

sol1 = NDSolve[{f[t], x[0] == 0}, x, {t, 0, 2}]
Plot[x[t] /. sol1, {t, 0, 2}]

but is perfectly happy with the following, even though I'm not supplying any new information:

sol2 = NDSolve[{g[t], x[0] == 0, x'[0] == 1}, x, {t, 0, 2}]
Plot[x[t] /. sol2, {t, 0, 2}]

This appears to me to be some sort of defect in the way Mathematica is coded. Or am I missing something?
--
Carl E. Mungan, Asst Prof of Physics 410-293-6680 (O) -3729 (F)
Naval Academy Stop 9c, 572C Holloway Rd, Annapolis MD 21402-5002
mailto:mungan@usna.edu http://usna.edu/Users/physics/mungan/