% New DFOD
function sysdfod=newdfod(n,T,a,r)
% n order of truncation (1 2 3 ...)
% T sampling period in sec.
% a weighting factor between Simpson and Tustin ( 0 <= a <= 1 )
r2=(3+a-2*sqrt(3*a))/(3-a);b=r2;k0=(6*r2/T/(3-a))^r;
if (n==1)
    b1=-(2*b^2*r-b^2+1)/(2*b^2*r+b^2-1);
    b0=2*b/(2*b^2*r+b^2-1);
    %
    a1=1;
    a0=2*b/(2*b^2*r+b^2-1);
    sys1=tf(k0*[b0 b1],[a0 a1],T,'Variable', 'z^-1');
    sysdfod=sys1;
elseif (n==2)
    den2=(8*b^6*r^4+12*b^6*r^3+2*b^6*r^2-3*b^6*r-12*b^4*r^3-b^6-36*b^4*r^2+3*b^4*r+9*b^4+18*b^2*r^2-9*b^2*r+9*b^2+9*r-9);
    b2=(18*b^2*r^2-36*b^4*r^2+8*b^6*r^4+3*b^6*r+2*b^6*r^2-12*b^6*r^3-9+12*b^4*r^3-3*b^4*r+9*b^2*r-9*r+9*b^4+9*b^2-b^6)/den2;
    b1=(-24*r^2*b^3-24*r^3*b^5-12*b^3+18*b+36*r*b^3-18*r*b+6*r*b^5+24*r^2*b^5-6*b^5)/den2;
    b0=(18+24*b^4*r^2-6*b^4-36*b^2)/den2;
 %
    a2=1;
    a1=(-24*r^2*b^3+24*r^3*b^5-12*b^3+18*b-36*r*b^3+18*r*b-6*r*b^5+24*r^2*b^5-6*b^5)/den2;
    a0=(18+24*b^4*r^2-6*b^4-36*b^2)/den2;
    sys2=tf(k0*[b0 b1 b2],[a0 a1 a2],T,'Variable', 'z^-1');
    sysdfod=sys2;
elseif (n==3)
den3=(64*b^12*r^7+192*b^12*r^6+144*b^12*r^5-48*b^12*r^4-192*b^10*r^6-84*b^12*r^3 ... 
    -1440*b^10*r^5-12*b^12*r^2-1632*b^10*r^4+11*b^12*r+720*b^10*r^3+720*b^8*r^5+3*b^12+852*b^10*r^2+2160*b^8*r^4 ...
    -90*b^10*r+2520*b^8*r^3-108*b^10+3240*b^8*r^2-480*b^6*r^4-675*b^8*r-720*b^6*r^3-945*b^8-9480*b^6*r^2+180*b^6*r ...
    -900*b^4*r^3+2400*b^6+8100*b^4*r^2-2475*b^4*r-3375*b^4-2700*b^2*r^2+1350*b^2*r+2700*b^2+675*r-675);
b3=-(675*r-2700*b^2+3375*b^4-2400*b^6+945*b^8+108*b^10+1350*b^2*r+2700*b^2*r^2-900*b^4*r^3 ...
    -8100*b^4*r^2-2475*b^4*r-720*b^6*r^3+9480*b^6*r^2+180*b^6*r+480*b^6*r^4-2160*b^8*r^4+2520*b^8*r^3 ...
    -3240*b^8*r^2-675*b^8*r+720*b^8*r^5+675-90*b^10*r-852*b^10*r^2+720*b^10*r^3+1632*b^10*r^4- ...
    1440*b^10*r^5+192*b^10*r^6+11*b^12*r+12*b^12*r^2-84*b^12*r^3+48*b^12*r^4+144*b^12*r^5-192*b^12*r^6 ... 
	+64*b^12*r^7-3*b^12)/den3;
