Index: mttroot/mtt/bin/trans/dae2daes_m ================================================================== --- mttroot/mtt/bin/trans/dae2daes_m +++ mttroot/mtt/bin/trans/dae2daes_m @@ -13,18 +13,25 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 1996/08/16 13:17:57 peter +## Changed default args to include nx+nz +## Fixed bug with vector outputs. +## ## Revision 1.1 1996/08/15 16:24:55 peter ## Initial revision ## ############################################################### -echo Creating $1_daesol.m -rm -f dae2daesol_m.log +echo Creating $1_daes.m +echo Creating $1_daeso.m +rm -f dae2daes_m.log +rm -f $1_daes.m +rm -f $1_daeso.m if [ "$2" = "" ]; then PARAMS='T=[0:0.1:10];x0=zeros(nx+nz,1);dx0=zeros(nx+nz,1);' echo Using default parameter $PARAMS @@ -33,11 +40,11 @@ fi PARAMS="$PARAMS ;" -$MATRIX << EOF > dae2daesol_m.log +$MATRIX << EOF > dae2daes_m.log [nx,ny,nu,nz,nyz] = $1_def; t=0; %Just in case its in the parameter list $PARAMS @@ -57,22 +64,30 @@ [n,m]=size(T); if m>n T=T'; end; -x = dassl('$1_dae', x0, dx0, T); + +if nx>0 + x = dassl('$1_dae', x0, dx0, T); + write_matrix([T,x], '$1_daes'); +else + x = zeros(size(T)); +end; -i=0; -for tt=T' - i=i+1; - y(i,:) = $1_daeo(x(i,:),tt)'; +if ny>0 + i=0; + for tt=T' + i=i+1; + y(i,:) = $1_daeo(x(i,:),tt)'; + end; + write_matrix([T,y], '$1_daeso'); end; -write_matrix([T,y], '$1_daesol'); EOF