Overview
Comment: | Generates method-specific code. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
24bf9aa64e19ce82b1c5b6ce3bf09fc9 |
User & Date: | gawthrop@users.sourceforge.net on 1999-11-15 22:47:53 |
Other Links: | branch diff | manifest | tags |
Context
1999-11-15
| ||
22:57:20 | Removed a debugging line check-in: 84b1729332 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
22:47:53 | Generates method-specific code. check-in: 24bf9aa64e user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
22:47:17 | Generates method-specific code for the ode2odeso rep. check-in: c5eae5f60d user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/make_ode2odes from [4e22764816] to [e19d7b27d5].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.25 1999/08/29 06:55:26 peterg ## Removed [MTTu] = zero_input($Nu); # Zero the input ## to avoide the p2c bug ???? ## ## Revision 1.24 1999/08/27 06:02:16 peterg ## removed zero_input to avoid p2c bug ## | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.26 1999/10/20 01:31:43 peterg ## *** empty log message *** ## ## Revision 1.25 1999/08/29 06:55:26 peterg ## Removed [MTTu] = zero_input($Nu); # Zero the input ## to avoide the p2c bug ???? ## ## Revision 1.24 1999/08/27 06:02:16 peterg ## removed zero_input to avoid p2c bug ## |
︙ | ︙ | |||
84 85 86 87 88 89 90 | # Bourne shell script: make_ode2odes # Copyright (c) P.J.Gawthrop July 1998. # Tell user | > > | > > > | > > > | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | # Bourne shell script: make_ode2odes # Copyright (c) P.J.Gawthrop July 1998. # Tell user Sys=$1 method=$2 echo "Creating $1_ode2odes.m with $method integration method" if [ $method = "implicit" ]; then ode=cse odeo=cseo else ode=ode odeo=odeo fi # Find system constants Nx=`grep "MTTNx " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'` Nu=`grep "MTTNu " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'` Ny=`grep "MTTNy " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'` |
︙ | ︙ | |||
115 116 117 118 119 120 121 | MTTt = 0.0; [MTTu] = zero_input($Nu); # Zero the input [MTTx] = $1_state; # Read in initial state | | > | > > | > | > > > > > | | | > > > > > | | | > > | > > | | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | MTTt = 0.0; [MTTu] = zero_input($Nu); # Zero the input [MTTx] = $1_state; # Read in initial state [MTTy] = $1_$odeo(MTTx,MTTu,MTTt); # Evaluate initial output [MTTu] = $1_input(MTTt,MTTx,MTTy); # Evaluate initial input mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); # And write them #[mttAA] = zero_matrix($Nx); # Zero the A matrix #[mttAAx] = zero_vector($Nx); # Zero the AAx vector #if $Nx>0 # [MTTx] = $1_switch(MTTx); # Switches #endif; EOF if [ "$method" = "euler" ]; then cat << EOF >> $1_ode2odes.m MTTddt = mttdt/mttstepfactor; # The small sample interval EOF fi cat << EOF >> $1_ode2odes.m for MTTit = 1:MTTilast #Integration loop if $Nx>0 # Dont if no states EOF if [ "$method" = "euler" ]; then cat << EOF >> $1_ode2odes.m # if mttmethod==1 # Euler for MTTjt = 1:mttstepfactor [MTTdx] = $1_$ode(MTTx,MTTu,MTTt); # State derivative [MTTopen] = $1_switchopen(MTTx); # Open switches [MTTx] = mtt_euler(MTTx,MTTdx,MTTddt,$Nx,MTTopen); # Euler update MTTt = MTTt + MTTddt; endfor; # endif; EOF fi if [ "$method" = "implicit" ]; then cat << EOF >> $1_ode2odes.m # if mttmethod==2 # Implicit [MTTdx] = $1_cse(MTTx,MTTu,MTTt); # State derivative [mttAA,mttAAx] = $1_smx(MTTx,MTTu,mttdt); # (I-Adt) and (I-Adt)x [MTTopen] = $1_switchopen(MTTx); # Open switches [MTTx] = mtt_implicit(MTTx,MTTdx,mttAA,mttAAx,mttdt,$Nx,MTTopen); # Implicit update MTTt = MTTt + mttdt; # endif; EOF fi cat << EOF >> $1_ode2odes.m else # NX is 0 - no states MTTt = MTTt + mttdt; endif; # $Nx>0 [MTTy] = $1_$odeo(MTTx,MTTu,MTTt); # Output [MTTu] = $1_input(MTTt,MTTx,MTTy); # Input mtt_write(MTTt,MTTx,MTTy,$Nx,$Ny); # Write it out endfor; # Integration loop EOF |