matlab的pdetool,求Matlab pdetool使用方法 - 计算模拟 - 小木虫 - 学术 科研 互动社区...

CODE:

function pdemodel

[pde_fig,ax]=pdeinit;

pdetool('appl_cb',8);

set(ax,'DataAspectRatio',[1 1 1]);

set(ax,'PlotBoxAspectRatio',[1.5 1 1]);

set(ax,'XLim',[-1.5 1.5]);

set(ax,'YLim',[-1 1]);

set(ax,'XTickMode','auto');

set(ax,'YTickMode','auto');

% Geometry description:

pderect([-1.3302857142857141 1.1725714285714295 0.6805714285714286 -0.52285714285714291],'R1');

pdecirc(-0.72171428571428564,0.13371428571428573,0.13542857142857145,'C1');

pdecirc(0.49371428571428622,0.15257142857142858,0.11657142857142855,'C2');

set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1-(C1+C2)')

% Boundary conditions:

pdetool('changemode',0)

pdesetbd(12,...

'dir',...

1,...

'1',...

'-1')

pdesetbd(11,...

'dir',...

1,...

'1',...

'-1')

pdesetbd(10,...

'dir',...

1,...

'1',...

'-1')

pdesetbd(9,...

'dir',...

1,...

'1',...

'-1')

pdesetbd(8,...

'dir',...

1,...

'1',...

'1')

pdesetbd(7,...

'dir',...

1,...

'1',...

'1')

pdesetbd(6,...

'dir',...

1,...

'1',...

'1')

pdesetbd(5,...

'dir',...

1,...

'1',...

'1')

pdesetbd(4,...

'neu',...

1,...

'0',...

'0')

pdesetbd(3,...

'neu',...

1,...

'0',...

'0')

pdesetbd(2,...

'neu',...

1,...

'0',...

'0')

pdesetbd(1,...

'neu',...

1,...

'0',...

'0')

% Mesh generation:

setappdata(pde_fig,'Hgrad',1.3);

setappdata(pde_fig,'refinemethod','regular');

setappdata(pde_fig,'jiggle',char('on','mean',''));

pdetool('initmesh')

pdetool('refine')

pdetool('refine')

pdetool('jiggle')

% PDE coefficients:

pdeseteq(1,...

'1.0',...

'0.0',...

'0',...

'1.0',...

'0:10',...

'0.0',...

'0.0',...

'[0 100]')

setappdata(pde_fig,'currparam',...

['1.0';...

'0  '])

% Solve parameters:

setappdata(pde_fig,'solveparam',...

str2mat('0','7824','10','pdeadworst',...

'0.5','longest','0','1E-4','','fixed','Inf'))

% Plotflags and user data strings:

setappdata(pde_fig,'plotflags',[1 1 1 1 2 1 1 1 0 0 0 1 1 1 0 1 0 1]);

setappdata(pde_fig,'colstring','');

setappdata(pde_fig,'arrowstring','');

setappdata(pde_fig,'deformstring','');

setappdata(pde_fig,'heightstring','');

% Solve PDE:

pdetool('solve')

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值