Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Re:How to define a polyfunction?

  • To: mathgroup at
  • Subject: [mg27426] Re: Re:How to define a polyfunction?
  • From: "Allan Hayes" <hay at>
  • Date: Sun, 25 Feb 2001 00:53:54 -0500 (EST)
  • References: <974vp8$>
  • Sender: owner-wri-mathgroup at

An addition to my earlier posting.

The earlier ways allow changes in golf to to affect Key, they also carry the
penalty that golf must be differentiated each time that Key is evaluated.
The following does the differentiation in setting the definition for Key,
but subsequent changes to golf will have no effect

Block[{ t},Key[t_] =


Here is what we have stored



Key[t_] = If[-1 + 2*t > 0, t^4 + t*3, t^2.5 - t]

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"liwen liwen" <gzgear at> wrote in message
news:974vp8$6jh at
> Dear friend,
>          How are you!Now I encounter a problem that I
> can not solve for a long time .
> It can be express simplely as how to define a
> polyfunction,for example,a simple polyfunction may be
> defined as that:
> Key[t_]:=If[(t>0),1,0];
> It is easy to define.However,it will be more difficult
> when the condition turns more complicate.For instance:
> golf=t^2-t;
> Key[t_]:=If[(D[golf[t],t]>0),(t^4+t*3),(t^2.5-t)];
> Best regards,
> Liwen
> E-mail:  gzgear at
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices!

  • Prev by Date: Re: export eps with fonts 4.01?
  • Next by Date: Re: Extracting units from a list of values
  • Previous by thread: Re: How to define a polyfunction?
  • Next by thread: Re: How to define a polyfunction?