MATLAB Answers

0

How can I solve the problem at first line? first line is marked by star/ please just run it & u will see the error./.m file is attached

Asked by mohammad zamehrian on 14 Jun 2018
Latest activity Answered by Walter Roberson
on 15 Jun 2018
function pdemodel   %****
[pde_fig,ax]=pdeinit;
pdetool('appl_cb',9);
set(ax,'DataAspectRatio',[1 1 1]);
set(ax,'PlotBoxAspectRatio',[1.5 1 1]);
set(ax,'XLim',[-1.5 1.5]);
set(ax,'YLim',[0 2]);
set(ax,'XTickMode','auto');
set(ax,'YTickMode','auto');
% Geometry description:
pderect([1 0 0 1],'R1');
pdeellip(0.5,1,0.5,0.29999999999999999,...
0,'E1');
set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1+E1')
% Boundary conditions:
pdetool('changemode',0)
pdesetbd(8,...
'dir',...
1,...
'1',...
'400')
pdesetbd(7,...
'dir',...
1,...
'1',...
'400')
pdesetbd(4,...
'dir',...
1,...
'1',...
'100')
pdesetbd(2,...
'dir',...
1,...
'1',...
'100')
pdesetbd(1,...
'dir',...
1,...
'1',...
'50')
% 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(1,...
'10',...
'10',...
'(0)+(10).*(25)',...
'(1.0).*(1.0)',...
'0:10',...
'0.0',...
'0.0',...
'[0 100]')
setappdata(pde_fig,'currparam',...
['1.0';...
'1.0';...
'10 ';...
'0  ';...
'10 ';...
'25 '])
% 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 1 0 1 1 0 1 0 0 1]);
setappdata(pde_fig,'colstring','');
setappdata(pde_fig,'arrowstring','');
setappdata(pde_fig,'deformstring','');
setappdata(pde_fig,'heightstring','');
% Solve PDE:
pdetool('solve')

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Walter Roberson
on 15 Jun 2018

You need to store that code in file pdemodel.m . Then it will work.

  0 Comments

Sign in to comment.