# Formula for defining a curve

I am attempting to come up with a formula to describe something like the following:

I need the curve to start from 90% on the left side and it needs to hit 0% at the five year mark on the right. I'd like to be able to control how curved it is versus a straight line between the two points. What would be the best formula for something like this?

For the curious, this is intended to represent a tax proposal based on the length of time a stock is owned before it is sold, such that short term trades are highly penalized. I want to be able to tweak the curve for a couple different scenarios.

Thanks!

• Just an idea, but what if you make the graph a quarter-circle (centered on the top-right)? Jun 11, 2015 at 16:02
• @columbus8myhw And how would he control "how curved" it is?
– user228113
Jun 11, 2015 at 16:06
• A cubic spline might be a better idea. Jun 11, 2015 at 16:07
• This is why we have differential equations.... Jun 11, 2015 at 16:17

Here is a very simple solution:

$$f(x)=-\frac{90}{5^{2n+1}}(x-5)^{2n+1}$$

$n$ is the parameter of the curve. Below are the graphs for $\color{blue}{n=3}$ and $\color {red}{n=20}$:

Try $y=90 \left(1-\sqrt[n]{1-\left(1-\frac{x}{5}\right)^n}\right)$ for varying $n$ (which does not need to be an integer).

The curve is one quarter of a superellipse centered at $(5,90)$. It is tangent to the axes at the given points.

• Any idea how I'd go about entering that into something like WolframAlpha's plotter? Jun 11, 2015 at 17:21

A nearly-correct solution would be to use an exponential decay $N = N_{0}e^{-t/\tau}$. To get this to hit zero at $t=5$, you can apply a correction by subtracting the value at $t=5$, $N_{0}e^{-5/\tau}$. A further correction to $N_{0}$ is then required to bring the start point back towards the required point.

These corrections are not quite perfect (the start point $N_{0}$ never quite returns to exactly where you want it)but lead to a curve that is ok for a show-curve.

For a curve from 90 at 0 to 0 at 5:

$$90(1+e^{-5/\tau})(e^{-x/\tau}-e^{-5/\tau})$$

One possible curve:

$$y=\frac1{a(x+\sqrt{\frac{50}{9a}+\frac{25}4}-\frac52)}-\frac1{a(\sqrt{\frac{50}{9a}+\frac{25}4}+\frac52)},a>0$$

Methodology:

As equation $y=\frac1{ax},a>0$ has similar shape with the required curve, we may adopt it as an approximation measure. In the equation, larger the $a$, greater the "curvature". In order to make the $y=\frac1{ax}$ curve touching x-axis and y-axis, we shift the curve downward and leftward, and so we modify the equation into :

$$y+c=\frac1{a(x+d)}\text{ ,where }c,d>0$$

Sub x-intercept$=5$, y-intercept$=0.9$

$$0.9+c=\frac1{ad}$$ $$c=\frac1{a(d+5)}$$

Solving,

$$c=\frac1{a(\sqrt{\frac{50}{9a}+\frac{25}4}+\frac52)}$$$$d=a(\sqrt{\frac{50}{9a}+\frac{25}4}-\frac52)$$