## Constant function Integrate Assumption - More

### Constant function Integrate Assumption - More

Many thanks to everyone offering solutions to my dilemma. In trying to
simplify the problem, I must have slipped up and oversimplified.

Integrate[50000 Units/Year UnitStep[(t-5 Month)/Month], t]

50000 Units/Year (t-5 Month) UnitStep[(t-5 Month)/Month].

I need the full answer so that the units work out correctly in the answer.
I am starting with a sale rate and want to derive the total sales as a
function of time. This time may then be input as Days, Months, Years....
If I perform the replace operation, as many of you suggest, this ability
disappears.

A lister rightly pointed out that Mathematica is confused not because it
assumes that Month may be a function of t, but rather it does not know the
sign of Month. Even using the assumption Month>0 does not fix the problem.

Other suggestions?

### Constant function Integrate Assumption - More

Integrate[50000*(Units/Year)*
UnitStep[(s - 5*Month)/Month], {s, -Infinity, t},
Assumptions -> Month > 0]

(50000*(t - 5*Month)*Units*UnitStep[t/Month - 5])/Year

### Constant function Integrate Assumption - More

Daryl,

more recent posting.

The solution to this problem is to first keep units out of the symbolic
equations, and second to use the V4ExtendUnits package from my web site,
which handles units in DiracDelta, UnitStep and two argument ArcTan
expressions. Here is how I would do your calculation with ExtendUnits.

Needs["Miscellaneous`V4ExtendUnits`"]

First I install a new unit, Widget. You might install units for any item
that is manufactured. In this case Widget is actually unitless, since it is
a count.

InstallNewUnit[Widget -> 1]

Now I set up the data for your calculation. The units always go with the
numbers. The units are part of the data. The units should not explicitly

data = {t0 -> 5 Month, baserate -> 50000 Widget/Year};

Now we define the total units function. Notice - no units!

totalunits[t_] = baserate*Integrate[UnitStep[t - t0], t]

If you want to calculate the total units after 8 months (doing it in
steps)...

totalunits[8Month]
% /. data
% // ToUnit[Widget]

baserate (8 Month - t0) UnitStep[8 Month - t0]
(150000*Month*Widget*UnitStep[3*Month])/Year
12500. Widget

Or all at once...

totalunits[8 Month] /. data // ToUnit[Widget]
12500. Widget

Suppose you want to create a function to plot. We have to get rid of all the
units and use implied units. This is done with the Deunitize function.

nwidgets[t_] = Deunitize[totalunits[t Month] /. data, {t}]
0.00158549 (-13140000 + 2628000 t) UnitStep[-13140000 + 2628000 t]

Plot[nwidgets[t], {t, 0, 17},
PlotRange -> All,
AxesLabel -> {Months, Widgets}];

If you want a formula for the Gross number of widgets as a function of years
you can use...

nwidgets2[t_] = Deunitize[totalunits[t Year]/Gross /. data, {t}]
0.0000110103 (-13140000 + 31536000 t) UnitStep[-13140000 + 31536000 t]

Plot[nwidgets2[t], {t, 0, 3},
PlotRange -> All,
AxesLabel -> {Years, "Gross Widgets"}];

David Park
XXXX@XXXXX.COM
http://www.yqcomputer.com/ ~djmp/

From: Reece, Daryl [mailto: XXXX@XXXXX.COM ]

Many thanks to everyone offering solutions to my dilemma. In trying to
simplify the problem, I must have slipped up and oversimplified.

Integrate[50000 Units/Year UnitStep[(t-5 Month)/Month], t]

50000 Units/Year (t-5 Month) UnitStep[(t-5 Month)/Month].

I need the full answer so that the units work out correctly in the answer.
I am starting with a sale rate and want to derive the total sales as a
function of time. This time may then be input as Days, Months, Years....
If I perform the replace operation, as many of you suggest, this ability
disappears.

A lister rightly pointed out that Mathematica is confused not because it
assumes that Month may be a function of t, but rather it does not know the
sign of Month. Even using the assumption Month>0 does not fix the problem.

Other suggestions?