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.18 1999/03/15 01:17:07 peterg +## Removed some spurious debugging code +## ## Revision 1.17 1999/03/15 01:09:15 peterg ## Fixed bugs when Nx=0 (no state) ## ## Revision 1.16 1999/03/06 02:28:38 peterg ## Rearranged evaluation to: state - input - output - write @@ -85,15 +88,15 @@ MTTilast = round(mttlast/mttdt); # Total number of steps #Initialise MTTt = 0.0; [MTTu] = zero_vector($Nu); # Zero the input -if $Nx>0 +#if $Nx>0 [MTTx] = $1_state; # Read in initial state -else - MTTx = 0; # Dummy value -endif; +#else +# MTTx = 0; # Dummy value +#endif; [MTTy] = $1_odeo(MTTx,MTTu,MTTt); # Evaluate initial output [MTTu] = $1_input(MTTt,MTTx,MTTy); # Evaluate initial input mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); # And write them @@ -109,11 +112,11 @@ endif; for MTTit = 1:MTTilast #Integration loop - if $Nx>0 # Don't if no states + if $Nx>0 # Dont if no states if mttmethod==1 # Euler for MTTjt = 1:mttstepfactor [MTTdx] = $1_ode(MTTx,MTTu,MTTt); # State derivative [MTTx] = mtt_euler(MTTx,MTTdx,MTTddt,$Nx); # Euler update [MTTx] = $1_switch(MTTx); # Switches @@ -120,14 +123,14 @@ MTTt = MTTt + MTTddt; endfor; endif; if mttmethod==2 # Implicit [MTTdx] = $1_ode(MTTx,MTTu,MTTt); # State derivative + [MTTdx] = $1_switch(MTTx); # Set derivs to zero if states to zero [mttAA,mttAAx] = $1_smx(MTTx,MTTu,mttdt); # (I-Adt) and (I-Adt)x [mttAA] = $1_switcha(mttAA,MTTx); # Switches [MTTx] = mtt_implicit(MTTx,MTTdx,mttAA,mttAAx,mttdt,$Nx); # Implicit update - [MTTx] = $1_switch(MTTx); # Switches MTTt = MTTt + mttdt; endif; else MTTt = MTTt + mttdt; endif; # $Nx>0