MathGroup Archive 2002

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

Search the Archive

RE: Re: Why these graphs differ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33970] RE: [mg33942] Re: Why these graphs differ?
  • From: "DrBob" <majort at cox-internet.com>
  • Date: Thu, 25 Apr 2002 02:59:39 -0400 (EDT)
  • Reply-to: <drbob at bigfoot.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Jens Wrote:
>>The Part[expr,1,1,2] is z for expr:> DSolve[{y'[z] == z, y[0] == 1},
y[z], z]

>>and the Part[expr,1,1,2] is (2+z^2)/2 for expr:>  {{y[z] -> (2
+z^2)/2}}

No, that's not the problem.  The two expressions (including Part)
evaluate to precisely the same thing.  The problem is that the first
expression isn't an explicit function of z, to match the Plot iterator,
until it's evaluated --- and Plot holds the first argument unevaluated
until a specific iterator value is assigned.

Bobby Treat

-----Original Message-----
From: Jens-Peer Kuska [mailto:kuska at informatik.uni-leipzig.de] 
To: mathgroup at smc.vnet.net
Subject: [mg33970] [mg33942] Re: Why these graphs differ?

Vladimir Bondarenko wrote:
> 
> These solutions, naturally, coincide.
> 
>          DSolve[{y'[z] == z, y[0] == 1}, y[z], z][[1, 1, 2]]
> Evaluate[DSolve[{y'[z] == z, y[0] == 1}, y[z], z][[1, 1, 2]]]
> 
> (2 + z^2)/2
> (2 + z^2)/2
> 
> But, surprisingly, the corresponding graphs are not identical:
> 
> Plot[         DSolve[{y'[z] == z, y[0] == 1}, y[z], z][[1, 1, 2]],
{z, 0, 1}]
> Plot[Evaluate[DSolve[{y'[z] == z, y[0] == 1}, y[z], z][[1, 1, 2]]],
{z, 0, 1}]
> 
> Is it a feature or a problem?

The Part[expr,1,1,2] is z for expr:> DSolve[{y'[z] == z, y[0] == 1},
y[z], z]

and the Part[expr,1,1,2] is (2+z^2)/2 for expr:>  {{y[z] -> (2 +
z^2)/2}}

so there is no wonder, that the results are differnt. Different
expressions
may have also different parts.

Regards
  Jens





  • Prev by Date: Re: How to change time stepsize for Integration
  • Next by Date: RE: invisible graphics
  • Previous by thread: RE: Why these graphs differ?
  • Next by thread: Re: Re: Why these graphs differ?