3
$\begingroup$

I would like to create smooth curves, which have $f(0) = 0$ and $f(1) = 1$.

What I would like to create are curves similar to the gamma curves known from CRT monitors. I don't know any better way to describe it, in computer graphics I used them a lot, but in math I don't know what kind of curves they are. They are defined by the two endpoints and a 3rd point.

gamma curves

What I am looking for is a similar curve, what can be described easily in math. For example with a simple exponential function or power function. Can you tell me what kind of curves these ones are (just by lookin at the image below), and how can I create a function which fits a curve using the 2 endpoints and a value in the middle?

So what I am looking for is some equation or algorithm what takes a midpoint value $f(0.5) = x$, returns me $a, b$ and $c$ for example if the curve can be parameterized like this (just ideas):

$a \exp (bt) + c$ or $a b^t + c$

Update: yes, $x^t$ works like this, but it gets really sharp when $t < 0.1$. I would prefer something with a smooth derivative at all points. Thats why I had exponential functions in mind. (I use smooth here as "not steep")

  • 0
    FYI a "smooth function" actually has a technical meaning: http://en.wikipedia.org/wiki/Smooth_function2011-07-07

3 Answers 3

0

It might be worth doing some research into Finite Element shape functions as the basis of these functions is very similar to the problem you are trying to solve here.

My experience with shape functions is that the equations are usually identified through trial and error although there are approaches that can ease you through the process.

2

How about $f(x)=x^t$ for some $t>0$? It satisfies $f(0)=0$ and $f(1)=1$ for any $t$.

All that is left is to pick $t$. For example, if you want that $f(b)=a$, then we get $b^t=a$, or $t = \log(a)/log(b)$.

Edit: In particular, if we denote $f_t(x)=x^t$, we have that $f_{2.2}(0.5)=0.218$ and $f_{1/2.2}(0.218)=0.5$. In other words, it is clear from the numbers and the general shapes of the curves that they are exactly $f(x)=x^t$.

  • 0
    Fair enough. Hard for me to know exactly what you were looking for, I was just trying to create "curves similar to the gamma curves known from CRT monitors" (as given by the picture).2011-07-07
1

EDIT

It turns out that for $0 < x < 1$ with $x \neq 0.5$, the function $f(t)$ as given in the original answer below can be simplified very much. (The key observation is that $\sqrt {1 - 4x(1 - x)} = \sqrt {(2x - 1)^2 } = |2x - 1|$.) Specifically, for any $0 < x < 1$ with $x \neq 0.5$, $ f(t) = \frac{{(\frac{{1 - x}}{x})^{2t} - 1}}{{(\frac{{1 - x}}{x})^2 - 1}}. $ Note that $f(0)=0$, $f(1)=1$, and $ f(0.5) = \frac{{\frac{{1 - x}}{x} - 1}}{{(\frac{{1 - x}}{x})^2 - 1}} = \frac{{\frac{{1 - 2x}}{x}}}{{\frac{{1 - 2x}}{{x^2 }}}} = x. $ Since $f$ is, loosely speaking, an exponential function on a bounded domain, it has a bounded derivative, as the OP wants.

Original answer

If $x=0.5$, then take $f(t)=t$. If $0 < x < 1$ and $x \neq 0.5$, take $ f(t) = \frac{{e^{bt} - 1}}{{e^b - 1}}, $ where $ b = 2 \ln (\xi) $ with $ \xi = \frac{{1 + \sqrt {1 - 4x(1 - x)} }}{{2x}} $ if $x < 0.5$ and $ \xi = \frac{{1 - \sqrt {1 - 4x(1 - x)} }}{{2x}} $ if $x > 0.5$. Then $f(0)=0$, $f(1)=1$, and $f(0.5)=x$ (and $f$ has a bounded derivative, as you want).

  • 0
    Thx! Even better!2011-07-07