# data[].attributes.body
clc;clear all;
s=%s;
MF= (2/(0.025*s+1))
t = 0.0:0.005:0.25
u = ones(t)
y = csim(u,t,MF)
plot(t,y)

# data[].attributes.body
clear
clc

s=%s;
mx=0.3503;
mn=0.2450;

tp=1;
UP=((mx-mn)/mn)*100;

x=log(UP/100);

zeta=-x/(sqrt((%pi^2)+x^2));

wn=(%pi)/(tp*(sqrt(1-(zeta^2))));

N=mn*wn^2;

D=s^2+2*zeta*wn*s+wn^2;

G1=syslin('c',N/D)
[z,p,k]=tf2zp(G1)
d=poly(p,'s')
disp(G1)

t=0.01:0.01:10;
x=size(t);
x=x(1,2);
u=ones(1,x);
y1=csim(u,t,G1);

//Identificação de sistemas

Armaest=armax(5,6,y1,u);   //Identified model given u and y.
Acoeff=Armaest('a');    //Coefficients of the polynomial A(x)
Bcoeff=Armaest('b')     //Coefficients of the polynomial B(x)
Dcoeff=Armaest('d');    //Coefficients of the polynomial D(x)
[Ax,Bx,Dx]=arma2p(Armaest)   //Results in polynomial form.
//disp(Ax,Bx,Dx)
ar=armac(Ax,Bx,Dx,2,2,[])
y2=narsimul(ar,u)
plot(t,y1,'r',t,u,'g',t,y2,'k',)