Index: mttroot/mtt/bin/mttrc ================================================================== --- mttroot/mtt/bin/mttrc +++ mttroot/mtt/bin/mttrc @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.18 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## ## Revision 1.17.2.4 2001/03/06 03:48:43 geraint ## Print additional environment variable for "mtt -p". ## MTT_LDFLAGS defaults to " " to avoid installation warning. ## ## Revision 1.17.2.3 2001/03/01 05:05:53 geraint @@ -155,11 +158,12 @@ # ode2odes.exe stuff # local system PLAT="i686-pc-linux-gnu" - PREFIX="/usr/local" +# PREFIX="/usr/local" + PREFIX="/usr" GCCVERS="2.95.2" SRCOCTAVE="/cvs/octave" # PLAT="mips-sgi-irix6.5" # PREFIX="/usr/people/bevangp/GNU" @@ -170,10 +174,11 @@ IOCTAVE="-I${PREFIX}/include/octave" # library paths +# LOCTAVE="-L${PREFIX}/lib/octave -loctave -lcruft -loctinterp" LOCTAVE="-L${PREFIX}/lib/octave -loctave -lcruft -loctinterp" LKPATHSEA="-L${SRCOCTAVE}/kpathsea -lkpathsea" LREADLINE=" -L${SRCOCTAVE}/readline -lreadline" LSYSTEM="-ldl -lm -lncurses" LF2C="-L${PREFIX}/lib/gcc-lib/${PLAT}/${GCCVERS} -lg2c" Index: mttroot/mtt/bin/trans/m/mtt_write.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_write.m +++ mttroot/mtt/bin/trans/m/mtt_write.m @@ -3,10 +3,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.4 1999/03/15 23:05:29 peterg +## A complete rewrite - now puts into a Global matrix MTT_data +## ## Revision 1.3 1999/03/15 21:57:00 peterg ## Removed the # symbol ## ############################################################### @@ -13,22 +16,8 @@ global MTT_data if t==0.0 MTT_data=[]; endif -MTT_data = [MTT_data; t,y',t,x']; - - - -# printf("%e ", t); -# for i=1:ny -# printf("%e ", y(i)); -# endfor - -# printf("%e ", t); -# for i=1:nx -# printf("%e ", x(i)); -# endfor -# printf("\n"); - + MTT_data = [MTT_data; t,y',t,x']; endfunction 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.55 2001/03/27 13:21:59 geraint +## Octave version compatibility for save_ascii_data(_for_plotting). +## ## Revision 1.54 2001/03/27 01:14:27 geraint ## Improved determination of Octave version. ## ## Revision 1.53 2001/03/21 03:24:59 geraint ## Calculate inputs before outputs (.cc). @@ -247,18 +250,19 @@ if nargin<2 par = ${sys}_numpar(); [par] = mtt_numpar_update(par); endif if nargin<1 - [x] = ${sys}_state(par); - [x] = mtt_state_update(x); + [x0] = ${sys}_state(par); + [x0] = mtt_state_update(x); endif ## Initialise t = 0.0; ddt = simpar.dt/simpar.stepfactor; ilast = round(simpar.last/ddt)+1; # Total number of steps + x = x0; ## Following removed due to p2c bug ## [u] = zero_input($Nu); # Zero the input for MTTi=1:$Ny y(MTTi) = 0; @@ -305,14 +309,12 @@ mttj = 0; # Reset counter endif endfor; # Integration loop - t = MTT_data(:,1); - Y = MTT_data(:,2); - X = MTT_data(:,4); - +## Create the output data + mtt_data = MTT_data; endfunction EOF } # make_m @@ -734,16 +736,16 @@ int main (void) { set_signal_handlers (); #else DEFUN_DLD (${sys}_ode2odes, args, , "Octave ode2odes representation of system with $method integration method -Usage: ${sys}_ode2odes (x, par, simpar) +Usage: mtt_data = ${sys}_ode2odes (x0, par, simpar) ") { static octave_value_list retval; #endif // STANDALONE - static ColumnVector x; + static ColumnVector x0; static ColumnVector par; static Octave_map simpar; static double first = 0.0, @@ -758,44 +760,45 @@ first = args (2).map_value ()["first"].double_value (); dt = args (2).map_value ()["dt"].double_value (); last = args (2).map_value ()["last"].double_value (); stepfactor = args (2).map_value ()["stepfactor"].double_value (); par = args (1).${vector_value} (); - x = args (0).${vector_value} (); + x0 = args (0).${vector_value} (); break; case 2: first = mtt_simpar ()["first"].double_value (); dt = mtt_simpar ()["dt"].double_value (); last = mtt_simpar ()["last"].double_value (); stepfactor = mtt_simpar ()["stepfactor"].double_value (); par = args (1).${vector_value} (); - x = args (0).${vector_value} (); + x0 = args (0).${vector_value} (); break; case 1: first = mtt_simpar ()["first"].double_value (); dt = mtt_simpar ()["dt"].double_value (); last = mtt_simpar ()["last"].double_value (); stepfactor = mtt_simpar ()["stepfactor"].double_value (); par = mtt_numpar (); - x = args (0).${vector_value} (); + x0 = args (0).${vector_value} (); break; case 0: #endif // ! STANDALONE first = mtt_simpar ()["first"].double_value (); dt = mtt_simpar ()["dt"].double_value (); last = mtt_simpar ()["last"].double_value (); stepfactor = mtt_simpar ()["stepfactor"].double_value (); par = mtt_numpar (); - x = mtt_state (par); + x0 = mtt_state (par); #ifndef STANDALONE break; default: usage("${sys}_ode2odes (x par simpar)", nargin); error("aborting."); } #endif // STANDALONE static ColumnVector dx (MTTNX); + static ColumnVector x (MTTNX); static ColumnVector u (MTTNU); static ColumnVector y (MTTNY); static Matrix AA (MTTNX, MTTNX); static ColumnVector AAx (MTTNX); @@ -810,10 +813,15 @@ for (register int i = 0; i < MTTNY; i++) { y (i) = 0.0; } + + for (register int i = 0; i < MTTNX; i++) + { + x (i) = x0 (i); + } for (register int j = 0, i = 1; i <= ilast; i++) { u = mtt_input (x, y, t, par); y = mtt_${odeo} (x, u, t, par); @@ -871,13 +879,16 @@ } #ifdef STANDALONE return 0; #else +/* retval (0) = octave_value (y); retval (1) = octave_value (x); retval (2) = octave_value (t); +*/ + retval = octave_value (get_global_value ("MTT_data")); return (retval); #endif // STANDALONE } EOF } Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.29 2001/03/27 13:10:23 geraint +## Improved determination of Octave version. +## ## Revision 1.28 2001/02/17 03:48:17 geraint ## Use assignment LHS to gather tmp variable names. ## Prevents collection of long expressions, eg: tmp34*(tmp75 ## ## Revision 1.27 2001/02/14 06:06:34 geraint @@ -223,12 +226,12 @@ ;; ode2odes) states=no; inputs=no; parameters=no; - output='y,x,t' - args='x,par,simpar' + output='mtt_data' + args='x0,par,simpar' ;; simpar) states=no; inputs=no; parameters=no; Index: mttroot/mtt/bin/trans/mtt_m2p ================================================================== --- mttroot/mtt/bin/trans/mtt_m2p +++ mttroot/mtt/bin/trans/mtt_m2p @@ -13,10 +13,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.65 2001/02/09 02:56:46 geraint +## Translate some binary operators +## Allows use of ! in logic.txt +## ## Revision 1.64 2001/02/03 14:00:01 gawthrop ## Geraint's temp. variable patch applied ## ## Revision 1.63 2000/12/04 08:24:29 peterg ## Added swithc logic declarations @@ -358,11 +362,11 @@ ## echo " IntegrationMethod = 1..4;" echo "" echo "VAR" echo " simpar : SimulationParameters;" echo " t,ddt : REAL;" - echo " x,dx,AAx : StateVector;" + echo " x,x0,dx,AAx : StateVector;" echo " mttx,mttdx,mttAAx,mttedx : StateVector;" echo " u,mttu : InputVector;" echo " y,mtty : OutputVector;" echo " par : ParameterVector;" echo " mttpar : ParameterVector;" Index: mttroot/mtt/bin/trans/octave_ode2odes ================================================================== --- mttroot/mtt/bin/trans/octave_ode2odes +++ mttroot/mtt/bin/trans/octave_ode2odes @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 2000/05/19 17:47:56 peterg +## Agument to state +## ## Revision 1.2 2000/05/11 13:43:14 peterg ## No change ## ## Revision 1.1 1999/03/15 23:27:16 peterg ## Initial revision @@ -22,20 +25,18 @@ ############################################################### echo Creating $1_odes.dat2 $MATRIX <octave_ode2odes.log 2>mtt_error.txt - global MTT_data - ## Set up the simulation parameters par = $1_numpar; x_0 = $1_state(par); simpar = $1_simpar; - $1_ode2odes(x_0,par,simpar); - if is_complex(MTT_data) + mtt_data = $1_ode2odes(x_0,par,simpar); + if is_complex(mtt_data) mtt_error("octave_ode2odes: Simulated data is complex - something is wrong!"); - MTT_data = real(MTT_data); + mtt_data = real(mtt_data); endif; - save -ascii $1_odes.dat2 MTT_data + save -ascii $1_odes.dat2 mtt_data EOF mtt_error mtt_error.txt Index: mttroot/mtt/bin/trans/rbg2abg_m ================================================================== --- mttroot/mtt/bin/trans/rbg2abg_m +++ mttroot/mtt/bin/trans/rbg2abg_m @@ -9,10 +9,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.17 2000/12/05 12:04:03 peterg +## Changed function name to name() +## ## Revision 1.16 2000/12/05 09:04:08 peterg ## Fixed function () compatibility problem. ## ## Revision 1.15 2000/11/03 14:53:33 peterg ## Copy NOTPAR as well @@ -223,11 +226,5 @@ then exit 0 else exit 1 fi - - - - - -