2

I am having a bit of hard time understanding the use of Evaluate when plotting the output of NDSolve. From the documentation, I enter:

sol = NDSolve[{y'[x]^2 - y[x]^2 == 0, y[0]^2 == 4}, y[x], {x, 1}]

Then I can plot without the use of Evaluate:

Plot[y[x] /. sol, {x, 0, 2}]

Which give this image:

enter image description here

Yet, when I add Evaluate (which seems to be the preference in the tutorials (currently reading tutorial/NumericalSolutionOfDifferentialEquations), but not explained in that particular tutorial, I get the following result:

Plot[Evaluate[y[x] /. sol, {x, 0, 2}]

enter image description here

How come this one is colored differently?

Michael E2
  • 235,386
  • 17
  • 334
  • 747
David
  • 14,883
  • 4
  • 44
  • 117
  • 1
    Please see http://mathematica.stackexchange.com/questions/1731/plot-draws-list-of-curves-in-same-color-when-not-using-evaluate – funnyp0ny Nov 21 '14 at 18:58

0 Answers0