Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -1,16 +1,21 @@ #! /bin/sh ###################################### ##### Model Transformation Tools ##### - ###################################### + ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.19 1999/03/30 21:39:25 peterg +## In implicit approach, set derivatives to zero (when switch is off) +## before update. This seems to stop numerical leakage though non-return +## switches. +## ## 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) @@ -123,11 +128,11 @@ 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 + #[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 MTTt = MTTt + mttdt; endif;