RE: Re: Constant function Integrate Assumption

*To*: mathgroup at smc.vnet.net*Subject*: [mg47254] RE: [mg47218] Re: Constant function Integrate Assumption*From*: "David Park" <djmp at earthlink.net>*Date*: Thu, 1 Apr 2004 00:03:48 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

One way to cut through this Gordian knot is to simply not use units in symbolic expressions. I always consider units to be part of the data and not a symbolic variable. (It just makes no sense to treat a unit as a symbolic variable. Is month going to change to Meter? True, 12 Month might change to 1 Year but that just illustrates that the number value and the unit go together.) The V4ExtendUnits package at my web site handles units in UnitStep and DiracDelta (provided that the arguments evaluate to a single number with a unit), essentially by deunitizing the expressions. So, for this particular case one could use... Needs["Miscellaneous`V4ExtendUnits`"] data = {t -> 3.5 Month}; Integrate[UnitStep[t], t] % /. data % // ToUnit[Month] t UnitStep[t] 3.5 Month UnitStep[3.5 Month] 3.5 Month Here is a more complicated example... (data = {a0 -> 5 Watt Second, a1 -> 10 Watt/Second, t0 -> 1/4 Second, t1 -> 1/2 Second, ti -> 0, tf -> 1 Second}); power[t_] := a0 DiracDelta[t - t0] + a1 t UnitStep[t - t1] Integrate[power[t], {t, ti, tf}]; Simplify[%, tf > ti] % /. data // ToUnit[Joule] (1/2)*a1*UnitStep[-t1 + tf]*((-t1^2 + tf^2)*UnitStep[t1 - ti] + (tf - ti)*(tf + ti)*UnitStep[-t1 + ti]) + a0*UnitStep[-t0 + tf, t0 - ti] 8.75 Joule David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: David W. Cantrell [mailto:DWCantrell at sigmaxi.org] To: mathgroup at smc.vnet.net dsr14 at Cornell.edu (Daryl Reece) wrote: > I am trying to use units within an Integration and would like > Mathematica to understand that the units (Month) are not a function of > the integration variable, but I have not had any luck with my > attempts. > > Specifically > > Integrate[UnitStep[t Months], t] > > should yield > > t UnitStep[t] Not exactly. I'll explain in a moment. > but I get the unevaluated form, because Mathematica does not know how to > assume that Month is not a function of t. Yes, you get an unevaluated form, but that's not due to Mathematica thinking that Month (or Months, whichever) might be a function of t. Consider, for example, In[1]:= Integrate[t Month, t] Out[1]= (Month t^2)/2 showing that Mathematica assumes, just as you wish, that Month is independent of t. > I've tried Assumptions, SetAttribute, Replace...to no avail. I've > also hunted extensively online (Wolfram, this group and MathGroup) > without any results, so any help would be greatly appreciated. The problem with something like Integrate[UnitStep[t Month], t] seems to be that we cannot convince Mathematica that Month is positive unless we actually specify a numerical value for it. Note first that In[2]:= Integrate[UnitStep[Pi t], t] Out[2]= t UnitStep[t] works as desired because Mathematica knows that Pi>0. We also see that In[3]:= a=-3; Integrate[UnitStep[a t], t] Out[3]= t-t UnitStep[t] is correct because Mathematica knows that a<0. Prior to your posting, I would have thought that the following would work: In[4]:= Clear[a]; Assuming[a>0,Integrate[UnitStep[a t], t]] Out[4]= Integrate[UnitStep[a t], t] but we see, alas, that it doesn't work. So can someone suggest a way to get Integrate[UnitStep[t Month], t] to evaluate to t UnitStep[t] without having to assign a specific positive value to Month? David Cantrell