MathGroup Archive 1999

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

Search the Archive

Re: Why doesn't this work?


Joe Strout <joe at strout.net> schrieb:
> I'm trying to understand why a temporary is needed in the following
> case.  I've got a function of one parameter and two constants.  I
> define the constants on the fly with "/.".  I want to find a root of
> this equation.  When I use "/." in FindRoot, it doesn't work, but if I
> create another function that has these as true constants (rather than
> symbols), FindRoot works.  I don't understand why these two cases are
> different.
>
> Here's my function (a difference of gaussians):
>
> Dog[t_] := (t/tau1)^6 * Exp[-6 * (t/tau1 - 1)] - (t/tau2)^6 * Exp[-6 *
> (t/tau2 - 1)]
>
> Here's my first attempt to find a root, and the result:
>
> FindRoot[(Dog[t]==0) /. { tau1->13.7, tau2->24.8}, {t, 20}]
> FindRoot::frnum: Function {False} is not a length 1 list of numbers at
> {t} = {20.}.
[*** snipp ***]

Joe,

FindRoot[Evaluate[(Dog[t]==0) /. { tau1->13.7, tau2->24.8}], {t, 20}]

works.

  Peter

=--=--=--=--=--=--=--=--=--=--=--=--=  http://home.t-online.de/home/phbrf  =--=
=--= Peter Breitfeld, Saulgau, Germany        PGP public key: 08548045  =--=--=



  • Prev by Date: New user question
  • Next by Date: Display problems
  • Previous by thread: Re: Why doesn't this work?
  • Next by thread: Re: Why doesn't this work?