📄 enzyme2.m
字号:
function [ret,x0,str,ts,xts]=enzyme1(t,x,u,flag);
%ENZYME1 is the M-file description of the SIMULINK system named ENZYME1.
% The block-diagram can be displayed by typing: ENZYME1.
%
% SYS=ENZYME1(T,X,U,FLAG) returns depending on FLAG certain
% system values given time point, T, current state vector, X,
% and input vector, U.
% FLAG is used to indicate the type of output to be returned in SYS.
%
% Setting FLAG=1 causes ENZYME1 to return state derivatives, FLAG=2
% discrete states, FLAG=3 system outputs and FLAG=4 next sample
% time. For more information and other options see SFUNC.
%
% Calling ENZYME1 with a FLAG of zero:
% [SIZES]=ENZYME1([],[],[],0), returns a vector, SIZES, which
% contains the sizes of the state vector and other parameters.
% SIZES(1) number of states
% SIZES(2) number of discrete states
% SIZES(3) number of outputs
% SIZES(4) number of inputs
% SIZES(5) number of roots (currently unsupported)
% SIZES(6) direct feedthrough flag
% SIZES(7) number of sample times
%
% For the definition of other parameters in SIZES, see SFUNC.
% See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.
% Note: This M-file is only used for saving graphical information;
% after the model is loaded into memory an internal model
% representation is used.
% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
if (0 == (nargin + nargout))
set_param(sys,'Location',[-3,40,781,477])
open_system(sys)
end;
set_param(sys,'algorithm', 'Adams/Gear')
set_param(sys,'Start time', '0.0')
set_param(sys,'Stop time', '8000')
set_param(sys,'Min step size', '0.001')
set_param(sys,'Max step size', '0.2')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars', '')
set_param(sys,'AssignWideVectorLines','on');
add_block('built-in/To Workspace',[sys,'/','To Workspace1'])
set_param([sys,'/','To Workspace1'],...
'ForeGround',4,...
'mat-name','gamma',...
'buffer','[8000,1,1]',...
'position',[595,212,645,228])
add_block('built-in/Integrator',[sys,'/','gamma'])
set_param([sys,'/','gamma'],...
'ForeGround',4,...
'move name',0,...
'Drop Shadow',4,...
'position',[465,210,485,230])
add_block('built-in/To Workspace',[sys,'/','To Workspace'])
set_param([sys,'/','To Workspace'],...
'ForeGround',2,...
'mat-name','alpha',...
'buffer','[8000,1,1]',...
'position',[590,137,640,153])
add_block('built-in/Integrator',[sys,'/','alpha'])
set_param([sys,'/','alpha'],...
'ForeGround',2,...
'move name',0,...
'Drop Shadow',4,...
'position',[460,135,480,155])
add_block('built-in/Sum',[sys,'/','Sum'])
set_param([sys,'/','Sum'],...
'ForeGround',2,...
'inputs','++-',...
'position',[365,107,385,143])
add_block('built-in/Fcn',[sys,'/','Sigma-i*Fn'])
set_param([sys,'/','Sigma-i*Fn'],...
'orientation',2,...
'ForeGround',3,...
'Expr','1.3*u^4/(10^4+u^4)',...
'position',[455,45,495,65])
add_block('built-in/Sum',[sys,'/','Sum1'])
set_param([sys,'/','Sum1'],...
'ForeGround',4,...
'inputs','+--',...
'position',[365,217,385,253])
add_block('built-in/Gain',[sys,'/','ks'])
set_param([sys,'/','ks'],...
'ForeGround',4,...
'Gain','.06',...
'position',[195,222,220,248])
add_block('built-in/To Workspace',[sys,'/','To Workspace2'])
set_param([sys,'/','To Workspace2'],...
'BackGround',7,...
'mat-name','v',...
'buffer','[8000,1,1]',...
'position',[595,7,645,23])
add_block('built-in/Scope',[sys,'/','alpha_scope'])
set_param([sys,'/','alpha_scope'],...
'Vgain','120.000000',...
'Hgain','1000.000000',...
'Vmax','240.000000',...
'Hmax','2000.000000',...
'Window',[667,492,787,595])
open_system([sys,'/','alpha_scope'])
set_param([sys,'/','alpha_scope'],...
'position',[700,95,730,125])
add_block('built-in/Scope',[sys,'/','gamma_scope'])
set_param([sys,'/','gamma_scope'],...
'Vgain','400.000000',...
'Hgain','1000.000000',...
'Vmax','800.000000',...
'Hmax','2000.000000',...
'Window',[532,493,660,595])
open_system([sys,'/','gamma_scope'])
set_param([sys,'/','gamma_scope'],...
'position',[705,240,735,270])
add_block('built-in/Sum',[sys,'/','v'])
set_param([sys,'/','v'],...
'BackGround',7,...
'position',[155,115,175,135])
add_block('built-in/Gain',[sys,'/','V0'])
set_param([sys,'/','V0'],...
'BackGround',7,...
'Gain','0.607',...
'Mask Display','0.607',...
'Mask Dialogue','eval(''slideg(0,0.607,1,0)'');',...
'position',[90,16,140,44])
add_block('built-in/Constant',[sys,'/',['Substrate',13,'rate, DC']])
set_param([sys,'/',['Substrate',13,'rate, DC']],...
'BackGround',7,...
'position',[35,20,55,40])
add_block('built-in/Signal Generator',[sys,'/',['Substrate',13,'rate, AC']])
set_param([sys,'/',['Substrate',13,'rate, AC']],...
'BackGround',7,...
'Peak','1.000000',...
'Peak Range','5.000000',...
'Freq','0.025000',...
'Freq Range','1.000000',...
'Wave','Sin',...
'Units','Rads')
set_param([sys,'/',['Substrate',13,'rate, AC']],...
'position',[10,123,55,157])
add_block('built-in/Gain',[sys,'/','VA'])
set_param([sys,'/','VA'],...
'BackGround',7,...
'Gain','0.2',...
'Mask Display','0.2',...
'Mask Dialogue','eval(''slideg(0,0.2,2,0)'');',...
'position',[75,126,125,154])
add_block('built-in/Gain',[sys,'/','SigmaM'])
set_param([sys,'/','SigmaM'],...
'orientation',2,...
'ForeGround',6,...
'Gain','10.',...
'position',[390,322,415,348])
add_block('built-in/Gain',[sys,'/','q'])
set_param([sys,'/','q'],...
'orientation',2,...
'ForeGround',6,...
'position',[345,277,370,303])
% Subsystem 'Phi'.
new_system([sys,'/','Phi'])
set_param([sys,'/','Phi'],'Location',[-5,363,600,603])
add_block('built-in/Product',[sys,'/','Phi/Product1'])
set_param([sys,'/','Phi/Product1'],...
'inputs','3',...
'position',[445,57,475,93])
add_block('built-in/Product',[sys,'/','Phi/Phi'])
set_param([sys,'/','Phi/Phi'],...
'ForeGround',6,...
'position',[535,108,565,132])
add_block('built-in/Fcn',[sys,'/','Phi/Fcn3'])
set_param([sys,'/','Phi/Fcn3'],...
'Expr','1/u',...
'position',[445,145,485,165])
add_block('built-in/Constant',[sys,'/','Phi/L'])
set_param([sys,'/','Phi/L'],...
'Value','5000000',...
'position',[285,175,305,195])
add_block('built-in/Sum',[sys,'/','Phi/Sum2'])
set_param([sys,'/','Phi/Sum2'],...
'inputs','+++',...
'position',[350,97,370,133])
add_block('built-in/Fcn',[sys,'/','Phi/Fcn2'])
set_param([sys,'/','Phi/Fcn2'],...
'Expr','u*u',...
'position',[255,125,295,145])
add_block('built-in/Fcn',[sys,'/','Phi/Fcn1'])
set_param([sys,'/','Phi/Fcn1'],...
'Expr','u*u',...
'position',[255,70,295,90])
add_block('built-in/Constant',[sys,'/','Phi/One'])
set_param([sys,'/','Phi/One'],...
'position',[55,105,75,125])
add_block('built-in/Sum',[sys,'/','Phi/1+gamma'])
set_param([sys,'/','Phi/1+gamma'],...
'position',[150,135,170,155])
add_block('built-in/Sum',[sys,'/','Phi/1+alpha'])
set_param([sys,'/','Phi/1+alpha'],...
'position',[150,80,170,100])
add_block('built-in/Inport',[sys,'/','Phi/in_1'])
set_param([sys,'/','Phi/in_1'],...
'position',[95,30,115,50])
add_block('built-in/Outport',[sys,'/','Phi/out_1'])
set_param([sys,'/','Phi/out_1'],...
'position',[585,110,605,130])
add_block('built-in/Inport',[sys,'/','Phi/in_2'])
set_param([sys,'/','Phi/in_2'],...
'Port','2',...
'position',[75,30,95,50])
add_line([sys,'/','Phi'],[490,155;505,155;505,125;530,125])
add_line([sys,'/','Phi'],[480,75;500,75;500,115;530,115])
add_line([sys,'/','Phi'],[375,115;405,115;405,155;440,155])
add_line([sys,'/','Phi'],[300,135;315,135;315,115;345,115])
add_line([sys,'/','Phi'],[315,135;330,85;440,85])
add_line([sys,'/','Phi'],[175,90;205,90;205,80;250,80])
add_line([sys,'/','Phi'],[205,80;205,50;380,50;380,75;440,75])
add_line([sys,'/','Phi'],[120,40;120,85;145,85])
add_line([sys,'/','Phi'],[120,65;440,65])
add_line([sys,'/','Phi'],[310,185;330,180;330,130;345,125])
add_line([sys,'/','Phi'],[300,80;315,80;315,105;345,105])
add_line([sys,'/','Phi'],[175,145;205,145;205,135;250,135])
add_line([sys,'/','Phi'],[80,115;105,115;105,95;145,95])
add_line([sys,'/','Phi'],[105,105;105,140;145,140])
add_line([sys,'/','Phi'],[570,120;580,120])
add_line([sys,'/','Phi'],[100,40;100,150;145,150])
% Finished composite block 'Phi'.
set_param([sys,'/','Phi'],...
'ForeGround',6,...
'position',[285,372,315,423])
% Subsystem 'INFORMATION'.
new_system([sys,'/','INFORMATION'])
set_param([sys,'/','INFORMATION'],'Location',[10,175,630,580])
add_block('built-in/Note',[sys,'/','INFORMATION/where, A = alpha, G = gamma'])
set_param([sys,'/','INFORMATION/where, A = alpha, G = gamma'],...
'position',[270,310,275,315])
add_block('built-in/Note',[sys,'/',['INFORMATION/Phi = {A*(1+A)*(1+G)^2}//{L + (1+A)^2 + (1+G)^2}',13,'Fn = G^n//(K^n + G^n)']])
set_param([sys,'/',['INFORMATION/Phi = {A*(1+A)*(1+G)^2}//{L + (1+A)^2 + (1+G)^2}',13,'Fn = G^n//(K^n + G^n)']],...
'position',[290,270,295,275])
add_block('built-in/Note',[sys,'/',['INFORMATION/dA//dt = V - Sigma-M*Phi + Sigma-i*Fn',13,'dG//dt = q*Sigma-M*Phi - Sigma-i*Fn - ks*G']])
set_param([sys,'/',['INFORMATION/dA//dt = V - Sigma-M*Phi + Sigma-i*Fn',13,'dG//dt = q*Sigma-M*Phi - Sigma-i*Fn - ks*G']],...
'position',[275,235,280,240])
add_block('built-in/Note',[sys,'/','INFORMATION/Equations of model:'])
set_param([sys,'/','INFORMATION/Equations of model:'],...
'position',[155,210,160,215])
add_block('built-in/Note',[sys,'/',['INFORMATION/This model simulates a product-activated enzyme reaction with',13,'recycling of product into substrate. ']])
set_param([sys,'/',['INFORMATION/This model simulates a product-activated enzyme reaction with',13,'recycling of product into substrate. ']],...
'position',[295,60,300,65])
add_block('built-in/Note',[sys,'/',['INFORMATION/ Many biochemical reactions are of this type.',13,'One prominent reaction is the glycolosis pathway, in which ADP is converted into',13,'ATP. ']])
set_param([sys,'/',['INFORMATION/ Many biochemical reactions are of this type.',13,'One prominent reaction is the glycolosis pathway, in which ADP is converted into',13,'ATP. ']],...
'position',[315,100,320,105])
add_block('built-in/Note',[sys,'/',['INFORMATION/ Athough this pathway has been modeled in much more detail, this two component',13,'model captures its essential behavior. See (Goldbeter and Moran, Eur. Biophys. J.,',13,'15: 277-287, 1988.)']])
set_param([sys,'/',['INFORMATION/ Athough this pathway has been modeled in much more detail, this two component',13,'model captures its essential behavior. See (Goldbeter and Moran, Eur. Biophys. J.,',13,'15: 277-287, 1988.)']],...
'position',[325,145,330,150])
set_param([sys,'/','INFORMATION'],...
'Mask Display','Double-click')
% Finished composite block 'INFORMATION'.
set_param([sys,'/','INFORMATION'],...
'ForeGround',1,...
'BackGround',0,...
'position',[650,300,740,337])
% Subsystem 'INSTRUCTIONS'.
new_system([sys,'/','INSTRUCTIONS'])
set_param([sys,'/','INSTRUCTIONS'],'Location',[35,273,490,578])
add_block('built-in/Note',[sys,'/',['INSTRUCTIONS/The net input, v, and the two outputs, alpha and gamma,',13,'will be sent to the workspace. By default, they are sampled',13,'at 1.0 Hz for 8000 seconds.']])
set_param([sys,'/',['INSTRUCTIONS/The net input, v, and the two outputs, alpha and gamma,',13,'will be sent to the workspace. By default, they are sampled',13,'at 1.0 Hz for 8000 seconds.']],...
'position',[240,200,245,205])
add_block('built-in/Note',[sys,'/',['INSTRUCTIONS/To set the amplitude of the sinusoidal input, double-click',13,'the VA block and set the value.']])
set_param([sys,'/',['INSTRUCTIONS/To set the amplitude of the sinusoidal input, double-click',13,'the VA block and set the value.']],...
'position',[230,160,235,165])
add_block('built-in/Note',[sys,'/','INSTRUCTIONS/Note that the frequency should be specified in radians//sec.'])
set_param([sys,'/','INSTRUCTIONS/Note that the frequency should be specified in radians//sec.'],...
'position',[230,125,235,130])
add_block('built-in/Note',[sys,'/',['INSTRUCTIONS/To set the frequency of the sinusoidal input, double-click',13,'the ''Substrate rate, AC'' block and set the value.']])
set_param([sys,'/',['INSTRUCTIONS/To set the frequency of the sinusoidal input, double-click',13,'the ''Substrate rate, AC'' block and set the value.']],...
'position',[230,90,235,95])
add_block('built-in/Note',[sys,'/',['INSTRUCTIONS/To set the magnitude of the step input, double-click',13,'the V0 block and set the value.']])
set_param([sys,'/',['INSTRUCTIONS/To set the magnitude of the step input, double-click',13,'the V0 block and set the value.']],...
'position',[225,45,230,50])
set_param([sys,'/','INSTRUCTIONS'],...
'Mask Display','Double-click')
% Finished composite block 'INSTRUCTIONS'.
set_param([sys,'/','INSTRUCTIONS'],...
'ForeGround',1,...
'BackGround',3,...
'position',[650,365,740,402])
add_line(sys,[485,145;585,145])
add_line(sys,[490,220;590,220])
add_line(sys,[450,55;305,55;305,115;360,115])
add_line(sys,[390,125;415,125;415,145;455,145])
add_line(sys,[305,115;305,245;360,245])
add_line(sys,[390,235;420,235;420,220;460,220])
add_line(sys,[225,235;360,235])
add_line(sys,[490,220;490,275;155,275;155,235;190,235])
add_line(sys,[550,145;550,110;695,110])
add_line(sys,[545,220;545,255;700,255])
add_line(sys,[180,125;360,125])
add_line(sys,[225,125;225,15;590,15])
add_line(sys,[60,30;85,30])
add_line(sys,[145,30;160,30;160,90;130,90;130,120;150,120])
add_line(sys,[60,140;70,140])
add_line(sys,[130,140;135,140;135,130;150,130])
add_line(sys,[385,335;375,290])
add_line(sys,[485,145;485,185;110,185;110,385;280,385])
add_line(sys,[155,275;155,310;90,310;90,410;280,410])
add_line(sys,[320,400;580,400;580,335;420,335])
add_line(sys,[385,335;320,335;320,135;360,135])
add_line(sys,[340,290;335,290;335,225;360,225])
add_line(sys,[525,220;525,55;500,55])
drawnow
% Return any arguments.
if (nargin | nargout)
% Must use feval here to access system in memory
if (nargin > 3)
if (flag == 0)
eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
else
eval(['ret =', sys,'(t,x,u,flag);'])
end
else
[ret,x0,str,ts,xts] = feval(sys);
end
else
drawnow % Flash up the model and execute load callback
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -