Index: mttroot/mtt/bin/trans/dm2fr_m ================================================================== --- mttroot/mtt/bin/trans/dm2fr_m +++ mttroot/mtt/bin/trans/dm2fr_m @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.10 1998/07/27 20:27:25 peterg +## Now get parameters for simpar file. +## ## Revision 1.9 1998/02/26 15:12:26 peterg ## Removed parameter stuff ## # Revision 1.8 1996/08/30 14:54:36 peter # Took back lock. @@ -75,23 +78,23 @@ [nx,ny,nu,nz,nyz] = $1_def %Defaults - if exist('mttWMIN')==0 - mttWMIN = -1; + if exist('mttwmin')==0 + mttwmin = -1; + end; + + if exist('mttwmax')==0 + mttwmax = 2; end; - if exist('mttWMAX')==0 - mttWMAX = 2; + if exist('mttwsteps')==0 + mttwsteps = 100; end; - if exist('mttWSTEPS')==0 - mttWSTEPS = 100; - end; - - W = logspace(mttWMIN,mttWMAX,mttWSTEPS)'; + W = logspace(mttwmin,mttwmax,mttwsteps)'; if exist('u0')==0 u0 = zeros(nu,1); u0(1) = 1; end; Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.7 1998/07/30 11:29:54 peterg +## Added implicit integration stuff +## ## Revision 1.6 1998/07/30 10:44:37 peterg ## INcluded othe integration methods. ## ## Revision 1.5 1998/07/26 11:02:20 peterg ## Put mtt or MTT in front of variable names to avoid clashes with @@ -47,42 +50,41 @@ # The rest of the program cat << EOF >> $1_ode2odes.m $1_simpar; # Read in simulation parameters $1_numpar; # Read in parameters - -MTTiLast = round(mttLAST/mttDT); # Total number of steps -mttDDT = mttDT/mttSTEPFACTOR; +MTTilast = round(mttlast/mttdt); # Total number of steps +mttddt = mttdt/mttstepfactor; #Initialise MTTt = 0.0; [MTTx] = $1_state; # Read in initial state [MTTu] = $1_input(MTTx,MTTt); # Evaluate initial input [MTTy] = $1_odeo(MTTx,MTTu,MTTt); # Evaluate initial output mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); # And write them [mttA] = zeros($Nx); # Zero the A matrix -if mttMETHOD==2 #Linear implicit +if mttmethod==2 #Linear implicit mttA = $1_smx(MTTx,MTTu); # Set up A matrix - linearised system end; #Integration loop -for MTTit = 1:MTTiLast - for MTTi = 1:mttSTEPFACTOR +for MTTit = 1:MTTilast + for MTTi = 1:mttstepfactor [MTTu] = $1_input(MTTx,MTTt);# Input [MTTx] = $1_switch(MTTx); # Switches [MTTdx] = $1_ode(MTTx,MTTu,MTTt); - if mttMETHOD==3 + if mttmethod==3 mttA = $1_smx(MTTx,MTTu); # Set up A matrix - linearised system end; - [MTTx] = mtt_update(MTTdx,MTTx,mttDDT,$Nx,mttMETHOD,mttA); + [MTTx] = mtt_update(MTTdx,MTTx,mttddt,$Nx,mttmethod,mttA); [MTTy] = $1_odeo(MTTx,MTTu,MTTt); - MTTt = MTTt + mttDDT; + MTTt = MTTt + mttddt; end; mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); end; EOF Index: mttroot/mtt/bin/trans/sm2sr_m ================================================================== --- mttroot/mtt/bin/trans/sm2sr_m +++ mttroot/mtt/bin/trans/sm2sr_m @@ -14,10 +14,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.15 1998/07/27 20:31:40 peterg +## New simpar version +## ## Revision 1.14 1998/07/25 10:00:48 peterg ## *** empty log message *** ## ## Revision 1.13 1997/06/13 12:52:18 peterg ## Removed extra ; from $PARAMS @@ -81,11 +84,11 @@ $1_simpar; [nx,ny,nu,nz,nyz] = $1_def; t=0; %Just in case it appears in the parameter list. - T=[0:mttDT:mttLAST]' + T=[0:mttdt:mttlast]' if exist('u0')==0 u0 = ones(nu,1); end; Index: mttroot/mtt/bin/trans/txt2m ================================================================== --- mttroot/mtt/bin/trans/txt2m +++ mttroot/mtt/bin/trans/txt2m @@ -13,10 +13,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.9 1998/07/30 15:07:17 peterg +# %% Added _ to the disallowed chars around t +# %% # %% Revision 1.8 1998/07/30 12:52:38 peterg # %% Adds ; to end of statements # %% Translates ' to " before removal # %% # %% Revision 1.7 1998/07/30 09:32:33 peterg @@ -88,17 +91,28 @@ } { N=split($1,a,"="); if (N==2) { LHS = a[1]; - RHS = tolower(a[2]); + RHS = a[2]; gsub(quote, doublequote, RHS); + sub(/^LAST/, "mttLAST", LHS); + sub(/^DT/, "mttDT", LHS); + sub(/^STEPFACTOR/, "mttSTEPFACTOR", LHS); + sub(/^METHOD/, "mttMETHOD", LHS); + sub(/^WMIN/, "mttWMIN", LHS); + sub(/^WMAX/, "mttWMAX", LHS); + sub(/^WSTEPS/, "mttWSTEPS", LHS); + LHS = tolower(LHS); + RHS = tolower(RHS); sub(/["]*euler["]*/, 1, RHS); sub(/["]*implicitl["]*/, 2, RHS); sub(/["]*implicit["]*/, 3, RHS); - statement = sprintf("%s=%s",LHS,RHS); - if (match(statement,";")==0) + statement = sprintf("%s= %s",LHS,RHS); + if ( (match(statement,";")==0)&&\ + ((match(statement,"if ")==0))&&\ + ((match(statement,"for ")==0)) ) statement = sprintf("%s;", statement); } else statement = $1; @@ -105,20 +119,13 @@ if (NF<2) print statement if (NF>1) print statement " # " $2 }' | sed\ -e 's/\[\([0-9]*\)\]/(\1)/g' \ -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \ - -e 's/LAST/mttLAST/g' \ - -e 's/DT/mttDT/g' \ - -e 's/STEPFACTOR/mttSTEPFACTOR/g' \ - -e 's/METHOD/mttMETHOD/g' \ - -e 's/WMIN/mttWMIN/g' \ - -e 's/WMAX/mttWMAX/g' \ - -e 's/WSTEPS/mttWSTEPS/g' \ -e 's/x(/mttx(/g' \ -e 's/u(/mttu(/g' \ -e 's/mttmtt/mtt/g' \ >> $1_$2.m