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.57.2.2 2001/06/05 03:20:40 geraint +## added -ae option to select algebraic equation solution method. +## ## Revision 1.57.2.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. ## sys_ae.cc written for unsolved inputs. ## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). ## @@ -554,14 +557,14 @@ return f(0).${vector_value} (); #endif } inline ColumnVector -mtt_${ode} (ColumnVector &x, - ColumnVector &u, - const double &t, - ColumnVector &par) +mtt_rate (ColumnVector &x, + ColumnVector &u, + const double &t, + ColumnVector &par) { #ifdef STANDALONE return F${sys}_${ode} (x, u, t, par); #else static octave_value_list args, f; @@ -573,11 +576,11 @@ return f(0).${vector_value} (); #endif } inline ColumnVector -mtt_${odeo} (ColumnVector &x, +mtt_output (ColumnVector &x, ColumnVector &u, const double &t, ColumnVector &par) { #ifdef STANDALONE @@ -866,11 +869,11 @@ } for (register int j = 0, i = 1; i <= ilast; i++) { u = mtt_input (x, y, t, par); - y = mtt_${odeo} (x, u, t, par); + y = mtt_output (x, u, t, par); if (0 == j) { mtt_write (t, x, y, nrows); } EOF @@ -890,20 +893,20 @@ ColumnVector x1 (x), x2 (x), x3 (x); - k1 = ddt * mtt_${ode} (x , u, t , par); x1 += k1 * 0.5; - k2 = ddt * mtt_${ode} (x1, u, t1, par); x2 += k2 * 0.5; - k3 = ddt * mtt_${ode} (x2, u, t1, par); x3 += k3; - k4 = ddt * mtt_${ode} (x3, u, t2, par); + k1 = ddt * mtt_rate (x , u, t , par); x1 += k1 * 0.5; + k2 = ddt * mtt_rate (x1, u, t1, par); x2 += k2 * 0.5; + k3 = ddt * mtt_rate (x2, u, t1, par); x3 += k3; + k4 = ddt * mtt_rate (x3, u, t2, par); dx = (k1 + 2.0 * (k2 + k3) + k4) / (6.0 * ddt); } EOF else cat << EOF >> $filename - dx = mtt_${ode} (x, u, t, par); + dx = mtt_rate (x, u, t, par); EOF fi if [ "$method" = "implicit" ]; then cat <> $filename