ESO

时间:2022-07-30 14:29:19 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

function [sys,x0,str,ts]=fig4_3_2watch(t,x,u,flag)

switch flag,

case 0,

[sys,x0,str,ts]=mdlInit();

case 1,

sys=mdlDer(t,x,u);

case 3,

sys=mdlOutput(t,x,u);

otherwise,

sys=[];

end;

function [sys,x0,str,ts]= mdlInit()

size=simsizes;

size.NumContStates=3;

size.NumDiscStates=0;

size.NumOutputs=3;

size.NumInputs=1;

size.DirFeedthrough=0;

size.NumSampleTimes=0;

sys=simsizes(size);

x0=[0,0,0];

str=[];

ts=[];

function sys=mdlDer(t,x,u)

e=x(1)-u(1);

fe=fal(e,0.5,0.01);

fe1=fal(e,0.5,0.01);

beta1=100;

beta2=300;

beta3=1000;

sys(1)=x(2)-beta1*e;

sys(2)=x(3)-beta2*fe+3*cos(t/2);

sys(3)=-beta3*fe1;

function sys=mdlOutput(t,x,u)

sys=x;

function [sys,x0,str,ts]=fig4_3_2ctrl(t,x,u,flag)

switch flag,

case 0,

[sys,x0,str,ts]=mdlInit();

case 1,

sys=mdlDer(t,x,u);

case 3,

sys=mdlOutput(t,x,u);

otherwise,

sys=[];

end;

function [sys,x0,str,ts]= mdlInit()

size=simsizes;

size.NumContStates=2;

size.NumDiscStates=0;

size.NumOutputs=3;

size.NumInputs=0;

size.DirFeedthrough=0;

size.NumSampleTimes=0;

sys=simsizes(size);

x0=[0,0];

str=[];

ts=[];

function sys=mdlDer(t,x,u)

a=1;

w=1;

sys(1)=x(2);

sys(2)=a*sign(sin(w*t))+3*cos(t/2);

function sys=mdlOutput(t,x,u)

a=1;

w=1;

sys=x;

sys(3)=a*sign(sin(w*t));

本文来源:https://www.wddqw.com/doc/e6a93e1331b765ce04081426.html