Index: mttroot/mtt/bin/trans/ode2odes_m ================================================================== --- mttroot/mtt/bin/trans/ode2odes_m +++ mttroot/mtt/bin/trans/ode2odes_m @@ -13,18 +13,21 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 1996/08/15 11:56:38 peter +## Initial revision +## ############################################################### echo Creating $1_odesol.m rm -f ode2odesol_m.log if [ "$2" = "" ]; then - PARAMS='t=[0:0.1:10]; x0=zeros(6,1);' + PARAMS='T=[0:0.1:10]; x0=zeros(10,1);u=1' echo Using default parameter $PARAMS else PARAMS=$2; fi @@ -32,43 +35,40 @@ $MATRIX << EOF > ode2odesol_m.log [nx,ny,nu,nz,nyz] = $1_def; + t=0; %Just in case it appears in the parameter list. + $PARAMS %Defaults - if exist('t')==0 - t=[0:0.1:10] - end; - - if exist('u0')==0 - u0 = ones(nu,1); + if exist('T')==0 + T=[0:0.1:10] end; if exist('x0')==0 x0 = zeros(nx,1); end; - [n,m]=size(t); + [n,m]=size(T); if m>n - t=t'; + T=T'; end; -x = lsode('$1_ode', x0, t); +x = lsode('$1_ode', x0, T); i=0; -for tt=t' +for tt=T' i=i+1; - y(i) = $1_odeo(x(i,:),t); + y(i) = $1_odeo(x(i,:),tt); end; - -write_matrix([t,y], '$1_odesol'); +write_matrix([T,y], '$1_odesol'); EOF Index: mttroot/mtt/bin/trans/sm2sr_m ================================================================== --- mttroot/mtt/bin/trans/sm2sr_m +++ mttroot/mtt/bin/trans/sm2sr_m @@ -14,10 +14,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.7 1996/08/15 11:54:32 peter +## Now has optional initial condition. +## ## Revision 1.6 1996/08/14 09:15:02 peter ## Now encapsulates the data into an m file ## Name changed ## ## Revision 1.5 1996/08/12 20:19:06 peter @@ -40,11 +43,11 @@ echo Creating $1_sr.m rm -f dm2sr_m.log if [ "$2" = "" ]; then - PARAMS='t=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);' + PARAMS='T=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);' echo Using default parameter $PARAMS else PARAMS=$2; fi @@ -51,15 +54,17 @@ PARAMS="$PARAMS ;" $MATRIX << EOF > dm2sr_m.log [nx,ny,nu,nz,nyz] = $1_def; + t=0; %Just in case it appears in the parameter list. + $PARAMS %Defaults - if exist('t')==0 - t=[0:0.1:10] + if exist('T')==0 + T=[0:0.1:10] end; if exist('u0')==0 u0 = ones(nu,1); end; @@ -67,17 +72,17 @@ if exist('x0')==0 x0 = zeros(nx,1); end; - [n,m]=size(t); + [n,m]=size(T); if m>n - t=t'; + T=T'; end; [A,B,C,D,E] = $1_dm($1_numpar); - y = dm2sr(A,B,C,D,E,t,u0,x0); + y = dm2sr(A,B,C,D,E,T,u0,x0); - write_matrix([t y], '$1_sr'); + write_matrix([T y], '$1_sr'); EOF