# Help with simultaneous equation with additional term

I hoped someone can help me with 3 simultaneous equations with an additional condition. I can easily solve the following 3 equations using substitution in terms of $S_1$, $S_2$ and $S_3$" \begin{align*} \text{Eq 1)} &\qquad& (O_{1}-1)S_1 - S_2 - S_3 &= 0.5P\\ \text{Eq 2)} && (O_{2}-1)S_2-S_1-S_3 &= 0.29P\\ \text{Eq 3)} && (O_{3}-1)S_3-S_1-S_2 &=0.21 P \end{align*}

However, I'm struggling to solve these same equations with an additional condition $$\text{Eq4)}\qquad S_1+S_2+S_3 = T.$$

Essentially, I want to be able to specify $T$ and calculate the values required for $S_1$, $S_2$ and $S_3$ to make Eq1 50% , Eq2 29% and Eq3 21% of the total.

$O_1$, $O_2$, & $O_3$ are known; $P$ = Eq1+Eq2+Eq3

Any advice is appreciated, thanks. (this is not homework!)

-
@Arturo: $O_i$ are part of the coefficients I believe... –  Aryabhata Jun 30 '11 at 21:44
Adding the three equations, we see $P = -T$. –  GEdgar Jun 30 '11 at 21:47
@Aryabhata: Oh, I see! Sorry about that. That was pretty bad mangling I did there. Fixed. –  Arturo Magidin Jun 30 '11 at 21:50
Can't you just solve for $S_i$ in terms of $P$ (they will all be multiples of $P$ from equations 1-3, using matrix multiplication/inverse to give the solution). Then you can choose P so that Equation 4 is satisfied (except in exceptional singular cases). Alternatively take the P over to the other side in 1-3. P has zero coefficient in eq4, and you have a four-dimensional problem with unknowns $S_i$ and $P$ –  Mark Bennet Jun 30 '11 at 22:00
Thanks both Mark & Shai! I've been put back on the right track and used both of your suggestions. Thank you. –  user3357963 Jun 30 '11 at 23:34

It may be worth noting that $$O_1 S_1 - T = 0.5P$$ $$O_2 S_2 - T = 0.29P$$ $$O_3 S_3 - T = 0.21P.$$