b2=-(-5400*b+6300*b^3-1440*b^5+3240*b^7-2700*r*b-360*b^9+2700*r*b^3+1800*r^2*b^3-1440*r^3*b^5+5760*b^5*r^2+360*r*b^5 ...
    -1800*r*b^7-12240*b^7*r^2+7200*r^3*b^7-2880*r^4*b^7+1380*r*b^9-5280*r^3*b^9+5760*b^9*r^4-960*r^5*b^9+60*b^11*r ...
    -480*b^11*r^3+960*b^11*r^5-384*b^11*r^6+264*b^11*r^2-384*b^11*r^4-36*b^11)/den3;
b1= -(-6300*b^4-8640*b^8*r^3+10800*b^4*r-8100*b^2*r+3420*b^6+3600*b^4*r^2+4320*b^6*r^3-90*b^10-1080*b^6*r+2160*b^8*r ...
    +1440*b^8*r^4-1440*b^10*r^4+960*b^10*r^5-13680*b^6*r^2+6750*b^2-480*b^10*r^3-2430*b^8+9360*b^8*r^2+60*b^10*r ...
    -1350+720*b^10*r^2)/den3;
b0= -(-10800*b^3+1080*b^5+8100*b-2160*b^7-960*b^9*r^4+480*b^9*r^2-60*b^9+8640*b^7*r^2-4320*b^5*r^2)/den3;
% denominator 
a3=1;
a2=(5400*b-6300*b^3+1440*b^5-3240*b^7-2700*r*b+360*b^9+2700*r*b^3-1800*r^2*b^3-1440*r^3*b^5-5760*b^5*r^2+360*r*b^5 ...
    -1800*r*b^7+12240*b^7*r^2+7200*r^3*b^7+2880*r^4*b^7+1380*r*b^9-5280*r^3*b^9-5760*b^9*r^4-960*r^5*b^9+60*b^11*r ...
    -480*b^11*r^3+960*b^11*r^5+384*b^11*r^6-264*b^11*r^2+384*b^11*r^4+36*b^11)/den3;
a1=(6300*b^4-8640*b^8*r^3+10800*b^4*r-8100*b^2*r-3420*b^6-3600*b^4*r^2+4320*b^6*r^3+90*b^10-1080*b^6*r+2160*b^8*r ...
    -1440*b^8*r^4+1440*b^10*r^4+960*b^10*r^5+13680*b^6*r^2-6750*b^2-480*b^10*r^3+2430*b^8-9360*b^8*r^2+60*b^10*r ...
    +1350-720*b^10*r^2)/den3;
a0=+(10800*b^3-1080*b^5-8100*b+2160*b^7+960*b^9*r^4-480*b^9*r^2+60*b^9-8640*b^7*r^2+4320*b^5*r^2)/den3;

