MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NDSolve[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123549] Re: NDSolve[]
  • From: "Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com>
  • Date: Sun, 11 Dec 2011 03:45:24 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112091058.FAA03928@smc.vnet.net> <jbvjs0$j34$1@smc.vnet.net>

I don't know about it being unexpected. Derivative is used to define a  
differential operator, not to perform differentiation. Derivative[x[t], t]  
is valid syntactically and logically, but represents a bare differential  
operator (not acting on any function) that differentiates its argument  
x[t] times with respect to the first parameter and t times with respect to  
the second parameter. As stated in the documentation for Derivative, the  
form intended here, i.e. x'[t] or Derivative[1][x][t], is converted  
automatically into D[x[t], t] to obtain the actual derivatives, so it  
really doesn't matter which of the three is used, as long as one avoids  
confusion between the different forms.

On Sat, 10 Dec 2011 12:38:24 -0000, Frederick Bartram <bartramf at acm.org>  
wrote:

> 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:  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>
  • Prev by Date: Re: Can FindFit take two (or more) equations?
  • Next by Date: Re: color-bar legend for the LisContourPlot
  • Previous by thread: Re: NDSolve[]
  • Next by thread: LinearProgramming[]