Programe.docx

download Programe.docx

of 4

Transcript of Programe.docx

  • 7/25/2019 Programe.docx

    1/4

    RK 2 cu mimo.

    function xd=mimo(t,x)

    global k1 k2 k3 t1 t2 t3 t4 u1 u2;

    xd(1)=(k1 * u1+k1*u2-x(2))(t2*t3);

    xd(2)=(k1*t1*u1-(t2+t3)*x(2))(t2*t3)+x(1);

    xd(3)=(k2*u1+k3*u2-x(4))(t2*t3);

    xd(4)=(k3*t4*u2-(t2+t3)*x(4))(t2*t3)+x(3);

    !c"o o#;

    global k1 k2 k3 t1 t2 t3 t4 u1 u2;

    t$=$;

    t(1)=t$

    tf=%$;

    t1=&;

    t2=2;

    t3=3;

    t4=4;

    '1$=$;

    '2$=$;

    '3$=$;

    '4$=$;

    u1=1;

    u2=2;

    k1=1;

    k2=2;

    k3=3;

  • 7/25/2019 Programe.docx

    2/4

    "=$.$1;

    =$.1;

    '(1,1)='1$;

    '(1,2)='2$;

    '(1,3)='3$;

    '(1,4)='4$;

    uc1(1)=u1;

    uc2(1)=u2;

    tc=t$;

    'c='1$ '2$ '3$ '4$;

    fo k=2(tf-t$)+1,

    fo i=1",

    K$="*mimo(tc,'c);

    K1="*mimo(tc+",'c+K$);

    'c='c+(K$+K1)2;

    tc=tc+";

    !nd;

    t(k)=tc;

    '(k,1)='c(1);

    '(k,2)='c(2);

    '(k,3)='c(3);

    '(k,4)='c(4);

    uc1(k)=u1;

    uc2(k)=u2;

    !nd;

    ublot(211);

  • 7/25/2019 Programe.docx

    3/4

    lot(t,'(,2),/-/,t,uc1,/-g/);

    gid;

    titl!(/0au!1/)

    ublot(212);

    lot(t,'(,4),/-/,t,uc2,/-b/);

    gid;

    titl!(/0au!2/)

    Rk1.od1

    function 'd=od1(t,')

    global k t u;

    'd=(k*u-')t;

    !nd

    global k t u;

    k=1;

    t=2;

    u=1;

    t$=$;

    tf=2$;

    "=$.$1;

    '$=$;

    =$.1;

    t(1)=t$;

    '(1)='$;

    tc=t$;

    uc(1)=u;

  • 7/25/2019 Programe.docx

    4/4

    'c='$;

    fo k=2(tf-t$)+1;

    fo i=1";

    'c='c+"*od1(tc,'c);

    tc=tc+";

    !nd;

    t(k)=tc;

    '(k)='c;

    uc(k)=u;

    !nd;

    clf;

    lot(t,',/-/,t,uc,/-b/);

    gid;

    titl! (/aun it!m odin unu/);