sys3=tf(k0*[b0 b1 b2 b3],[a0 a1 a2 a3],T,'Variable', 'z^-1');
sysdfod=sys3;
elseif (n==4)
    den4= (1024*b^20*r^12+5120*b^20*r^11+5888*b^20*r^10-8960*b^20*r^9-5120*b^18*r^11-23424*b^20*r^8-69120*b^18*r^10 ...
    -9600*b^20*r^7-179200*b^18*r^9+11744*b^20*r^6+53760*b^18*r^8+34560*b^16*r^10+9760*b^20*r^5+574080*b^18*r^7 ...
    +264960*b^16*r^9-1004*b^20*r^4+331200*b^18*r^6+933120*b^16*r^8-2620*b^20*r^3-362560*b^18*r^5+933120*b^16*r^7 ...
    -76800*b^14*r^9-357*b^20*r^2-257760*b^18*r^4-1605600*b^16*r^6-729600*b^14*r^8+225*b^20*r+84940*b^18*r^3 ...
    -4255200*b^16*r^5-2707200*b^14*r^7+54*b^20+64770*b^18*r^2-2031120*b^16*r^4-5558400*b^14*r^6+67200*b^12*r^8 ...
    -6840*b^18*r+1936080*b^16*r^3+5112000*b^14*r^5+1411200*b^12*r^7-5400*b^18+1257615*b^16*r^2+15703200*b^14*r^4 ...
    +8416800*b^12*r^6-233685*b^16*r-2043600*b^14*r^3-4989600*b^12*r^5-201600*b^10*r^7-166050*b^16-6763800*b^14*r^2 ...
    -7547400*b^12*r^4-4334400*b^10*r^6+234000*b^14*r+24910200*b^12*r^3+12801600*b^10*r^5+799200*b^14+13531350*b^12*r^2 ...
    -2973600*b^10*r^4+1260000*b^8*r^6-5937750*b^12*r-50967000*b^10*r^3-11844000*b^8*r^5-3042900*b^12-61582500*b^10*r^2 ...
    -1386000*b^8*r^4+11944800*b^10*r+22554000*b^8*r^3+3528000*b^6*r^5+15649200*b^10+114045750*b^8*r^2+5292000*b^6*r^4 ...
    -4898250*b^8*r+16758000*b^6*r^3-28444500*b^8-107163000*b^6*r^2-3307500*b^4*r^4-4410000*b^6*r-16537500*b^4*r^3 ...
    +26460000*b^6+50439375*b^4*r^2-826875*b^4*r+3307500*b^2*r^3-4961250*b^4-8268750*b^2*r^2+6615000*b^2*r-6615000*b^2 ...
    +826875*r^2-2480625*r+1653750)
b4=(-3528000*b^6*r^5-22554000*b^8*r^3-1386000*b^8*r^4+11844000*b^8*r^5+1260000*b^8*r^6+201600*b^10*r^7+50967000*b^10*r^3 ...
    -61582500*b^10*r^2-11944800*b^10*r-2973600*b^10*r^4-12801600*b^10*r^5-4334400*b^10*r^6-69120*b^18*r^10+5120*b^18*r^11 ...
    -574080*b^18*r^7-84940*b^18*r^3+64770*b^18*r^2+6840*b^18*r-257760*b^18*r^4+362560*b^18*r^5+331200*b^18*r^6+53760*b^18*r^8 ...
    +179200*b^18*r^9-3042900*b^12-1411200*b^12*r^7-24910200*b^12*r^3+13531350*b^12*r^2+5937750*b^12*r-7547400*b^12*r^4 ...
    +4989600*b^12*r^5+8416800*b^12*r^6+67200*b^12*r^8+799200*b^14+2043600*b^14*r^3-6763800*b^14*r^2-234000*b^14*r ...
    +15703200*b^14*r^4-5558400*b^14*r^6-5112000*b^14*r^5+2707200*b^14*r^7-729600*b^14*r^8+76800*b^14*r^9-166050*b^16 ...
    -1936080*b^16*r^3+1257615*b^16*r^2+233685*b^16*r-2031120*b^16*r^4-933120*b^16*r^7+34560*b^16*r^10-264960*b^16*r^9 ...
    +933120*b^16*r^8-1605600*b^16*r^6+4255200*b^16*r^5-5400*b^18+2620*b^20*r^3-357*b^20*r^2-225*b^20*r-1004*b^20*r^4 ...
    +9600*b^20*r^7+5888*b^20*r^10+8960*b^20*r^9-23424*b^20*r^8-5120*b^20*r^11+11744*b^20*r^6-9760*b^20*r^5+1024*b^20*r^12 ...
    +54*b^20) + (1653750-6615000*b^2-28444500*b^8+15649200*b^10-4961250*b^4+26460000*b^6+826875*r^2-8268750*b^2*r^2 ...
    +5292000*b^6*r^4-107163000*b^6*r^2+114045750*b^8*r^2+50439375*b^4*r^2-3307500*b^4*r^4-3307500*b^2*r^3+16537500*b^4*r^3 ...
    +2480625*r-6615000*b^2*r+826875*b^4*r-16758000*b^6*r^3+4410000*b^6*r+4898250*b^8*r); b4=b4/den4;
