how to export solution automatically when using PDE toolbox?
17 ビュー (過去 30 日間)
古いコメントを表示
I'm using PDE toolbox to solve a heat transfer question and find it can't export solutions to the workspace automatically. I have to click slove-export solution manually like the image below. Can someone teach me how to do?
here is the code
% This script is written and read by pdetool and should NOT be edited.
% There are two recommended alternatives:
% 1) Export the required variables from pdetool and create a MATLAB script
% to perform operations on these.
% 2) Define the problem completely using a MATLAB script. See
% https://www.mathworks.com/help/pde/examples.html for examples
% of this approach.
function pdemodel
[pde_fig,ax]=pdeinit;
pdetool('appl_cb',10);
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([-0.98026315789473673 1.0263157894736845 0.48190789473684204 -0.28453947368421084],'R1');
pderect([0.46710526315789513 0.52631578947368451 0.29769736842105243 -0.11348684210526327],'R2');
pderect([-0.52631578947368385 -0.46710526315789447 0.29769736842105243 -0.11348684210526327],'R3');
set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1-R2-R3')
% Boundary conditions:
pdetool('changemode',0)
pdesetbd(12,...
'neu',...
1,...
'0',...
'0')
pdesetbd(11,...
'neu',...
1,...
'0',...
'0')
pdesetbd(10,...
'neu',...
1,...
'0',...
'0')
pdesetbd(9,...
'neu',...
1,...
'0',...
'0')
pdesetbd(8,...
'neu',...
1,...
'0',...
'0')
pdesetbd(7,...
'neu',...
1,...
'0',...
'0')
pdesetbd(6,...
'neu',...
1,...
'0',...
'0')
pdesetbd(5,...
'neu',...
1,...
'0',...
'0')
pdesetbd(4,...
'neu',...
1,...
'0',...
'0')
pdesetbd(3,...
'neu',...
1,...
'1E-6',...
'-1')
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',''));
setappdata(pde_fig,'MesherVersion','preR2013a');
pdetool('initmesh')
pdetool('refine')
% PDE coefficients:
pdeseteq(2,...
'1.0',...
'0.0',...
'1.0',...
'1.0',...
'0:100',...
'0.0',...
'0.0',...
'[0 100]')
setappdata(pde_fig,'currparam',...
['1.0';...
'1.0'])
% Solve parameters:
setappdata(pde_fig,'solveparam',...
char('0','2298','10','pdeadworst',...
'0.5','longest','0','1E-4','','fixed','Inf'))
% Plotflags and user data strings:
setappdata(pde_fig,'plotflags',[3 1 1 1 1 1 1 1 0 0 0 101 1 0 0 0 0 1]);
setappdata(pde_fig,'colstring','');
setappdata(pde_fig,'arrowstring','');
setappdata(pde_fig,'deformstring','');
setappdata(pde_fig,'heightstring','');
% Solve PDE:
pdetool('solve')
0 件のコメント
採用された回答
atharva
2023 年 10 月 18 日
Hey Bill,
I understand that you want to export a solution automatically when using the PDE toolbox.
Unfortunately, this feature is not available in MATLAB.
You can solve PDEs using command-line functions instead of the PDE app, and then all the information is in your workspace.
I hope this helps!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Geometry and Mesh についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!