Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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


  • Prev by Date: Re: general nth term of series
  • Next by Date: Pattern matching question and answer
  • Previous by thread: Re: How to compute this sum?
  • Next by thread: Pattern matching question and answer