Why does this not work? I expect the output would be something like 1/s*e^-(sT)
.
Assuming[T > 0,
LaplaceTransform[UnitStep[t - T], t, s]] // FullSimplify
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityYou have to put FullSimplify
inside Assuming
because Assuming
does not change the properties of an expression but instead, it creates a limited scope with a modified value for $Assumptions
Assuming
is not been used by LaplaceTransform
to do FullSimplify
and where you place the your explicit FullSimplify
with respect Assuming
matters.
Not all functions take $Assumptions
into account, most will just ignore it.
From the documentation
Assuming[assum,expr]
evaluatesexpr
withassum
appended to$Assumptions
, so thatassum
is included in the default assumptions used by functions such asRefine
,Simplify
, andIntegrate
. Assuming affects the default assumptions for all functions that have an Assumptions option.
LaplaceTransform
does have Assumptions
as Options
so it will give you an answer that is compatible with those $Assumptions
MemberQ[Assumptions]@Keys[Options[LaplaceTransform]]
True
However, LaplaceTransform
doesn't use those $Assumptions
to FullSimplify
the expression the way you may expect, as FullSimplify
can take too long to run or it may go too far and do something you may not necessarily want .
The documentation for FullSimplify
warns :
Some of the transformations used by
FullSimplify
are only generically correct.Results of simplification of singular expressions are uncertain.
Now, look at the order you are evaluating things, by the time FullSimplify
evaluates the expression, your specified $Assumptions
have been dropped.
Assuming[
T > 0, (* Modified $Assumptions affect LaplaceTransform *)
LaplaceTransform[UnitStep[t - T], t, s]
] // FullSimplify (* Only default $Assumptions affect FullSimplify *)
By changing the evaluation order, you can make FullSimplify
to be within the scoping environment where $Assumptions
is modified.
Assuming[
T > 0, (* Modified $Assumptions affect both LaplaceTransform and FullSimplify *)
LaplaceTransform[UnitStep[t - T], t, s] // FullSimplify
]
Think of Assuming
as equivalent to
Block[
{ $Assumptions = T>0 },
LaplaceTransform[UnitStep[t - T], t, s]
]
If you leave FullSimplify
outside Block
then it will not see the modified $Assumptions
.
Block[
{ $Assumptions = T>0 },
LaplaceTransform[UnitStep[t - T], t, s]
] // FullSimplify
If you put FullSimplify
inside Block
then it will see the modified $Assumptions
.
Block[
{$Assumptions =T>0},
LaplaceTransform[UnitStep[t - T], t, s] // FullSimplify
]
Block[ {$Assumptions =T>0}, LaplaceTransform[UnitStep[t - T], t, s] ]
?
$\endgroup$
LaplaceTransform
will give you an answer that is consistent with the $Assumptions
but without attempting to simplify the answer in the same way FullSimplify
does.
$\endgroup$
LaplaceTransform[UnitStep[t - T], t, s]
produces the same exact expression without using assumption. Or LaplaceTransform just assumed T > 0 by default somehow?
$\endgroup$
Block[ {$Assumptions =T>0}, LaplaceTransform[UnitStep[t - T], t, s] ]
and LaplaceTransform[UnitStep[t - T], t, s]
. So the Block with the assumption doesn't seem to be used in the first case.
$\endgroup$
FullSimplify[LaplaceTransform[UnitStep[t - T], t, s], T > 0]
and I don't know the exact reason for this. $\endgroup$Assuming[T > 0, Refine[LaplaceTransform[UnitStep[t - T], t, s]]]
$\endgroup$