Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % 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
- % http://www.mathworks.com/help/pde/examples/index.html for examples
- % of this approach.
- function pdemodel
- [pde_fig,ax]=pdeinit;
- pdetool('appl_cb',9);
- set(ax,'DataAspectRatio',[1 1.4285714285714284 1.4285714285714284]);
- set(ax,'PlotBoxAspectRatio',[1 1 1]);
- set(ax,'XLim',[-0.80000000000000004 0.60000000000000009]);
- set(ax,'YLim',[-1 1]);
- set(ax,'XTickMode','auto');
- set(ax,'YTickMode','auto');
- % Geometry description:
- pderect([-0.31068917018284092 -0.0035161744022501606 -0.034722222222222543 -0.3773148148148151],'R1');
- set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1')
- % Boundary conditions:
- pdetool('changemode',0)
- pdesetbd(4,...
- 'dir',...
- 1,...
- '1',...
- '200')
- pdesetbd(3,...
- 'dir',...
- 1,...
- '1',...
- '200')
- pdesetbd(2,...
- 'dir',...
- 1,...
- '1',...
- '200')
- pdesetbd(1,...
- 'dir',...
- 1,...
- '1',...
- '200')
- % 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')
- % PDE coefficients:
- pdeseteq(2,...
- '401',...
- '1.0',...
- '(1.0)+(1.0).*(0.0)',...
- '(8.96).*(0.39)',...
- '0:0.01:5',...
- '0.0',...
- '0.0',...
- '[0 100]')
- setappdata(pde_fig,'currparam',...
- ['8.96';...
- '0.39';...
- '401 ';...
- '1.0 ';...
- '1.0 ';...
- '0.0 '])
- % Solve parameters:
- setappdata(pde_fig,'solveparam',...
- char('0','1000','10','pdeadworst',...
- '0.5','longest','0','1E-4','','fixed','Inf'))
- % Plotflags and user data strings:
- setappdata(pde_fig,'plotflags',[1 1 1 1 1 1 1 1 0 0 1 501 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')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement