0001
0002
0003 xa=-1;xb=1;
0004
0005
0006
0007 [uex,uexx,ff,nu,gam]=setfun_lap_1d;
0008
0009 nomefile=['out.dat'];
0010 cb='nd';
0011
0012 fid=fopen(nomefile,'w');
0013 fprintf(fid,'1D Laplace problem, SEM\n');
0014 fprintf(fid,'nx, ne e_inf e_l2 e_h1 \n');
0015 param=zeros(10,1);
0016
0017 nnx=4:4:24;
0018 for ne=10;
0019 for nx=nnx
0020 H=(xb-xa)/ne;
0021 param(1:6)=[1,1,nx*2,1,1,64];
0022 [xy,un,err_inf,err_l2,err_h1]=lap_1d(xa,xb,nu,gam,uex,uexx,ff,cb,ne,nx,param);
0023 noe=length(xy);
0024 fprintf('nx=%d, ne=%d, e_inf=%8.2e, e_l2=%8.2e, e_h1=%8.2e \n',...
0025 nx,ne,err_inf,err_l2,err_h1);
0026 fprintf(fid,'%d %d %8.2e %8.2e %8.2e \n',...
0027 nx, ne,err_inf,err_l2,err_h1);
0028 end
0029 end
0030 fclose(fid);
0031