I am facing the following problem:
Given is a line of length $L$ which I want to split into $N$ segments. The lengths of the first $(s_1)$ and last segment $(s_N)$ are given. You can assume that the first and the last segment are shorter than the average length $s_{ave} = \frac{L}{N}$ but they are not required to be equal. There should be a smooth transition, no sudden jump. The segment length should therefore increase at the beginning and decrease again towards the end of the line.
I am looking for a simple algorithm that could do this for me. I was trying to use (one or multiple) geometric series: $s_i = \alpha s_{i-1}$. If you specify the growth factor $\alpha$, the length (partial sum) is given by $L = s_1 \frac{\alpha^N -1}{\alpha -1}$ and if you specify the first and last segment length, $\alpha$ must satisfy $\alpha = (\frac{s_N}{s_1})^{\frac{1}{N}}$. Thus the system is overspecified if you fix $N, L, s_1, s_N$. Even if you split the problem, say into an increasing section, one where the length is constant and another one wehere the length decreases. Eventually you have to specify everything in one section.