b3=(-5760*b^19*r^6-604800*b^13-902880*b^15+1080*b^19+32400*b^17+180480*b^19*r^7-107520*b^19*r^8-46080*b^17*r^10-10240*b^19*r^11 ...
    +46080*b^19*r^10-35840*b^19*r^9-5544000*b^9*r^4+38001600*b^11*r^4+37440*b^19*r^4+552960*b^17*r^9-276480*b^15*r^9 ...
    -120320*b^19*r^5-14918400*b^13*r^6-17294400*b^15*r^4-80820*b^17*r^2+4838400*b^13*r^7+13161600*b^15*r^5+1126080*b^17*r^3 ...
        -403200*b^11*r^7+4988160*b^15*r^6-987840*b^17*r^4-6197760*b^15*r^7-2131200*b^17*r^5-2340*b^19*r+1889280*b^15*r^8 ...
        +3484800*b^17*r^6-537600*b^13*r^8-11820*b^19*r^2-506880*b^17*r^7+28760*b^19*r^3-1244160*b^17*r^8+17740800*b^13*r^5 ...
        -5401440*b^15*r^3-142560*b^17*r-1008000*b^9*r^6+7593840*b^15*r^2-2116800*b^13*r^4+7459200*b^11*r^6+88200000*b^9*r^3 ...
        +15157800*b^11*r+81660600*b^11*r^2+14112000*b^9*r^5-53247600*b^11*r^3+1260000*b^13*r-5040000*b^7*r^5+3889200*b^13*r^2 ...
        -29433600*b^11*r^5-9777600*b^13*r^3+625680*b^15*r) + (-59724000*b^7-22906800*b^11-13230000*b+3307500*b*r^2 ...
        +13482000*b^7*r-255591000*b^9*r^2-82026000*b^5*r^2-3307500*b^3*r^2+6615000*b^3*r^3+33075000*b^3-36382500*b^3*r ...
        +37044000*b^5*r+10584000*b^5*r^3+64260000*b^9-22932000*b^9*r+244566000*b^7*r^2-52668000*b^7*r^3-22680000*b^7*r^4 ...
        +10584000*b^5*r^4);b3=b3/den4;
b2=(-1512000*b^8*r^5-187034400*b^10*r^3+113400000*b^10*r^4-3931200*b^10*r^5+604800*b^10*r^6+46080*b^18*r^10+483840*b^18*r^7 ...
    +70560*b^18*r^3-58860*b^18*r^2-5670*b^18*r+239040*b^18*r^4-302400*b^18*r^5-328320*b^18*r^6-161280*b^18*r^9 ...
    +1612800*b^12*r^7+81446400*b^12*r^3-8038800*b^12*r^2-21508200*b^12*r-69955200*b^12*r^4+17942400*b^12*r^5 ...
    -12499200*b^12*r^6-1069200*b^14+1764000*b^14*r^3+9604800*b^14*r^2-264600*b^14*r-25459200*b^14*r^4+16358400*b^14*r^6 ...
    -1411200*b^14*r^5-5644800*b^14*r^7+921600*b^14*r^8+380700*b^16+4717440*b^16*r^3-2955600*b^16*r^2-561330*b^16*r ...
    +5256000*b^16*r^4+3548160*b^16*r^7+161280*b^16*r^9-1843200*b^16*r^8+2361600*b^16*r^6-10785600*b^16*r^5+4860*b^18) ...
    +(136080000*b^8*r^3-4961250*r-33925500*b^8*r-353430000*b^8*r^2+24806250*b^2*r+211566600*b^10*r^2+9261000*b^6*r ...
    -39690000*b^4+9922500*b^2*r^2+21168000*b^6*r^4+280476000*b^6*r^2-37044000*b^6*r^3+92421000*b^8-119070000*b^4*r^2 ...
    +69457500*b^2-71442000*b^6-65016000*b^8*r^4-9922500+47004300*b^10*r-19845000*b^4*r-59988600*b^10+6577200*b^12);b2=b2/den4; 
