Re: NDSolve[]
- To: mathgroup at smc.vnet.net
- Subject: [mg123534] Re: NDSolve[]
- From: Frederick Bartram <bartramf at acm.org>
- Date: Sat, 10 Dec 2011 07:29:59 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112091058.FAA03928@smc.vnet.net>
- Reply-to: bartramf at acm.org
Well, if your stumped then I don't know if I can help Sorry, if this is a trivial answer but from the documentation the two forms are not strictly equivalent. From the documentation for "Derivative": f' is equivalent to Derivative[1][f]. So > NDSolve[{Derivative[x[t], t] == -y[t] - x[t]^2, > Derivative[y[t], t] == 2*x[t] - y[t], x[0] == y[0] == 1}, {x, > y}, {t, 10}] should be NDSolve[{Derivative[1][x][t] == -y[t] - x[t]^2, Derivative[1][y][t] == 2*x[t] - y[t], x[0] == y[0] == 1}, {x, y}, {t, 10}] Another example of behavior that is not quite what you might expect... *------------------------------------------------- * Frederick Bartram * PGP key id: 0x63fa758 keyserver: http://keyserver.pgp.com */ > Z > Subject: [mg123513] NDSolve[] > To: mathgroup at smc.vnet.net > > For the same equations, why does the first method as following give > the error but the other one give the desired result? > > NDSolve[{Derivative[x[t], t] == -y[t] - x[t]^2, > Derivative[y[t], t] == 2*x[t] - y[t], x[0] == y[0] == 1}, {x, > y}, {t, 10}] > > NDSolve[{x'[t] == -y[t] - x[t]^2, y'[t] == 2*x[t] - y[t], > x[0] == y[0] == 1}, {x, y}, {t, 10}] >
- References:
- [no subject]
- From: "Steven M. Christensen" <steve@smc.vnet.net>
- [no subject]