function [Gds21 Gdm21 Gdms21]=gmsd21(Gd21)

ztot=zero(Gd21); ptot=pole(Gd21);
z=ztot(find(ztot>0)); p=ptot(find(ptot>0));
nz=length(z); np=length(p);

s=tf('s');
b=1;a=1;     
for i = 1:np
    b=b*(s-p(i))/(s+p(i));
end;
for i = 1:nz
    a=a*(s+z(i))/(s-z(i));
end    

Gds21=minreal(tf(b*Gd21)); Gdm21=minreal(tf(Gd21*a)); Gdms21=minreal(tf(b*Gd21*a));