|
From: Mike V. <mic...@gm...> - 2015-05-19 03:26:59
|
Sorry to keep spamming you, but I think I know where you are going and I'm going to give you some icing on the cake. Consider: res: (a + b/(1-x) + c/(1-x)^2) * (1-x)^2 - (1-2*x)^2; (b/(1-x)+c/(1-x)^2+a)*(1-x)^2-(1-2*x)^2 Say we want to automagically make all coefficients vanish? listCoeff: makelist( ratcoeff(res,x, (i-1)), i, 3); [c+b+a-1,-b-2*a+4,a-4] solve( listCoeff, [a,b,c]); [[a=4,b=-4,c=1]] I hope that helps, or at least demonstrates how to use bit of Maxima. On Mon, May 18, 2015 at 8:18 PM, Mike Valenzuela <mic...@gm...> wrote: > There is the also the method: ratcoef(expr, variable, order), which also > expands and simplifies first before attempting to extract its answer, so > the results may not be identical coef's results. > > On Mon, May 18, 2015 at 8:14 PM, Mike Valenzuela <mic...@gm...> > wrote: > >> You might want to look at coef(expr, variable, order) >> >> coef(expr, variable, 0), finds the subexpression free of the variable >> >> On Mon, May 18, 2015 at 8:00 PM, Marduk Bolaños <mar...@ma...> wrote: >> >>> Thank you for the detailed explanation. Now, in order to obtain the >>> corresponding system of equations in an automated way I need to know >>> what is Maxima's equivalent of SymPy's >>> >>> expr.coeff(a) >>> >>> which returns 2*b + m. >>> >> >> > |