Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.5 1998/07/26 11:02:20 peterg +## Put mtt or MTT in front of variable names to avoid clashes with +## globals +## ## Revision 1.4 1998/07/25 20:14:00 peterg ## update code added for flexibility and octave efficiency ## ############################################################### @@ -17,10 +21,13 @@ # Bourne shell script: make_ode2odes # Copyright (c) P.J.Gawthrop July 1998. +# Tell user +echo Creating $1_ode2odes.m + Sys=$1 # Find system constants Nx=`grep "MTTNx " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'` Nu=`grep "MTTNu " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'` @@ -47,18 +54,25 @@ 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 = $1_smx(MTTx,MTTu); # Set up A matrix - linearised system + #Integration loop 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); - [MTTx] = mtt_update(MTTdx,MTTx,mttDDT,$Nx,mttMETHOD); + if mttMETHOD==3 + mttA = $1_smx(MTTx,MTTu); # Set up A matrix - linearised system + end; + [MTTx] = mtt_update(MTTdx,MTTx,mttDDT,$Nx,mttMETHOD,mttA); [MTTy] = $1_odeo(MTTx,MTTu,MTTt); MTTt = MTTt + mttDDT; end; mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); end;