Puzzling HoldFirst behaviour
- To: mathgroup at smc.vnet.net
- Subject: [mg63053] Puzzling HoldFirst behaviour
- From: "Matt" <anonmous69 at netscape.net>
- Date: Sun, 11 Dec 2005 22:25:29 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, Given the following: Clear[indyVar,t,depVar,y,interval,outOne,eqnOut]; << "Graphics`PlotField`" indyVar = t; depVar = y; interval = {indyVar, 0, 4}; outOne = {eqnOut -> {Derivative[1][y][t]} == {y[t]}}; This works (notice the lack of a call to 'Evaluate' on the first argument to PlotVectorField): (eqnOut /. outOne)[[2,1]] /. {depVar[indyVar] -> depVar} (* the output of this is y *) PlotVectorField[{1, (eqnOut /. outOne)[[2,1]] /. {depVar[indyVar] -> depVar}}, interval, {depVar, 0, 10}]; However, if outOne is instead this- outOne = {eqnOut -> {Derivative[1][y][t]} == {t}}; then the same call fails in this form: (eqnOut /. outOne)[[2,1]] /. {depVar[indyVar] -> depVar} (* the output of this is t *) PlotVectorField[{1, (eqnOut /. outOne)[[2,1]] /. {depVar[indyVar] -> depVar}}, interval, {depVar, 0, 10}]; but works in this form: PlotVectorField[Evaluate[{1, (eqnOut /. outOne)[[2,1]] /. {depVar[indyVar] -> depVar}}], interval, {depVar, 0, 10}]; I don't understand why Evaluate is necessary in the 2nd case but not the 1st. Thanks for any insight, Matt