b1=(786240*b^15+7560*b^17-27820800*b^11*r^4-107520*b^17*r^9+8064000*b^13*r^6+15120000*b^15*r^4-94080*b^17*r^2-1612800*b^13*r^7 ...
    -8870400*b^15*r^5+47040*b^17*r^3-4999680*b^15*r^6+403200*b^17*r^4+3225600*b^15*r^7-201600*b^17*r^5-215040*b^15*r^8 ...
    -645120*b^17*r^6+322560*b^17*r^7+215040*b^17*r^8-12499200*b^13*r^5+3830400*b^15*r^3-3780*b^17*r-6609120*b^15*r^2 ...
    +3225600*b^13*r^4-2419200*b^11*r^6-3124800*b^13*r^2+7257600*b^11*r^5+6552000*b^13*r^3-453600*b^15*r)+(19845000*b ...
    +77112000*b^7-52920000*b^3+5292000*b^5+453600*b^13+35985600*b^11-26460000*b^3*r^2-86562000*b^9+344736000*b^9*r^2 ...
    -37044000*b^7*r+137592000*b^5*r^2+79380000*b^3*r-52920000*b^5*r^3-66150000*b^5*r+3024000*b^7*r^4-309204000*b^7*r^2 ...
    +148176000*b^7*r^3-9922500*b*r+49329000*b^9*r+6048000*b^9*r^4-198072000*b^9*r^3-29786400*b^11*r-136836000*b^11*r^2+ ...
    3024000*b^9*r^5+117331200*b^11*r^3-831600*b^13*r);b1=b1/den4;
b0=3780*b^16-47040*b^16*r^2+201600*b^16*r^4+107520*b^16*r^8-322560*b^16*r^6+8870400*b^14*r^4-3225600*b^14*r^6 ...
    +1612800*b^12*r^6-3830400*b^14*r^2+12499200*b^12*r^4 -148176000*b^6*r^2+198072000*b^8*r^2-3024000*b^8*r^4 ...
    -79380000*b^2+831600*b^12-6552000*b^12*r^2+453600*b^14-117331200*b^10*r^2-7257600*b^10*r^4+29786400*b^10+9922500 ...
    +52920000*b^4*r^2+66150000*b^4+37044000*b^6-49329000*b^8; b0=b0/den4;
