Re: Pulse Function




Greg Hansen wrote:
Martin wrote:
Hey folks, I need a little help with something. I have a set of three
equations that describe Y values for different portions of a graph with
0 <= X <= 30. The first equation, f(X_1), describes the portion 0 <= X
<= 10. The second equation, f(X_2), describes the portion 11 <= X <=
20, and the third equation, f(X_3), describes 21 <= X <= 30. I want to
combine these three equations into a single formula,

Y= f(X_1) + f(X_2) + f(X_3) (1)

But in this form, I would just have a mess. However, if for each term
on the right of (1), I include a factor that reduces the term to 0 for
values of X outside of the relevant range and is otherwise equal to 1,
then the equation would work. The final equation would look like this:

Y= g(X_1)* f(X_1) + g(X_2)*f(X_2) +g(X_3)* f(X_3)

where

g(X_1) = 1 for 0 <= X <= 10 and is otherwise 0
g(X_2) = 1 for 11 <= X <= 20 and is otherwise 0
g(X_3) = 1 for 21 <= X <= 30 and is otherwise 0

I found a Laplace transform, the pulse function, that seems to do what
I want. The pulse function is

F(t) = {exp(-as)*[1-exp(-epsilon*s)]}/s

What confuses me about this is that the left side is a function of t
(the x variable) and the right side is a function of s. I have tried to
simply replace s with t, but I'm not able to get it to work, probably
because my background in math doesn't include Laplace transforms. (I'm
not a physicist.)

Returning to the equation,

Y= g(X_1)* f(X_1) + g(X_2)*f(X_2) +g(X_3)* f(X_3)

I'm suspicious that my goal can not be achieved. What makes me
suspicious is that if it can be done, this approach could be used to
describe arbitrary curves of any kind. Mathematicians would already be
using it all over, but, as far as I know, this approach is not included
in curve fitting methods. If it can be done, can someone show me how to
configure the pulse function such that it is equal to 1 along an
interval and otherwise 0? An example would be especially helpful.

Thanks for any feedback.

Martin


The Laplace transform is a technique for reducing differential equations
to an algebraic form so that they can be solved more easily and then, if
needed, be converted back to the time domain by an inverse transform.
If you just want to represent your function, use the unit step.

y(x) = u(x)u(10-x)f1(x) + u(x+10)u(20-x)f2(x) + u(x+20)u(30-x)f2(x)

where u(x)=1 for x>=0 and u(x)=0 for x<0. And, for instance,
u(x+10)u(20-x) = 1 for 10<x<20, and zero otherwise.

If you'd be evaluating your function numerically it's easy enough to
write a step function if your software doesn't include one. But if
you're just writing it out, normally people would write out each peice
and its domain seperately, like

f1(x) for 0<x<10
y(x) = f2(x) for 10<x<20
f3(x) for 20<x<30
0 otherwise

with a big left curly bracket { embracing the terms on the left hand side.


Thanks, all of you. This stuff is new to me. I studied Laplace
transforms 20 years ago, but have completely forgotten it. However, I
think I have this issue resolved now. There wouldn't be much point in
combining the three equations into one. As Greg has pointed out, I can
just present them as a set. I have been confused, though, about how we
feed a value into the step function and get something out in return. If
y = x^2, we have a specification for the operation to perform on x to
get y. The step function doesn't seem to specify how a certain value of
x produces a 1 or 0. I could use some help with that.

.