Skip to content

newby trying to solve a system

2 messages · Olivier ETERRADOSSI, Spencer Graves

#
Dear R-gurus,
being very new to R, (as well as lazy and not too smart !) I have some 
problems (and get lost in the docs)  trying to write something to find 
the 9 values (A1,B1,C1,A2,B2,C2....C3) which are solutions of a 12 
equations system of the form :
 > x1-(A1/(A1+B1+C1)) = 0
 > y1-(B1/(A1+B1+C1))= 0
 > z1-(C1/(A1+B1+C1)) = 0
 > 3 same equations with subscript 2
 > 3 same equations with subscript 3
 > A1*K+A2*L+A3*M = S
 > B1*K+B2*L+B3*M = T
 >C1*K+C2*L+C3*M = U

where x1,y1,.....y3,z3, K,L,M,S,T and U are known.

 Can any of you give me some light to begin ? I guess something already 
exists but can't find it...
Thanks a lot for any hint.
Olivier
#
Have you considered multiplying the first set of equations by the 
denominator to convert them to something like the following: 

      x1*(A1+B1+C1)-A1=0. 

      This will give you 12 equations in 9 unknowns.  For this, "lm" 
will give you the least squares solution.  If the system has a single 
unique solution, "lm" will find it and report a residual standard 
deviation equivalent to round-off error.  To do this, it helps to make a 
"data.frame", described, e.g., in "An Introduction to R" available via 
help.start(). 

      spencer graves
Olivier ETERRADOSSI wrote: