Maintain constant total amplitude of sum of sines Given a set of N sine waves, each with their own amplitude and frequency, is there a straightforward way to select their phases such that the sum over all sines maintains a constant amplitude, given that the frequencies are spaced equally apart by df? 

If all phases are 0, then at t=0 all the sines will constructively interfere to make a huge spike, then they will destructively interfere until they become commensurate again at t~1/df. My goal is to select a set of phases for the different sine waves which will leave the resultant sum with roughly constant peak-to-peak amplitude from t=0 to t=1/df. Picking all random phases does do a pretty good job, but ideally I'd like to find a way to find an optimal set of phases, or at the very least come up with a metric to quantify "how good" a given set of phase is at accomplishing my goal, which I can then optimize on. 

edit: To clarify I'm not looking to have the sum of sines equal a constant value, but rather have the resulting periodic function have a roughly constant peak-to-peak amplitude. For instance, for a given set of frequencies all with equal amplitudes, if all phases are set to 0 then the resulting sum will look like:


If the phases are set uniformly randomly in the range [0 2pi] then the result is:
.

Clearly, in the random-phase case the peak-to-peak amplitude of the resulting oscillatory function is roughly constant over the given time series, while in the 0 phase case it spikes often at times where commensurate sines add constructively. I'm looking for a way to find an optimal set of phases which keeps the peak-to-peak amplitude roughly constant, without just generating a million different random combinations and picking the best one.

Any help would be greatly appreciated.
Hopefully this will be some help.

As you have stated it, this is a difficult problem to formulate and thus get an analytical solution.  First, are you talking continuous or discrete?  Makes a big difference.

Anyway, you want to formulate it as an optimization problem.  Something like "minimizing the RMS" can be expressed as an evaluation function.  "All the peaks having the same amplitude" means have to measure the value of the function with the condition applied to the derivative (=0).  So, your evaluation function (a function of your free variables) could be something like:

$$ F(\phi_0,\phi_1,\phi_2,...,\phi_{N-1}) = \sum_{p=1}^{P} \left( f(t_p) - \bar f \right)^2 $$

Where $f(t)$ is your function, evaluated when $f'(t)=0$, and $\bar f$ is the average height of all those peaks.

This evaluation function is going to be periodic in all dimensions.  There are going to be lots of local minima.  Your only recourse (as I can see it) is to do a coarse sweep of your whole domain, then a local optimization search on the best candidates.