Advertisement
szymcio93

townini12.1

Jan 13th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. % This script is written and read by pdetool and should NOT be edited.
  2. % There are two recommended alternatives:
  3. % 1) Export the required variables from pdetool and create a MATLAB script
  4. % to perform operations on these.
  5. % 2) Define the problem completely using a MATLAB script. See
  6. % http://www.mathworks.com/help/pde/examples/index.html for examples
  7. % of this approach.
  8. function pdemodel
  9. [pde_fig,ax]=pdeinit;
  10. pdetool('appl_cb',9);
  11. set(ax,'DataAspectRatio',[1 1.4285714285714284 1.4285714285714284]);
  12. set(ax,'PlotBoxAspectRatio',[1 1 1]);
  13. set(ax,'XLim',[-0.80000000000000004 0.60000000000000009]);
  14. set(ax,'YLim',[-1 1]);
  15. set(ax,'XTickMode','auto');
  16. set(ax,'YTickMode','auto');
  17.  
  18. % Geometry description:
  19. pderect([-0.31068917018284092 -0.0035161744022501606 -0.034722222222222543 -0.3773148148148151],'R1');
  20. set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1')
  21.  
  22. % Boundary conditions:
  23. pdetool('changemode',0)
  24. pdesetbd(4,...
  25. 'dir',...
  26. 1,...
  27. '1',...
  28. '200')
  29. pdesetbd(3,...
  30. 'dir',...
  31. 1,...
  32. '1',...
  33. '200')
  34. pdesetbd(2,...
  35. 'dir',...
  36. 1,...
  37. '1',...
  38. '200')
  39. pdesetbd(1,...
  40. 'dir',...
  41. 1,...
  42. '1',...
  43. '200')
  44.  
  45. % Mesh generation:
  46. setappdata(pde_fig,'Hgrad',1.3);
  47. setappdata(pde_fig,'refinemethod','regular');
  48. setappdata(pde_fig,'jiggle',char('on','mean',''));
  49. setappdata(pde_fig,'MesherVersion','preR2013a');
  50. pdetool('initmesh')
  51.  
  52. % PDE coefficients:
  53. pdeseteq(2,...
  54. '401',...
  55. '1.0',...
  56. '(1.0)+(1.0).*(0.0)',...
  57. '(8.96).*(0.39)',...
  58. '0:0.01:5',...
  59. '0.0',...
  60. '0.0',...
  61. '[0 100]')
  62. setappdata(pde_fig,'currparam',...
  63. ['8.96';...
  64. '0.39';...
  65. '401 ';...
  66. '1.0 ';...
  67. '1.0 ';...
  68. '0.0 '])
  69.  
  70. % Solve parameters:
  71. setappdata(pde_fig,'solveparam',...
  72. char('0','1000','10','pdeadworst',...
  73. '0.5','longest','0','1E-4','','fixed','Inf'))
  74.  
  75. % Plotflags and user data strings:
  76. setappdata(pde_fig,'plotflags',[1 1 1 1 1 1 1 1 0 0 1 501 1 0 0 0 0 1]);
  77. setappdata(pde_fig,'colstring','');
  78. setappdata(pde_fig,'arrowstring','');
  79. setappdata(pde_fig,'deformstring','');
  80. setappdata(pde_fig,'heightstring','');
  81.  
  82. % Solve PDE:
  83. pdetool('solve')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement