On Tue, 2009-12-15 at 22:41 +0100, reyssat wrote:
> Michael Anderl a ?crit :
> > output:
> > [C1=2/3,C2=-4]
> >
> > how to access C1 and C2?
> >
> use list[index] to extract an element from a list, and the function
> rhs
> to get the right hand side (lhs for left) of an equation
another thing you might want to do is save the solutions in a variable:
(%i6) sol: linsolve([C1*3-2,C2*1+4],[C1,C2]);
(%o6) [C1 = 2/3,C2 = -4]
so you can use them later; for example, to replace the value found for
C1 in the expression 8*C1^2, do the following:
(%i7) subst(sol[1], 8*C1^2);
(%o7) 32/9
Regards,
Jaime