Re: Simplify with If and UnitStep
- To: mathgroup at smc.vnet.net
- Subject: [mg31306] Re: Simplify with If and UnitStep
- From: bghiggins at ucdavis.edu (Brian Higgins)
- Date: Sat, 27 Oct 2001 01:08:15 -0400 (EDT)
- References: <9rb8be$5m9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hugo, Have you thought of using the condition function to generate step functions, e.g. g[t_ /; 1/t^.3 > 32] := 3200 g[t_ /; 1/t^.3 <= 32] := Integrate[ M^2.55, {M, 0.1, 1/t^.3}] Thus In[81]:=g[.000002] Out[81]=3200 In[82]:=g[.2] Out[82]=1.5637 This avoids the use of If statements. The drawback is you cannot differentiate and do other manipulations on g[t]. If you must use Unit step functions, perhaps you can provide some details of how you generate the step functions in the first place as your If statement seems to contain superfluous information. Regards, Brian