function varargout = xiangyanmain(varargin)
% XIANGYANMAIN MATLAB code for xiangyanmain.fig
% XIANGYANMAIN, by itself, creates a new XIANGYANMAIN or raises the existing
% singleton*.
%
% H = XIANGYANMAIN returns the handle to a new XIANGYANMAIN or the handle to
% the existing singleton*.
%
% XIANGYANMAIN('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in XIANGYANMAIN.M with the given input arguments.
%
% XIANGYANMAIN('Property','Value',...) creates a new XIANGYANMAIN or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before xiangyanmain_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to xiangyanmain_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help xiangyanmain
% Last Modified by GUIDE v2.5 22-Feb-2024 21:19:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @xiangyanmain_OpeningFcn, ...
'gui_OutputFcn', @xiangyanmain_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before xiangyanmain is made visible.
function xiangyanmain_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to xiangyanmain (see VARARGIN)
% Choose default command line output for xiangyanmain
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes xiangyanmain wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = xiangyanmain_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in radiobutton3.
function radiobutton3_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton3
% --- Executes on button press in radiobutton4.
function radiobutton4_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton4
% --------------------------------------------------------------------
function uibuttongroup2_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to uibuttongroup2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit12 as text
% str2double(get(hObject,'String')) returns contents of edit12 as a double
% --- Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global l1 l2 M b bb u v a q h f flag sum total air;
sum=0;
if flag==0 %检查参数
errordlg('请检查参数','参数错误'); %参数错误处理
else %参数正确
cla(handles.axes1); %清除窗口
cla(handles.axes2);
cla(handles.axes3);
% cla(handles.axes5);
% set(handles.edit10,'string',''); %清除显示
% set(handles.edit12,'string','');
% set(handles.edit11,'string','');
% set(handles.edit12,'string','');
t=0:0.01:l1/u; %求出烟草毒物密度w(x,t)
w0=M/l1; %初始毒物密度
q=a*u*w0/(1-a)*exp(-((b*l1+bb*l2)/v))*(exp(b*u*t/v)-a*exp(a*b*u*t/v));
%求出吸口端的流量q(l1+l2,t)
total=a*M*v/(1-a)/b/l1*exp(-bb*l2/v)*(1-exp((a-1)*b*l1/v));
%求出吸入毒物总量Q
air=u*w0*l1/u+a*w0*v/(1-a)/b*(exp((a-1)*b*l1*u/v/u)-1);
%求出进入空气毒物总量
% 动态图像绘制,同步显示
set(handles.axes1,'Visible','on');
set(handles.axes2,'visible','on');
set(handles.axes3,'visible','on');
set(h,'Visible','off');
set(f,'Visible','off');
axes(handles.axes2);
axis([0 l1/u 0 max(q)]);
axis on;
title('过滤嘴末端毒物流量随时间变化图','Color','y','fontsize',12);
xlabel('time');
ylabel('毒物流量');
hold on;
axis([0 l1/u 0 max(q)]);
wenzi=text(-10,-10,'');
axes(handles.axes1); %吸烟动态图
axis off;
title('吸烟过程动态示意图','Color','y','fontsize',16);
%title('xyh','Color','r')
rectangle('position',[0 0 10 4],'FaceColor',[0.71 0.77 0.69],'EdgeColor',[0.71 0.77 0.69]);
%背景
rectangle('position',[0 1.6 l1*10/(l1+l2) 0.8],'FaceColor','w');
%过滤嘴
rectangle('position',[l1*10/(l1+l2) 1.6 l2*10/(l1+l2) 0.8],'FaceColor','y');
%烟草
%烟草
for i=1:0.3:50
time=l1*i/50/u;
tt=time;
qt=q(round(u*length(q)*time/l1));
sum=sum+qt;
rectangle('position',[l1*i/5/(l1+l2) 1.6 l1/5/(l1+l2) 0.8],'FaceColor','r','EdgeColor','r');
rectangle('position',[l1*(i-1)/5/(l1+l2) 0 l1/5/(l1+l2) 4],'FaceColor',[0.71 0.77 0.69],'EdgeColor',[0.71 0.77 0.69]);
%背景条
hold on;
set(handles.edit10,'string',num2str(l1*i/50/u));
set(wenzi,'position',[tt qt],'string',num2str(qt));
axes(handles.axes2);
plot(tt,qt,'w-');
line([tt tt],[qt 0],'linewidth',3);
axes(handles.axes3);
axis([0 l1/u 0
【数学建模】基于matlab GUI香烟过滤嘴问题【含Matlab源码 4000期】.zip
版权申诉
182 浏览量
2024-02-22
23:20:44
上传
评论
收藏 298KB ZIP 举报
海神之光
- 粉丝: 3w+
- 资源: 2093
最新资源
- Pytorch-pytorch深度学习教程之Tensorboard.zip
- 基于C++和Python开发yolov8-face作为人脸检测器dlib作为人脸识别器的人脸考勤系统源码+项目说明.zip
- Pytorch-pytorch深度学习教程之变分自动编码器.zip
- Pytorch-pytorch深度学习教程之神经风格迁移.zip
- Pytorch-pytorch深度学习教程之深度残差网络.zip
- Pytorch-pytorch深度学习教程之循环神经网络.zip
- Pytorch-pytorch深度学习教程之逻辑回归.zip
- Pytorch-pytorch深度学习教程之双向循环网络.zip
- Pytorch-pytorch深度学习教程之卷积神经网络.zip
- Pytorch-pytorch深度学习教程之前馈神经网络.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