Home > Archive > Mathematica > March 2006 > laplace transform
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Marlies.Goorden@physics.unige.ch 2006-03-14, 7:58 am |
| Hi,
I have a problem with the Laplace transform of mathematica. I
want to know the laplace transform of sin(a*t).
When I type
LaplaceTransform[sin(a*t),t,s]
mathematica gives me
\sqrt(a^2) sign(a)/(a^2+s^2)
On the other hand my mathematics books gives the answer
a/(s^2+a^2)
For complex a the answer is not the same. If I choose for
example
a=0.3+0.5i and
s=1
the two formulas give me
-0.096+0.65i and 0.51+0.41i respectively.
A numerical integration,
i.e. NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
gives me the same numerical value as the mathematics book
formula.
Is the mathematica formula wrong?
Thank you for your help,
Marlies Goorden
| |
| Pratik Desai 2006-03-15, 7:58 am |
| Marlies.Goorden@physics.unige.ch wrote:
>Hi,
>I have a problem with the Laplace transform of mathematica. I
>want to know the laplace transform of sin(a*t).
>When I type
>LaplaceTransform[sin(a*t),t,s]
>mathematica gives me
>\sqrt(a^2) sign(a)/(a^2+s^2)
>
>On the other hand my mathematics books gives the answer
>a/(s^2+a^2)
>
>For complex a the answer is not the same. If I choose for
>example
>a=0.3+0.5i and
>s=1
>the two formulas give me
>-0.096+0.65i and 0.51+0.41i respectively.
>
>A numerical integration,
>i.e. NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
>gives me the same numerical value as the mathematics book
>formula.
>Is the mathematica formula wrong?
>Thank you for your help,
>Marlies Goorden
>
>
>
Possibly the reason for the Sign[a] might be that the Laplace transform
has a switch at the origin depending on the sign of a
In[1]:=
Plot[With[{a=1},LaplaceTransform[Sin[a*t
],t,s]],{s,-10,10}]
Plot[With[{a=-1},LaplaceTransform[Sin[a*t],t,s]],{s,-10,10}]
Assuming[a>0,LaplaceTransform[Sin[a*t],t,s]]//InputForm
Assuming[a<0,LaplaceTransform[Sin[a*t],t,s]]//InputForm
Out[1]=
⁃Graphics⁃
Out[2]=
⁃Graphics⁃
Out[4]//InputForm=
a/(a^2 + s^2)
As to the complex vals, I don't see a problem
In[5]:=
With[{a=0.3+0. 5*I,s=1},LaplaceTransform[Sin[a*t],t,s]]
//N
Integrate[Sin[(0.3+0.5*I)*t]*Exp[-t],{t,0,∞}]
Out[5]=
0.505279\[InvisibleSpace]+0.414781 \[ImaginaryI]
Out[6]=
0.505279\[InvisibleSpace]+0.414781 \[ImaginaryI]
Hope this helps
Pratik
| |
|
| <Marlies.Goorden@physics.unige.ch>
news:dv68hj$nvj$1@smc.vnet.net...
> Hi,
> I have a problem with the Laplace transform of mathematica. I
> want to know the laplace transform of sin(a*t).
> When I type
> LaplaceTransform[sin(a*t),t,s]
> mathematica gives me
> \sqrt(a^2) sign(a)/(a^2+s^2)
>
> On the other hand my mathematics books gives the answer
> a/(s^2+a^2)
>
> For complex a the answer is not the same. If I choose for
> example
> a=0.3+0.5i and
> s=1
> the two formulas give me
> -0.096+0.65i and 0.51+0.41i respectively.
>
> A numerical integration,
> i.e. NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
> gives me the same numerical value as the mathematics book
> formula.
> Is the mathematica formula wrong?
> Thank you for your help,
> Marlies Goorden
>
Hi,
you might to use Assumptions with LaplaceTransform:
In[1]:=
LaplaceTransform[Sin[a*t],t,s,Assumption
s\[Rule]a\[Element]Reals]
to obtain: a/(s^2+a^2).
Bye,
~Scout~
| |
| Jens-Peer Kuska 2006-03-15, 7:58 am |
| Hi,
for real a the expression
Sqrt[a^2]*Sign[a] == Abs[a]*Sign[a]== a and you
got
a/(a^2+s^2)
that corresponds to the answer of your mathematics
book.
And for complex a you will see that
the Laplace transform doen not exist because for
s=1/4 you get
NIntegrate[Sin[(0.3 + 0.5*I)*t]*Exp[-t/4], {t, 0,
Infinity}]
an interseting result compared to your mathematics
text book.
Regards
Jens
<Marlies.Goorden@physics.unige.ch> schrieb im
Newsbeitrag news:dv68hj$nvj$1@smc.vnet.net...
| Hi,
| I have a problem with the Laplace transform of
mathematica. I
| want to know the laplace transform of sin(a*t).
| When I type
| LaplaceTransform[sin(a*t),t,s]
| mathematica gives me
| \sqrt(a^2) sign(a)/(a^2+s^2)
|
| On the other hand my mathematics books gives the
answer
| a/(s^2+a^2)
|
| For complex a the answer is not the same. If I
choose for
| example
| a=0.3+0.5i and
| s=1
| the two formulas give me
| -0.096+0.65i and 0.51+0.41i respectively.
|
| A numerical integration,
| i.e.
NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
| gives me the same numerical value as the
mathematics book
| formula.
| Is the mathematica formula wrong?
| Thank you for your help,
| Marlies Goorden
|
| |
| Jean-Marc Gulliet 2006-03-15, 7:58 am |
| Marlies.Goorden@physics.unige.ch wrote:
> Hi,
> I have a problem with the Laplace transform of mathematica. I
> want to know the laplace transform of sin(a*t).
> When I type
> LaplaceTransform[sin(a*t),t,s]
> mathematica gives me
> \sqrt(a^2) sign(a)/(a^2+s^2)
>
> On the other hand my mathematics books gives the answer
> a/(s^2+a^2)
>
> For complex a the answer is not the same. If I choose for
> example
> a=0.3+0.5i and
> s=1
> the two formulas give me
> -0.096+0.65i and 0.51+0.41i respectively.
>
> A numerical integration,
> i.e. NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
> gives me the same numerical value as the mathematics book
> formula.
> Is the mathematica formula wrong?
No.
Mathematica works over the field of complex numbers by default.
Therefore, it assumes that 'a' is a complex coefficient. On the other
hand, you books assume that 'a' is a real. You cannot use the second
formula/formula from your books with 'a' being a complex (see below).
In[1]:=
laplaceComplex = LaplaceTransform[Sin[a*t], t, s]
Out[1]=
2
Sqrt[a ] Sign[a]
----------------
2 2
a + s
In[2]:=
laplaceReal = LaplaceTransform[Sin[a*t], t, s,
Assumptions -> a \[Element] Reals]
Out[2]=
a
-------
2 2
a + s
In[3]:=
laplaceComplex /. a -> I
Out[3]=
1
-(-------)
2
-1 + s
In[4]:=
laplaceReal /. a -> I
Out[4]=
I
-------
2
-1 + s
In[5]:=
laplaceComplex /. a -> 2
Out[5]=
2
------
2
4 + s
In[6]:=
laplaceReal /. a -> 2
Out[6]=
2
------
2
4 + s
| |
| Paul Abbott 2006-03-15, 7:59 am |
| In article <dv68hj$nvj$1@smc.vnet.net>,
Marlies.Goorden@physics.unige.ch wrote:
> I have a problem with the Laplace transform of mathematica. I
> want to know the laplace transform of sin(a*t).
> When I type
> LaplaceTransform[sin(a*t),t,s]
> mathematica gives me
> \sqrt(a^2) sign(a)/(a^2+s^2)
>
> On the other hand my mathematics books gives the answer
> a/(s^2+a^2)
>
> For complex a the answer is not the same. If I choose for
> example
> a=0.3+0.5i and
> s=1
> the two formulas give me
> -0.096+0.65i and 0.51+0.41i respectively.
>
> A numerical integration,
> i.e. NIntegrate[Sin((0.3+0.5i)*t)*Exp[-t],{t,0,Infinity}]
> gives me the same numerical value as the mathematics book
> formula.
> Is the mathematica formula wrong?
Yes and no. LaplaceTransform is making assumptions that are incompatible
with a being complex. If you enter
LaplaceTransform[Sin[a t], t, s,
GenerateConditions -> True, Assumptions -> NotElement[a,Reals]]
you get a/(s^2+a^2). Alternatively, if you put a -> x + I y then you
will get the answer that you desire:
LaplaceTransform[Sin[(x + I y) t], t, s]
Cheers,
Paul
________________________________________
_______________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul
| |
| Marlies.Goorden@physics.unige.ch 2006-03-17, 7:58 am |
| Thank your for the replies. Generating conditions indeed helps.
What I still don't understand is the following. I can generate
conditions in three ways which I think are equivalent:
LaplaceTransform[Sin[a t], t, s, GenerateConditions ->
True,
Assumptions -> NotElement[a, Reals]]
LaplaceTransform[Sin[a t], t, s, GenerateConditions ->
True,
Assumptions -> Element[a, Complexes]]
LaplaceTransform[Sin[a*t], t, s, GenerateConditions -> True,
Assumptions -> Im[a] > 0]
The second one doesn't work (this was what I was doing before
already). Can anyone tell me what the difference is? And why do
I have to generate these conditions, shouldn't mathematica
anyway assume that a is complex? Or should I always put in these
assumtpiosn when I do a laplace transform.
Thank you for your help, Marlies
| |
| hanspi 2006-03-21, 7:58 am |
| The second one does not work because Reals is a sub-set of Complexes.
They are not, as you may think, complements.
Kind regards,
Hanspeter
|
|
|
|
|