Re: How to define a polyfunction?
- To: mathgroup at smc.vnet.net
- Subject: [mg27403] Re: How to define a polyfunction?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Sun, 25 Feb 2001 00:53:26 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <974vp8$6jh@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, in the last case it's easy as well: golf[t_] := t^2 - t keycond[tau_?NumericQ] := Module[{t}, TrueQ[D[golf[t], t] > 0 /. t -> tau]] Key[t_?NumericQ] /; keycond[t] := t^4 + t*3 Key[t_?NumericQ] := (t^2.5 - t) Regards Jens liwen liwen wrote: > > 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 yahoo.com > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/