1

I'm looking for a function that approaches a y-value as x approaches infinity, something close to: $$y=\frac{x}{x+1}$$ however I have no idea how to customize such a function to suit my needs.

I know that multiplying the entire thing will move the asymptote on the $y$ axis, ie $d\times(\frac{x}{x+1})$ will give me a function that approaches $d$ at infinity, but I have no idea how to modify how it fast or slow it approaches that limit. I also know that in this example the $+1$ on the $x+1$ customizes where the half-way point is, but it doesn't seem to let me control it any further than that.

For example, a desired effect I want is for every half-step to take twice as long to reach the limit. Using $f(x)$ that approaches $d=100$ at infinity, I would want these outcomes:

$f(0) = 0$

$f(0.0001) \approx 0.0001$

$f(100) = 50$

$f(200) = 75$

$f(400) = 87.5$

$f(800) = 93.75$

The important conditions of this function is that: $f(0.0001) \approx 0.0001$ (starts off being $x\approx y$) and eventually becomes $f(\infty) \approx 100$

How would I go about creating this function, and most importantly how would I customize it to slow it down or speed it up so it gets closer to $d$ at different rates?

I feel like I'm so close to a solution but not quite there.

Thanks!

  • The function $x\mapsto 1/x+c$ has an asymptote of $y=c$. You can set $c$ to be whatever you like. Does that help? – Joe Sep 17 '21 at 21:10
  • I need $f(0)=0$ and $f(0.00001) \approx 0.00001$. And I'm mainly looking to know how to change its speed as it approaches said asymptote. – Justin Schultz Sep 17 '21 at 21:18
  • If $f(x) = 100-\dfrac{5000}x$ then you have $$ \begin{align} & f(100) = 50 \ {} \ & f(200) = 75 \ {} \ & f(400) = 87.5 \ {} \ & f(800) = 93.75 \end{align} $$ Every time the argument doubles, the difference between the value and $100$ is cut in half. – Michael Hardy Sep 17 '21 at 21:21
  • This problem is with that function is that $f(1) = -4900$. I've adjusted my question to highlight exactly what I want. Thanks! – Justin Schultz Sep 17 '21 at 21:36

1 Answers1

1

enter image description here $$ y= \frac{200}{\pi}\tan^{-1}\frac{x}{100}$$

Narasimham
  • 40,495
  • Thanks for the function! This makes a lot of sense. The $\frac{x}{100}$ seems to define its speed easily.

    My only question is that $f(0.001)=0.0006$ which is a 40% loss at the start, is there a way to have that more gradual?

    Thanks for the help!!

    – Justin Schultz Sep 17 '21 at 22:39
  • 1
    Using $\tanh$ makes it easier to deal with derivatives – Trebor Sep 18 '21 at 00:48
  • @Justin Schultz A more accurate numerical function solution with ode is possible. Interested? – Narasimham Sep 18 '21 at 05:38