RE: Why these graphs differ?
- To: mathgroup at smc.vnet.net
- Subject: [mg33953] RE: [mg33925] Why these graphs differ?
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 24 Apr 2002 01:22:11 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Vladimir,
The first plot is no good at all. The Mathematica iterator substitutes the
numerical value of z into the DSolve statement and THEN evaluates DSolve.
But by then the statement makes no sense, so you obtain error messsages. For
example, when z -> 0.5 the DSolve statement is
DSolve[{y'[0.5] == 0.5, y[0] == 1}, y[0.5], 0.5]
which is no good at all. (I'm not certain why Mathematica gives any plot at
all.)
The second Plot statement works because the DSolve statement is evaluated
first. Then the iteration is done.
Generally, I would tend to do the differential equation solving first, and
copy or define the resulting function, and then do the Plotting. Otherwise
you are entangling two operations - each of which can present their own
complications.
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
> From: Vladimir Bondarenko [mailto:vvb at mail.strace.net]
To: mathgroup at smc.vnet.net
>
> 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?
>
>
> Vladimir Bondarenko
>
>
>