2021041302.zip

  • Orekikirito
    了解作者
  • matlab
    开发工具
  • 16.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-12-28 17:23
    上传日期
CSTR连续搅拌釜反映matlab模型,已通过matlab2016a验证运行
2021041302.zip
  • MY_CSTR
  • MyCSTR.mdl.r2010b
    24.5KB
  • MyCSTR.mdl
    28.4KB
  • CSTR.m
    2.3KB
  • CSTR1.m
    0B
内容介绍
% CSTR process function [sys,x0,str,ts] = CSTR(t,x,u,flag) % The following outlines the general structure of an S-function. % switch flag, %%%%%%%%%%%%%%%%%% % Initialization % %%%%%%%%%%%%%%%%%% case 0, [sys,x0,str,ts]=mdlInitializeSizes; %%%%%%%%%%%%%%% % Derivatives % %%%%%%%%%%%%%%% case 1, sys=mdlDerivatives(t,x,u); %%%%%%%%%%% % Outputs % %%%%%%%%%%% case 3, sys=mdlOutputs(t,x,u); %%%%%%%%%%%%%%%%%%% % Unhandled flags % %%%%%%%%%%%%%%%%%%% case { 2, 4, 9 }, sys = []; %%%%%%%%%%%%%%%%%%%% % Unexpected flags % %%%%%%%%%%%%%%%%%%%% otherwise error(['Unhandled flag = ',num2str(flag)]); end % %============================================================================= % mdlInitializeSizes % Return the sizes, initial conditions, and sample times for the S-function. %============================================================================= % function [sys,x0,str,ts]=mdlInitializeSizes sizes = simsizes; sizes.NumContStates = 2; sizes.NumDiscStates = 0; sizes.NumOutputs = 2; sizes.NumInputs = 1; sizes.DirFeedthrough = 1; sizes.NumSampleTimes = 1; % at least one sample time is needed sys = simsizes(sizes); % % initialize the initial conditions % x0 = [3.531e-4;500]; str = []; ts = [0 0]; % end mdlInitializeSizes % %============================================================================= % mdlDerivatives % Return the derivatives for the continuous states. %============================================================================= % function sys=mdlDerivatives(t,x,u) %State variable x1=x(1); %x1==C; x2=x(2); %x2==Tf; %输入 u1=u(1);%u1==U; %% %Parameters k=7.86e12; Cp=4.186e3; EA=14090; p=1e3; AR=1e-3; V=1e-3; T0=350; Tc=340; C0=6.5e-3; dH=-1.13e-5; q=1e5; %model f(1)=(q/V)*(C0-x1)-k*x1*exp(-EA/x2); f(2)=(q/V)*(T0-x2)-dH*k*x1/p/Cp*exp(-EA/x2)-u1*AR*(x2-Tc)/(p*Cp*V); % f=f'; sys = f; % end mdlDerivatives % %============================================================================= % mdlOutputs % Return the block outputs. %============================================================================= % function sys=mdlOutputs(t,x,u) sys = [x(1);x(2)]; % end mdlOutputs
评论
    相关推荐