%
%a4= (-1386000*b^8*r^4-11844000*b^8*r^5+1260000*b^8*r^6-2973600*b^10*r^4-50967000*b^10*r^3-61582500*b^10*r^2+12801600*b^10*r^5 ...
%    -4334400*b^10*r^6-201600*b^10*r^7-69120*b^18*r^10-5120*b^18*r^11-257760*b^18*r^4+84940*b^18*r^3+64770*b^18*r^2-6840*b^18*r ...
%    -362560*b^18*r^5+331200*b^18*r^6+574080*b^18*r^7+53760*b^18*r^8-179200*b^18*r^9-5400*b^18-3042900*b^12-7547400*b^12*r^4 ...
%    +24910200*b^12*r^3+13531350*b^12*r^2-5937750*b^12*r-4989600*b^12*r^5+8416800*b^12*r^6+1411200*b^12*r^7+67200*b^12*r^8 ...
%    -2043600*b^14*r^3-6763800*b^14*r^2+234000*b^14*r+15703200*b^14*r^4+799200*b^14-2707200*b^14*r^7-5558400*b^14*r^6 ...
%    +5112000*b^14*r^5-729600*b^14*r^8-76800*b^14*r^9-166050*b^16+1936080*b^16*r^3+1257615*b^16*r^2-233685*b^16*r ...
%    -2031120*b^16*r^4+933120*b^16*r^7-1605600*b^16*r^6-4255200*b^16*r^5+933120*b^16*r^8+264960*b^16*r^9+34560*b^16*r^10 ...
%    -2620*b^20*r^3-357*b^20*r^2+225*b^20*r-1004*b^20*r^4-9600*b^20*r^7+11744*b^20*r^6+9760*b^20*r^5-23424*b^20*r^8 ...
%    -8960*b^20*r^9+5888*b^20*r^10+5120*b^20*r^11+1024*b^20*r^12+54*b^20)+(15649200*b^10-4961250*b^4+1653750-6615000*b^2 ...
%    +26460000*b^6-28444500*b^8+22554000*b^8*r^3-4410000*b^6*r-4898250*b^8*r-16537500*b^4*r^3-2480625*r+6615000*b^2*r ...
%    -826875*b^4*r-8268750*b^2*r^2+5292000*b^6*r^4-107163000*b^6*r^2+114045750*b^8*r^2+50439375*b^4*r^2+826875*r^2 ...
%    +16758000*b^6*r^3+3528000*b^6*r^5+3307500*b^2*r^3-3307500*b^4*r^4+11944800*b^10*r); a4=a4/den4;
a4=1;
a3=(-902880*b^15+32400*b^17+1080*b^19-604800*b^13-5760*b^19*r^6-107520*b^19*r^8-46080*b^17*r^10+35840*b^19*r^9 ...
    +46080*b^19*r^10+10240*b^19*r^11+7593840*b^15*r^2-4838400*b^13*r^7-180480*b^19*r^7+276480*b^15*r^9+120320*b^19*r^5 ...
    +2340*b^19*r+1889280*b^15*r^8+3484800*b^17*r^6-537600*b^13*r^8-11820*b^19*r^2+506880*b^17*r^7-28760*b^19*r^3 ...
    -1244160*b^17*r^8+37440*b^19*r^4-552960*b^17*r^9-14918400*b^13*r^6-17294400*b^15*r^4-80820*b^17*r^2-13161600*b^15*r^5 ...
    -1126080*b^17*r^3+403200*b^11*r^7+4988160*b^15*r^6-987840*b^17*r^4+6197760*b^15*r^7+2131200*b^17*r^5-17740800*b^13*r^5 ...
    +5401440*b^15*r^3+142560*b^17*r-1008000*b^9*r^6+7459200*b^11*r^6-2116800*b^13*r^4-625680*b^15*r+29433600*b^11*r^5 ...
    +9777600*b^13*r^3+53247600*b^11*r^3-1260000*b^13*r+38001600*b^11*r^4+3889200*b^13*r^2-14112000*b^9*r^5)+(-13230000*b ...
    +22932000*b^9*r+81660600*b^11*r^2-88200000*b^9*r^3-13482000*b^7*r-3307500*b^3*r^2-10584000*b^5*r^3+52668000*b^7*r^3 ...
    +5040000*b^7*r^5-6615000*b^3*r^3+10584000*b^5*r^4-15157800*b^11*r+3307500*b*r^2+64260000*b^9+33075000*b^3-22906800*b^11 ...
    +36382500*b^3*r-37044000*b^5*r-5544000*b^9*r^4-255591000*b^9*r^2-22680000*b^7*r^4+244566000*b^7*r^2-82026000*b^5*r^2 ...
    -59724000*b^7);a3=a3/den4;
