kill(all)$

maxima : programming , rerange polynoom ,version 1.0
peter.vlasschaert@gmail.com,18/01/2020

powerdisp;

p1:1+C1*R2*s+s*τ1+s*τ2+s^2*τ1*τ2+s^2+a*s^3;

powerdisp:true;

p2:p1;

highst power : 's' polynoom.
=====================

p2a:hipow(p2,s);

lowest power : 's' polynoom.
=====================

p2b:lopow(p2,s);

p3:m[1]=ev(p2,s=0);

p3a:m[2] = ratcoef(p2,s);

rem : see

p3b:m;

p4:lrerangepoly(s,pn):=block([px],
    l:[ev(pn,s=0)],
for i:2  thru hipow(pn,s)+1 do(
    px:ratcoef(pn,s^(i-1))*s^(i-1),
  l:endcons(px,l)     )
       
)$

representation :code,optimized
========================

grind(p4);

local variable , 'function :lrerangepoly(s,pn)'
------------------------------------------------------------
example : px

see : function (...):=block([px],.......)

px;

lrerangepoly(s,p2);

global :example , 'l'
===============

l;

powerdisp:true;

l1:apply("+",l);

p5:lrerangecoef(s,pn):=block([px],
    ll:[ev(pn,s=0)],
    ma:hipow(pn,s)+1,
for i:2  thru ma do(
    px:ratcoef(pn,s^(i-1)),
  ll:endcons(px,ll)     )
   )$

local variable , 'function :lrerangecoef(s,pn)'
------------------------------------------------------------
example : px

px;

representation : code,optimized
========================

grind(p5);

global :example , 'll'
===============

lrerangecoef(s,p2)$
ll;

powerdisp;

l2:sum(ll[i]*s^(i-1),i,1,ma);

powerdisp:false;

l3:l2;

change polynoom: 'p6' 
=================

p6:p2+s^3;
p6a:kill(ll);
p6b:ll;
p6c:lrerangecoef(s,p6)$
p6d:ll;
p6e:sum(ll[i]*s^(i-1),i,1,ma);
powerdisp:true;
p6f:p6e;