Can I "y(s):=laplace(y(t),t,s);"?




On Wed, 11 Mar 2009, Alexey Beshenov wrote:

< At Wed, 11 Mar 2009 13:34:33 +0100,
< Javier Arantegui wrote:
< > 
< > Hi!
< > 
< > Sadly I'm too ignorant to know if this is a bug.
< > 
< > I want to define a function that involves the laplace transform.
< > 
< > I define a function and check the laplace transform:
< > 
< > (%i1) y(t):=sin(t);
< > (%o1)                           y(t) := sin(t)
< > (%i2) y(t);
< > (%o2)                               sin(t)
< > (%i3) laplace(y(t),t,s);
< >                                       1
< > (%o3)                               ------
< >                                      2
< >                                     s  + 1
< > 
< > Everything is fine so far. Then, I define a new function, y(s):
< > 
< > 
< > (%i4) y(s):=laplace(y(t),t,s);
< > (%o4)                     y(s) := laplace(y(t), t, s)
< > 
< > If I try to get y(t) again I get a long error:
< > 
< > 
< > (%i5) y(t);
< > Control stack guard page temporarily disabled: proceed with caution
< 
< Your definition of y is recursive (which is not intended, I think).
 
The notation used in studying Laplace transforms can be awful, because
y(t) and y(s) are though of as two distinct functions. This leads to
your recursive definition of y(s) -- cas identify y(.) as the function
with input "."

An easy solution is to denote a function of t by a lower case and a
Laplace transform by upper case.

(%i197) y(t) := sin(t);
(%o197)                         y(t) := sin(t)
(%i198) y(t);
(%o198)                             sin(t)
(%i199) laplace(y(t),t,s);
                                      1
(%o199)                             ------
                                     2
                                    s  + 1
(%i200) Y(s) := laplace(y(t),t,s);
(%o200)                   Y(s) := laplace(y(t), t, s)
(%i201) Y(1);
                                       1
(%o201)                                -
                                       2

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.