6

I defined a rectangle function as below:

rect[t_, T_] := (Sign[t] - Sign[t - T])/2

The laplace transform should be

$$ \frac{1-e^{-sT}}{s} $$

But the code below in Mathematica won't work:

LaplaceTransform[rect[t, T], t, s] // Simplify

It just throw out the answer below after some long time:

1/2 (1/s - LaplaceTransform[Sign[t - T], t, s])

I think the problem comes from the factor 'T', because it can handle rect[t,1] or rect[t,10]..., well.

Then how to do the laplace transformation of this function rect[t, T] with 'T' given as a variable.

diverger
  • 407
  • 1
  • 4
  • 12

1 Answers1

8

Workaround:

rect[t_, T_] := Sign[t] - HeavisideTheta[t - T];(*Or:Sign[t] - UnitStep[t - T]*)
FullSimplify[LaplaceTransform[rect[t, T], t, s], Assumptions -> T > 0]
(* (1 - E^(-s T))/s  *) 

Edited:

rect[t_, T_] := (Sign[t] - Sign[t - T])/2;
Assuming[T > 0, LaplaceTransform[rect[t, T], t, s]] // Simplify
(* (1 - E^(-s T))/s  *) 
Mariusz Iwaniuk
  • 13,841
  • 1
  • 25
  • 41