Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Shortening Polynomials

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg415] Re: [mg413] Shortening Polynomials
  • From: Count Dracula <lk3a at kelvin.seas.virginia.edu>
  • Date: Sat, 21 Jan 1995 12:50:25 -0500

 "Corcoran" == Stephen Corcoran <corcoran> writes:

    Corcoran> Dear Mathgroupers,

    Corcoran> Is there a neater way to collect powers up to order m after
    Corcoran> expanding a polynomial?

Define a function f by:

f[poly_, q_, m_] := Take[CoefficientList[poly, q], m+1] . (q^Range[0, m])

Then, for example,

In[10]:= poly = q^5 + q^7 + 8 q^2 + 9999 q^10;m = 5;

In[11]:= f[poly, q, m]

             2    5
Out[11]= 8 q  + q
_____________________________________________________________________________
 Levent Kitis           lk3a at cars.mech.virginia.edu    lk3a at kelvin.seas.virginia.edu
 University of Virginia  Department of Mechanical, Aerospace and Nuclear Engineering  
 ____________________________________________________________________________



  • Prev by Date: Orientation of tick labels
  • Next by Date: Re: Shortening Polynomials
  • Previous by thread: Shortening Polynomials
  • Next by thread: Re: Shortening Polynomials