Looking for an S-Curve between 0 and 1 with controllable slope.

5 constraints requires at least 5 coefficients, which would mean a quartic. But I'm guessing that you want rotational symmetry, f(1/2+x)-1/2 = 1/2-f(1/2-x), which requires a polynomial of odd degree, so it would need to be at least quintic.

If you move the centre to 0,0, i.e. f(x)=1/2+g(x-1/2), then g(x) is odd and so consists only of odd-degree terms:

g(x) = ax^(5) + bx^(3) + cx

f(0)=0 => g(-1/2)=-1/2

f(1)=1 => g(1/2)=1/2

f(1/2)=1/2 => g(0)=0 (this is guaranteed for an odd function)

f'(0)=f'(1)=0 => g'(-1/2)=g'(1/2)=0 (g' is even so g'(-1/2)=g'(1/2) is guaranteed).

g'(x) = 5ax^(4) + 3bx^(2) + c

g'(1/2) = 0 => 5a+12b+16c = 0

f'(1/2) = α => g'(0)=α => c=α (I've used α here to avoid the conflict with the coefficient a).

=> 5a+12b+16α = 0 => a = -(16α+12b)/5

(If you think what happens to the curve outside [0,1], you'll probably want a to be negative).

=> g(x) = -((16α+12b)/5)x^(5) + bx^(3) + αx

g'(x)=0 => x^(2) = 1/4 or x^(2) = -α/(4α+3b)

I'm assuming that you want the function to be monotonic increasing, in which case -α/(4α+3b) should be negative (so that g'(x)=0 only has two real roots) => 4α+3b>0 => 3b>-4α => b>-(4/3)α.

Aside from that, try different values of b to get the desired shape.
Within [0, 1/2), 2^a-1 x^a.
Within [1/2, 1], -2^a-1 (x - 1)^a + 1.

0 like 0 dislike