MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LaplaceTransform[SquareWave[]] ??

  • To: mathgroup at
  • Subject: [mg107304] Re: LaplaceTransform[SquareWave[]] ??
  • From: "Nasser M. Abbasi" <nma at>
  • Date: Mon, 8 Feb 2010 07:54:40 -0500 (EST)
  • References: <hkoich$t3c$>

On Feb 8, 12:35 am, Geico Caveman <spammers-go-h... at spam.invalid>
> In[1]:=LaplaceTransform[SquareWave[t], t, s]
> Out[1]:=LaplaceTransform[SquareWave[t], t, s]
> That is a pretty standard Laplace transform. What gives ?
> LaplaceTransform[l'[t]] is fine.
> I am using Mathematica 7 on Mac OSX Snow Leopard.

My guess is that you should not use SquareWave as is for this sort of
thing. There seems to be some limit:


All of the above gives 0 as expected. But


failes with the error

"Integrate::mpwc: {At Line = 22, the input
was:,Integrate[SquareWave[t],{t,0,100}],Integrate} was unable to
convert {At Line = 22, the input was:,Integrate[SquareWave[t],{t,
0,100}],Floor[t]} to Piecewise, because the required number {At Line 
22, the input was:,Integrate[SquareWave[t],{t,0,100}],101} of
piecewise cases sought exceeds the internal limit $MaxPiecewiseCases 
{At Line = 22, the input was:,Integrate[SquareWave[t],{t,0,100}],100}.

So, there is an internal limit $MaxPiecewiseCases

In[24]:= $MaxPiecewiseCases
Out[24]= 100

So, my guess is that the Laplace integral

Integrate[SquareWave[t]*Exp[-s t],{t,0,Infinity}]

Was failing internally on this limit. Because when I do

Integrate[SquareWave[t]*Exp[-s t],{t,0,99}]
It works, but
Integrate[SquareWave[t]*Exp[-s t],{t,0,100}]
it fails
and infinity is more than 100, so LaplaceTransform[] must have hit
this internally somewhere, but did not report it?

But the square wave is a simply function, it flips between 1 and -1
with period 1, so we can directly do the Laplace integral on it.

Split the integral into 2 parts. One part does the part when the wave
is +1, and the second integral does the part when the wave is -1. Then
add the 2 integrals together, and take the limit to infinity, I get


Here is the code:

int1=Integrate[Exp[-s t],{t,k,k+1/2}];
int2=Integrate[Exp[-s t],{t,k+1/2,k+1}];
Sum[ int1-int2,{k,0,M}]//FullSimplify;

Out[112]= Tanh[s/4]/s

Is this is correct Laplace transform for square wave?


  • Prev by Date: Re: NDSolve with Dirichlet boundary condition
  • Next by Date: Re: Derivative of Interpolation function is
  • Previous by thread: LaplaceTransform[SquareWave[]] ??
  • Next by thread: Re: LaplaceTransform[SquareWave[]] ??