a2=(3931200*b^10*r^5+604800*b^10*r^6+46080*b^18*r^10+239040*b^18*r^4-70560*b^18*r^3-58860*b^18*r^2+5670*b^18*r ...
    +302400*b^18*r^5-328320*b^18*r^6-483840*b^18*r^7+161280*b^18*r^9+4860*b^18-69955200*b^12*r^4-81446400*b^12*r^3 ...
    -17942400*b^12*r^5-12499200*b^12*r^6-1612800*b^12*r^7-1764000*b^14*r^3+9604800*b^14*r^2+264600*b^14*r-25459200*b^14*r^4 ...
    +5644800*b^14*r^7+16358400*b^14*r^6+1411200*b^14*r^5+921600*b^14*r^8+380700*b^16-4717440*b^16*r^3-2955600*b^16*r^2 ...
    +561330*b^16*r+5256000*b^16*r^4-3548160*b^16*r^7+2361600*b^16*r^6+10785600*b^16*r^5-1843200*b^16*r^8-161280*b^16*r^9) ...
    +(4961250*r+69457500*b^2-39690000*b^4-71442000*b^6+92421000*b^8-59988600*b^10-24806250*b^2*r+9922500*b^2*r^2 ...
    -119070000*b^4*r^2+19845000*b^4*r+37044000*b^6*r^3+280476000*b^6*r^2-9261000*b^6*r+21168000*b^6*r^4-65016000*b^8*r^4 ...
    -136080000*b^8*r^3-353430000*b^8*r^2+33925500*b^8*r+1512000*b^8*r^5+113400000*b^10*r^4+187034400*b^10*r^3 ...
    +211566600*b^10*r^2-47004300*b^10*r+6577200*b^12-8038800*b^12*r^2+21508200*b^12*r-1069200*b^14-9922500);a2=a2/den4;
a1=(7560*b^17-6609120*b^15*r^2+1612800*b^13*r^7-215040*b^15*r^8-645120*b^17*r^6-322560*b^17*r^7+215040*b^17*r^8 ...
    +107520*b^17*r^9+8064000*b^13*r^6+15120000*b^15*r^4-94080*b^17*r^2+8870400*b^15*r^5-47040*b^17*r^3-4999680*b^15*r^6 ...
    +403200*b^17*r^4-3225600*b^15*r^7+201600*b^17*r^5+12499200*b^13*r^5-3830400*b^15*r^3+3780*b^17*r-2419200*b^11*r^6 ...
    +3225600*b^13*r^4+453600*b^15*r-7257600*b^11*r^5-6552000*b^13*r^3)+(19845000*b+786240*b^15+35985600*b^11+453600*b^13 ...
    +77112000*b^7-86562000*b^9-52920000*b^3+5292000*b^5-117331200*b^11*r^3+831600*b^13*r-27820800*b^11*r^4-3124800*b^13*r^2 ...
    -3024000*b^9*r^5+6048000*b^9*r^4-136836000*b^11*r^2+9922500*b*r-79380000*b^3*r-26460000*b^3*r^2+66150000*b^5*r ...
    +137592000*b^5*r^2+52920000*b^5*r^3+37044000*b^7*r-309204000*b^7*r^2-148176000*b^7*r^3-49329000*b^9*r ...
    +3024000*b^7*r^4+344736000*b^9*r^2+198072000*b^9*r^3+29786400*b^11*r);a1=a1/den4;
a0=-322560*b^16*r^6+107520*b^16*r^8-47040*b^16*r^2+201600*b^16*r^4+1612800*b^12*r^6-3225600*b^14*r^6+8870400*b^14*r^4 ...
    -3830400*b^14*r^2-79380000*b^2+66150000*b^4+37044000*b^6-49329000*b^8+29786400*b^10+198072000*b^8*r^2-7257600*b^10*r^4 ...
    -117331200*b^10*r^2+3780*b^16+9922500+831600*b^12+12499200*b^12*r^4-6552000*b^12*r^2-3024000*b^8*r^4+52920000*b^4*r^2 ...
    -148176000*b^6*r^2+453600*b^14;a0=a0/den4;
sys4=tf(k0*[b0 b1 b2 b3 b4],[a0 a1 a2 a3 a4],T,'Variable', 'z^-1');
sysdfod=sys4;
end