Creating my own mathematical function

90 Views Asked by At

I want to model a excitation decay function, with a similar morpholofy as $f(x) = \frac{1}{x}$.

I have the following features that I want my function to comply with. First, I want to control the number of points to become zero, that is, I want to control if the signal goes to zero after $20$ points, or $40$ points, or other size.

In summary, I want the function to start at a maximum of $N$ and decay in a shape similar as$\frac{1}{x}$ and finally becomes zero after $M$ points.

More info:

  • the function is define from [0, M].
  • The global maximum is at 0, and the minimum is at M, where at M the signal is zero. from 0 and above the signal is zero.

How could I design such a function?

1

There are 1 best solutions below

3
On

I'm not exactly sure if you want it to almost completely flatten before it goes to zero, but with the information you gave, I assume you could use a rational function that has an $x$ intercept at $M$ and a $y$ intercept at $N$. The function would be:

$$ f(x) = \frac{M-x}{x + \frac{M}{N}} $$

This is a function that generates a graph that looks like $y=\frac{1}{x}$ and has an $x$ intercept at $M$ and a $y$ intercept at $N$. Just change $M$ and $N$ to the values you want.