About NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg91824] About NDSolve
- From: P_ter <petervansummeren at gmail.com>
- Date: Tue, 9 Sep 2008 06:57:06 -0400 (EDT)
Hello, Daniel Lichtblau wrote in "Re: phase-space versus controlling parameter surface": k = .3; Clear[g]; g[b_?NumberQ] := g[b] = {x[t], v[t], b} /. First[NDSolve[{x'[t] == v[t] , v'[t] == -x[t]^3 - k*v[t] + b*Cos[t], x[0] == 1, v[0] == 0}, {x, v}, {t, 0, 2000}, MaxSteps -> Infinity]] pts = Table[ Evaluate[Table[g[b], {b, 0.2, 0.6, .01}]], {t, 1950, 2000}]; If I use h[s_]:= s^3 and replace x[t]^3 by h[x[t]], NDSolve in pts complains. Why can't I do this? Piecewise or Which (e.g., Which[x[t] < -1, -1, x[t] > 1, 1, True, x[t]]) on the place of x[t]^3 also gives problems. Any suggestions? P_ter