注册 登录
编程论坛 新人交流区

求助(急):pde解偏微分方程的输出解的问题

doctorsundan 发布于 2007-10-07 21:07, 883 次点击
大家好
如何用保存的Pde的M文件输出u,p,e,t.
谢谢!!!!
3 回复
#2
doctorsundan2007-10-07 21:13
运行完该程序结果是图,我需要的是,u,p,e,t

function pdemodel
[pde_fig,ax]=pdeinit;
pdetool('appl_cb',1);
set(ax,'DataAspectRatio',[1 0.57295779513082312 1]);
set(ax,'PlotBoxAspectRatio',[3.1415926535897931 2.0943951023931957 1]);
set(ax,'XLim',[0 6.2831853071795862]);
set(ax,'YLim',[-1.2 1.2]);
set(ax,'XTickMode','auto');
set(ax,'YTickMode','auto');
pdetool('gridon','on');

% Geometry description:
pderect([0 6.2831853071795862 1.2 -1.2],'R1');
set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1')

% Boundary conditions:
pdetool('changemode',0)
pdesetbd(4,...
'dir',...
1,...
'1',...
'0')
pdesetbd(3,...
'dir',...
1,...
'1',...
'(1+0.6*cos(x)).^2')
pdesetbd(2,...
'dir',...
1,...
'1',...
'0')
pdesetbd(1,...
'dir',...
1,...
'1',...
'(1+0.6*cos(x)).^2')

% Mesh generation:
setuprop(pde_fig,'Hgrad',1.3);
setuprop(pde_fig,'refinemethod','regular');
pdetool('initmesh')
pdetool('refine')

% PDE coefficients:
pdeseteq(1,...
'1.0',...
'(-6/5*cos(x)/(1+3/5*cos(x)))',...
'(-9/25*sin(x).^2.*(2+1.2*cos(x))/(1+0.6*cos(x))+2.04*sin(x)/(1+0.6*cos(x)))',...
'1.0',...
'0:10',...
'0.0',...
'0.0',...
'[0 100]')
setuprop(pde_fig,'currparam',...
['1.0 ';...
'(-6/5*cos(x)/(1+3/5*cos(x))) ';...
'(-9/25*sin(x).^2.*(2+1.2*cos(x))/(1+0.6*cos(x))+2.04*sin(x)/(1+0.6*cos(x)))';...
'1.0 '])

% Solve parameters:
setuprop(pde_fig,'solveparam',...
str2mat('0','1000','10','pdeadworst',...
'0.5','longest','0','1E-4','','fixed','Inf'))

% Plotflags and user data strings:
setuprop(pde_fig,'plotflags',[1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1]);
setuprop(pde_fig,'colstring','');
setuprop(pde_fig,'arrowstring','');
setuprop(pde_fig,'deformstring','');
setuprop(pde_fig,'heightstring','');

% Solve PDE:
pdetool('solve')

#3
doctorsundan2007-10-07 21:19
回复:(doctorsundan)运行完该程序结果是图,我需要...
如何用M文件写出来,而不是用mesh中的export菜单选项输出u,p,e,t
#4
xieanko2007-10-07 22:22

不知道
太深奥了
没学微机分

1