i have a problem




On Tue, 2 Mar 2010, Janek Kozicki wrote:

< Stavros Macrakis said:     (by the date of Tue, 2 Mar 2010 13:55:08 -0500)
< 
< > Um, this is not a linear system, so linsolve can't solve it.
< > In particular, you'll note that the variables being solved for (l, r, c0,
< > c1) appear on both sides of the result.
< 
< ah, yes! So how to solve this, in a way that the variables being
< solved are on only one side of the result?
< 
< I have a very similar problem with those equations:
< 
< R0:matrix([M*g+m*g-N[1]=m*a+M*a, N[2]-M*g=M*a , N[1]*r-N[2]*r -
< mi_R*(N[1]+N[2])=I*e , e*r=a , I=m[i]*r^2/2 ])$
< 
< transpose(R0);
< 
< R:linsolve(R0[1] , [e,N[1],N[2],I,a]);
< 
< In fact to solve this, after the initial linsolve, I was doing a long
< sequence of subst(..) to eliminate the unknowns from the right sides.
< Finally I got to proper result, but it was tiresome.
 
Doesn't this do what you want?

(%i10) eqs:[M*g+m*g-N[1]=m*a+M*a, N[2]-M*g=M*a , N[1]*r-N[2]*r -
mi_R*(N[1]+N[2])=I*e , e*r=a , I=m[i]*r^2/2 ];

(%o10) [g*M+g*m-N[1] = a*M+a*m,N[2]-g*M = a*M,
        -(N[2]+N[1])*mi_R-N[2]*r+N[1]*r = e*I,e*r = a,I = m[i]*r^2/2]
(%i11) vars:[e,N[1],N[2],I,a];

(%o11) [e,N[1],N[2],I,a]
(%i12) solve(eqs,vars);

(%o12) [[e = ((4*g*M+2*g*m)*mi_R-2*g*m*r)
           /(2*m*r*mi_R-4*r^2*M+(-2*m-m[i])*r^2),
         N[1] = -((4*g*M^2+4*g*m*M)*mi_R+4*g*r*M^2+(4*g*m+g*m[i])*r*M
                                        +g*m[i]*m*r)
              /(2*m*mi_R-4*r*M+(-2*m-m[i])*r),
         N[2] = ((4*g*M^2+4*g*m*M)*mi_R-4*g*r*M^2+(-4*g*m-g*m[i])*r*M)
              /(2*m*mi_R-4*r*M+(-2*m-m[i])*r),I = m[i]*r^2/2,
         a =
((4*g*M+2*g*m)*mi_R-2*g*m*r)/(2*m*mi_R-4*r*M+(-2*m-m[i])*r)]]

Leo


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.