# Solving multiple phase angles for multiple equations

I have several equations and each have their own individual frequencies and amplitudes. I would like to sum the equations together and adjust the individual phases, phase1, phase2, and phase3 to keep the total amplitude value of eq_total under a specific value like $0.8$. I know I can normalize the signal, but for my purposes I need to have this controlled by changing/finding the values for just the phases in phase1, phase2, and phase3 that will do this.

Example:
eq1=0.2*cos(2pi*t*3+phase1)+vertical offset1
eq2=0.7*cos(2pi*t*9+phase2)+vertical offset2
eq3=0.8*cos(2pi*t*5+phase3)+vertical offset3

eq_total=eq1+eq2+eq3


Is there a way to solve for the three phases so that the amplitude of the summed signals in eq_total never goes over $0.8$ by just adjusting/finding the values of the phases? Here's a picture of a geogebra applet I tested this idea with. http://dl.dropbox.com/u/6576402/questions/ggb/amp_phase_pic.png

Here's the geogebra ggb file I used to edit/test idea with. (I used this to see if my idea would work) Java is required if you want to dynamically interact with the applet http://dl.dropbox.com/u/6576402/questions/ggb/sin_find_phases_example.ggb

I'm using matlab/octave Thanks

-