3
$\begingroup$

I need a function which satisfies these conditions:

  • $f(0) = 0,$
  • $f(x)$ is monotonically increasing for all $x > 0,$
  • for some specified $x_2 > x_1 > 0$ and $y_2 > y_1 > 0,$ $f(x_1) = y_1,$ and $f(x_2) = y_2.$

I can construct $f(x)$ easily using a piecewise linear function that passes from the origin to the points $(x_1,y_1)$ and $(x_2,y_2)$ in turn, then continues to monotonically increase at some arbitrary rate. However, I am concerned at possible effects of the non-continuous curvature. Is there a better alternative to using spline curves that might give both a smooth curve and a non-piecewise function?

$\endgroup$

1 Answer 1

1
$\begingroup$

Have a look at the function: $f(x)=y_1 \cdot (x/x_1)^p$, where $$p=\frac{\ln(y_2/y_1)}{\ln(x_2/x_1)}.$$ It is monotone increasing for positive $x$, given that $0<x_1<x_2$ and $0<y_1<y_2$ which makes the two log terms in the exponent $p$ both positive. And it passes through the three points $(0,0),\ (x_1,y_1),\ (x_2,y_2)$.

As a power function, it looks to be smooth, at least for positive $x$. It may have a kink at $x=0$ though; maybe a variation of this idea could remove such a kink.

$\endgroup$
3
  • $\begingroup$ Apparently I'm too new here to upvote your answer, but that looks great. I cannot see the potential for a kink at x=0 myself - the two ratios are always greater than 1, so the two log terms are both positive. The ratio p therefore ranges from 0 < p < infinity. I can't see a kink developing in that, unless I venture into the x < 0 range, which does not concern me - it can go completely nuts for all I care :-) $\endgroup$
    – omatai
    Feb 21, 2013 at 20:30
  • $\begingroup$ When $0<p<1$ the derivative of the above $f(x)$ is undefined at $x=0$. In that case geometrically the curve has a vertical tangent at $0$ e.g. compare $y=\sqrt{x}$, and I didn't know whether this is a concern for your application. But at $x>0$ the function is well behaved. $\endgroup$
    – coffeemath
    Feb 21, 2013 at 21:55
  • $\begingroup$ That should be fine for my purposes - thanks! $\endgroup$
    – omatai
    Feb 21, 2013 at 22:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .