⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sys.m

📁 一汽车整车模型
💻 M
📖 第 1 页 / 共 2 页
字号:
function [ret,x0,str,ts,xts]=sys(t,x,u,flag);
%TIRETEST	is the M-file description of the SIMULINK system named TIRETEST.
%	The block-diagram can be displayed by typing: TIRETEST.
%
%	SYS=TIRETEST(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 TIRETEST 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 TIRETEST with a FLAG of zero:
%	[SIZES]=TIRETEST([],[],[],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',[92,250,514,498])
     open_system(sys)
end;
set_param(sys,'algorithm',     'Euler')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '6.0')
set_param(sys,'Min step size', '0.02')
set_param(sys,'Max step size', '0.02')
set_param(sys,'RelTol','1e-3')
% set_param(sys,'Return vars',   '')

add_block('built-in/Constant',[sys,'/','vert. force'])
set_param([sys,'/','vert. force'],...
		'Value','4000',...
		'position',[45,177,90,203])

add_block('built-in/Signal Generator',[sys,'/','slip angle'])
set_param([sys,'/','slip angle'],...
		'Drop Shadow',4,...
		'Peak','30.000000',...
		'Peak Range','90.000000',...
		'Freq','1.000000',...
		'Freq Range','50.000000',...
		'Wave','Saw',...
		'Units','Rads',...
		'position',[45,78,90,112])

add_block('built-in/Constant',[sys,'/','slip'])
set_param([sys,'/','slip'],...
		'Value','0',...
		'position',[45,17,90,43])


%     Subsystem  'lat. force'.

add_block('built-in/SubSystem',[sys,'/','lat. force'])
% new_system([sys,'/','lat. force'])
set_param([sys,'/','lat. force'],'Location',[0,0,274,193])

add_block('built-in/Inport',[sys,'/','lat. force/y'])
set_param([sys,'/','lat. force/y'],...
		'Port','2',...
		'position',[10,100,30,120])

add_block('built-in/Inport',[sys,'/','lat. force/x'])
set_param([sys,'/','lat. force/x'],...
		'position',[10,30,30,50])

add_block('built-in/Mux',[sys,'/','lat. force/Mux'])
set_param([sys,'/','lat. force/Mux'],...
		'inputs','2',...
		'position',[100,61,130,94])

add_block('built-in/S-Function',[sys,'/',['lat. force/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['lat. force/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunxy',...
		'parameters','ax',...
		'position',[185,70,235,90])
add_line([sys,'/','lat. force'],[35,110;70,110;70,85;95,85])
add_line([sys,'/','lat. force'],[35,40;70,40;70,70;95,70])
add_line([sys,'/','lat. force'],[135,80;180,80])
set_param([sys,'/','lat. force'],...
		'Mask Display','plot(0,0,100,100,[12,91,91,12,12],[90,90,45,45,90],[51,57,65,75,80,79,75,67,60,54,51,48,42,34,28,27,31,42,51],[71,68,66,66,72,79,83,84,81,77,71,60,54,54,58,65,71,74,71])')
set_param([sys,'/','lat. force'],...
		'Mask Type','XY scope.',...
		'Mask Dialogue','XY scope using MATLAB graph window.\nFirst input is used as time base.\nEnter plotting ranges.|x-min|x-max|y-min|y-max')
set_param([sys,'/','lat. force'],...
		'Mask Translate','ax = [@1, @2, @3, @4];',...
		'Mask Help','This block can be used to explore limit cycles. Look at the m-file sfunxy.m to see how it works.',...
		'Mask Entries','-30\/30\/-5000\/5000\/')


%     Finished composite block 'lat. force'.

set_param([sys,'/','lat. force'],...
		'Drop Shadow',4,...
		'position',[320,86,350,124])


%     Subsystem  'long. force'.

add_block('built-in/SubSystem',[sys,'/','long. force'])
set_param([sys,'/','long. force'],'Location',[0,0,274,193])

add_block('built-in/S-Function',[sys,'/',['long. force/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['long. force/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunxy',...
		'parameters','ax',...
		'position',[185,70,235,90])

add_block('built-in/Mux',[sys,'/','long. force/Mux'])
set_param([sys,'/','long. force/Mux'],...
		'inputs','2',...
		'position',[100,61,130,94])

add_block('built-in/Inport',[sys,'/','long. force/x'])
set_param([sys,'/','long. force/x'],...
		'position',[10,30,30,50])

add_block('built-in/Inport',[sys,'/','long. force/y'])
set_param([sys,'/','long. force/y'],...
		'Port','2',...
		'position',[10,100,30,120])
add_line([sys,'/','long. force'],[135,80;180,80])
add_line([sys,'/','long. force'],[35,40;70,40;70,70;95,70])
add_line([sys,'/','long. force'],[35,110;70,110;70,85;95,85])
set_param([sys,'/','long. force'],...
		'Mask Display','plot(0,0,100,100,[12,91,91,12,12],[90,90,45,45,90],[51,57,65,75,80,79,75,67,60,54,51,48,42,34,28,27,31,42,51],[71,68,66,66,72,79,83,84,81,77,71,60,54,54,58,65,71,74,71])')
set_param([sys,'/','long. force'],...
		'Mask Type','XY scope.',...
		'Mask Dialogue','XY scope using MATLAB graph window.\nFirst input is used as time base.\nEnter plotting ranges.|x-min|x-max|y-min|y-max')
set_param([sys,'/','long. force'],...
		'Mask Translate','ax = [@1, @2, @3, @4];',...
		'Mask Help','This block can be used to explore limit cycles. Look at the m-file sfunxy.m to see how it works.',...
		'Mask Entries','-30\/30\/-5000\/5000\/')


%     Finished composite block 'long. force'.

set_param([sys,'/','long. force'],...
		'Drop Shadow',4,...
		'position',[320,21,350,59])


%     Subsystem  'aligning torque'.

add_block('built-in/SubSystem',[sys,'/','aligning torque'])
set_param([sys,'/','aligning torque'],'Location',[0,0,274,193])

add_block('built-in/S-Function',[sys,'/',['aligning torque/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['aligning torque/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunxy',...
		'parameters','ax',...
		'position',[185,70,235,90])

add_block('built-in/Mux',[sys,'/','aligning torque/Mux'])
set_param([sys,'/','aligning torque/Mux'],...
		'inputs','2',...
		'position',[100,61,130,94])

add_block('built-in/Inport',[sys,'/','aligning torque/x'])
set_param([sys,'/','aligning torque/x'],...
		'position',[10,30,30,50])

add_block('built-in/Inport',[sys,'/','aligning torque/y'])
set_param([sys,'/','aligning torque/y'],...
		'Port','2',...
		'position',[10,100,30,120])
add_line([sys,'/','aligning torque'],[135,80;180,80])
add_line([sys,'/','aligning torque'],[35,40;70,40;70,70;95,70])
add_line([sys,'/','aligning torque'],[35,110;70,110;70,85;95,85])
set_param([sys,'/','aligning torque'],...
		'Mask Display','plot(0,0,100,100,[12,91,91,12,12],[90,90,45,45,90],[51,57,65,75,80,79,75,67,60,54,51,48,42,34,28,27,31,42,51],[71,68,66,66,72,79,83,84,81,77,71,60,54,54,58,65,71,74,71])')
set_param([sys,'/','aligning torque'],...
		'Mask Type','XY scope.',...
		'Mask Dialogue','XY scope using MATLAB graph window.\nFirst input is used as time base.\nEnter plotting ranges.|x-min|x-max|y-min|y-max')
set_param([sys,'/','aligning torque'],...
		'Mask Translate','ax = [@1, @2, @3, @4];',...
		'Mask Help','This block can be used to explore limit cycles. Look at the m-file sfunxy.m to see how it works.',...
		'Mask Entries','-30\/30\/-50\/50\/')


%     Finished composite block 'aligning torque'.

set_param([sys,'/','aligning torque'],...
		'Drop Shadow',4,...
		'position',[320,161,350,199])
function [ret,x0,strts,xts]=tiretest(t,x,u,flag);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -