1. y(x=0) = 0
2. y(x=N) = 0
3. y(x=N/2) = ymax (ymin, it doesn't really matter, it's just a variable name)
Quadratic equations take the form of y = ax^2 + bx + c, where a, b, and c are constants to be determined. There are three equations, and three unknowns, so this is (should be "technically", cuz not always) solvable. To do so, just plug them in one by one:
1. 0 = a*0 + b*0 + c => c = 0
2. 0 = a*N^2 + b*N => a*N^2 = -b*N => a*N = -b
3. ymax = (a*N^2)/4 + b*N/2 = -b*N/4 + b*N/2 = b*N/4, so ymax = b*N/4 => b = 4*ymax/N
Plugging in with the above (last part of #2), a = -4*ymax/N^2
Thus, the final solution is y = -4*ymax*(x/N)^2 + 4*ymax*x/N
Note that once you knew that c = 0 via condition 1, you could reduce this down to the more intuitive y = ax*(x+b) form. In this case, you get:
2. 0 = aN*(N+b) => a = 0 and/or b = -N
3. ymax = aN/2 * (N/2 + b) => a is NOT 0 (unless ymax = 0, in which case the whole equation is y = 0), so you know that b = -N
Plugging this in, ymax = aN/2 * (N/2-N) = aN/2*(-N/2) => ymax = -a*(N/2)^2 => a = -4*ymax/(N^2)
Thus it's y = -4*ymax*x/(N^2) * (x-N)
You can expand this out to see that both are equivalent.
Chuck Hsiao
Amptron