Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7090 > unrolled thread

Re: NDSolve[]

Started byFrederick Bartram <bartramf@acm.org>
First post2011-12-10 12:38 +0000
Last post2011-12-11 08:47 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: NDSolve[] Frederick Bartram <bartramf@acm.org> - 2011-12-10 12:38 +0000
    Re: NDSolve[] "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-12-11 08:47 +0000

#7090 — Re: NDSolve[]

FromFrederick Bartram <bartramf@acm.org>
Date2011-12-10 12:38 +0000
SubjectRe: NDSolve[]
Message-ID<jbvjs0$j34$1@smc.vnet.net>
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@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}]
>

[toc] | [next] | [standalone]


#7134

From"Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Date2011-12-11 08:47 +0000
Message-ID<jc1qmh$ssr$1@smc.vnet.net>
In reply to#7090
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@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@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}]
>>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web