Re: Extracting polynomial coefficients?
- To: mathgroup@smc.vnet.net
- Subject: [mg11537] Re: [mg11464] Extracting polynomial coefficients?
- From: "Fred Simons" <wsgbfs@win.tue.nl>
- Date: Sat, 14 Mar 1998 13:55:54 -0500
> Subject: [mg11537] [mg11464] Extracting polynomial coefficients? > I have a very long polynomial that's a function of four variables, a, b, > c, d. I would like Mathematica to (1) tell me what combinations of a, > b, c, and d are in my polynomial, and (2) tell me what the coefficients > are for each of the variable terms. > Maybe the following is of some help: Let us call your very long polynomial pol. If necessary, write pol as a polynomial in a, b, c, d: pol = Collect[ pol, a^_. b^_. c^_. d^_. ] To find out which terms appear and with what coefficient, you can use Cases: Cases[ pol, coef_. a^na_. b^nb_.c^nc_. d^nd_. :> {a^na b^nb c^nc d^nd, coef} ] Regards, Fred Simons Eindhoven University of Technology