Index: mttroot/mtt/bin/trans/ode2odes_m ================================================================== --- mttroot/mtt/bin/trans/ode2odes_m +++ mttroot/mtt/bin/trans/ode2odes_m @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.8 1996/09/13 17:54:08 peter +## Now writes default $PARAMS to $1_args.m - $1_ode may use it. +## ## Revision 1.7 1996/09/12 18:41:48 peter ## Standard error handling added. ## ## Revision 1.6 1996/08/24 14:11:04 peter ## Global parameter passing. @@ -51,11 +54,11 @@ fi PARAMS="$PARAMS ;" -$MATRIX << EOF > ode2odes_m.log 2>mtt_error +$MATRIX << EOF > ode2odes_m.log 2>mtt_error.txt %Read in parameters $1_numpar; [nx,ny,nu,nz,nyz] = $1_def; @@ -76,21 +79,31 @@ if m>n T=T'; end; if nx>0 - x = lsode('$1_ode', x0, T); - write_matrix([T,x], '$1_odes'); +% x = lsode('$1_ode', x0, T); +%Euler integration + x = x0; + X=[]; + dt = T(2)-T(1); + for t=T' + X = [X x]; + dx = $1_ode(x,t); + x = x + dx*dt; + end; + X = X'; + write_matrix([T,X], '$1_odes'); else - x = zeros(size(T)); + X = zeros(size(T)); end; if ny>0 i=0; for tt=T' i=i+1; - y(i,:) = $1_odeo(x(i,:),tt)'; + y(i,:) = $1_odeo(X(i,:),tt)'; end; write_matrix([T,y], '$1_odeso'); end; EOF