Home > Src > Hyperbolic_1d > call_hyp.m

call_hyp

PURPOSE ^

CALL_HYP. Script to set input data and call scalar_hyp and stag_scalar_hyp

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 CALL_HYP. Script to set input data and call  scalar_hyp and stag_scalar_hyp

 to set input data: help scalar_hyp, help stag_scalar_hyp
 these data are useful to reproduce figure 3.5, pag. 150 CHQZ2.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CALL_HYP. Script to set input data and call  scalar_hyp and stag_scalar_hyp
0002 %
0003 % to set input data: help scalar_hyp, help stag_scalar_hyp
0004 % these data are useful to reproduce figure 3.5, pag. 150 CHQZ2.
0005 %
0006 
0007 %   Written by Paola Gervasio
0008 %   $Date: 2007/04/01$
0009 
0010 
0011 xa=-1;xb=2;
0012 beta=1.5;
0013 param(1)=1; param(2)=0.75;
0014 t0=0;T=1.d-3;
0015 deltat=1.d-4;
0016 %
0017 %  set functions
0018 %
0019 uex=@(x,t)[sin(2*x-3*t)];
0020 u0=@(x)[sin(2*x)]; ul=@(t)[sin(-2-3*t)];
0021 
0022 fid=fopen('errorit4','w');
0023 
0024 % strong, penalty and GNI
0025 for method=1:0
0026 param(1)=method;
0027 for nx=8:2:20;
0028 
0029 
0030 [x,u,err,Psi,Phi]=scalar_hyp(xa,xb,t0,T,beta,uex,u0,ul,nx,deltat,param);
0031 fprintf('method=%d, nx=%d, err=%13.6e\n',method,nx,err);
0032 fprintf(fid,'method=%d, nx=%d, err=%13.6e\n',method,nx,err);
0033 end
0034 end
0035 
0036 % staggered grids
0037 method=4;
0038 for nx=8:2:20;
0039 
0040 [x,u,err,Psi,Phi]=stag_scalar_hyp(xa,xb,t0,T,beta,uex,u0,ul,nx,deltat);
0041 fprintf('method=%d, nx=%d, err=%13.6e\n',method,nx,err);
0042 fprintf(fid,'method=%d, nx=%d, err=%13.6e\n',method,nx,err);
0043 end
0044 fclose(fid);

Generated on Fri 21-Sep-2007 10:07:00 by m2html © 2003