3
$\begingroup$

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

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ FullSimplify[LaplaceTransform[UnitStep[t - T], t, s], T > 0] and I don't know the exact reason for this. $\endgroup$
    – Syed
    Nov 9, 2022 at 16:16
  • $\begingroup$ @Syed what would be the reason that my code not work? $\endgroup$
    – internet
    Nov 9, 2022 at 16:18
  • $\begingroup$ Assuming[T > 0, Refine[LaplaceTransform[UnitStep[t - T], t, s]]] $\endgroup$
    – Syed
    Nov 9, 2022 at 16:22
  • $\begingroup$ @Syed I see. I only works with some functions such as Refine or Simplify. So I probably always have to wrap the expression around these functions. $\endgroup$
    – internet
    Nov 9, 2022 at 16:27
  • 2
    $\begingroup$ I'm neither a developer nor very knowledgeable, but I think I do have the answer. Please do let me know if this helps. $\endgroup$
    – rhermans
    Nov 9, 2022 at 17:18

1 Answer 1

7
$\begingroup$

TL;DR;

You 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

Long Explanation

Assuming is not been used by LaplaceTransform to do FullSimplify and where you place the your explicit FullSimplify with respect Assuming matters.

Background

Not all functions take $Assumptions into account, most will just ignore it.

From the documentation

Assuming[assum,expr] evaluates expr with assum appended to $Assumptions, so that assum is included in the default assumptions used by functions such as Refine, Simplify, and Integrate. Assuming affects the default assumptions for all functions that have an Assumptions option.

enter image description here

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.

Your case

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  *)

enter image description here

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
] 

enter image description here

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
] 

enter image description here

$\endgroup$
6
  • $\begingroup$ Thanks for the detalied and interesting answer. Why does the assumption not have any effect in this case Block[ {$Assumptions =T>0}, LaplaceTransform[UnitStep[t - T], t, s] ]? $\endgroup$
    – internet
    Nov 9, 2022 at 17:18
  • $\begingroup$ It does, but as explained, 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$
    – rhermans
    Nov 9, 2022 at 17:21
  • $\begingroup$ But LaplaceTransform[UnitStep[t - T], t, s] produces the same exact expression without using assumption. Or LaplaceTransform just assumed T > 0 by default somehow? $\endgroup$
    – internet
    Nov 9, 2022 at 17:23
  • $\begingroup$ @internet I don't understand your last comment. $\endgroup$
    – rhermans
    Nov 10, 2022 at 12:03
  • $\begingroup$ These two codes give the exact same result: 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$
    – internet
    Nov 11, 2022 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.