Overview
Comment: | added -ae option to select algebraic equation solution method. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/numerical-algebraic-solution | trunk |
Files: | files | file ages | folders |
SHA3-256: |
97ad53b7470e78ba1a03e4c247d51a64 |
User & Date: | geraint@users.sourceforge.net on 2001-06-05 03:20:40 |
Other Links: | branch diff | manifest | tags |
Context
2001-06-05
| ||
03:37:15 | *** empty log message *** check-in: 4c82a03e36 user: geraint@users.sourceforge.net tags: origin/numerical-algebraic-solution, trunk | |
03:20:40 | added -ae option to select algebraic equation solution method. check-in: 97ad53b747 user: geraint@users.sourceforge.net tags: origin/numerical-algebraic-solution, trunk | |
2001-05-09
| ||
00:19:22 | Fixed EOF error when MTTNYZ=0. check-in: 414839b0b6 user: geraint@users.sourceforge.net tags: origin/numerical-algebraic-solution, trunk | |
Changes
Modified mttroot/mtt/bin/mtt from [6ea445f6e4] to [af07966fc8].
︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + + + + + | # Copyright (C) 2001 by Peter J. Gawthrop ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ ## Revision 1.309.2.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. ## sys_ae.cc written for unsolved inputs. ## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). ## ## Revision 1.309 2001/04/28 03:15:03 geraint ## Fixed comment (interfered with "mtt help representations"). ## ## Revision 1.308 2001/04/25 22:17:45 geraint ## Fixed icd.txt2 dependency. ## ## Revision 1.307 2001/04/15 21:15:41 geraint |
︙ | |||
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 | 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | + + + | # Default not verbose verbose=' -s' # Default integration method integration_method=implicit; # Default algebraic equation solver algebraic_solver=Reduce_Solver; # Default no info info_switch='' # Default use m, not oct files m='m'; # Default use ps files |
︙ | |||
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 | + + + + + + + + + + + + + + + + + + + + + + + | integration_method=rk4; mtt_switches="$mtt_switches rk4"; ;; *) echo $1 is an unknown integration method - use euler, rk4 or implicit; exit;; esac;; -ae ) mtt_switches="$mtt_switches $1"; case $2 in fsolve | hybrd) mtt_switches="$mtt_switches $2"; algebraic_solver=Hybrd_Solver; shift; ;; hooke) mtt_switches="$mtt_switches $2"; algebraic_solver=HJ_Solver; shift; ;; reduce) mtt_switches="$mtt_switches $2"; algebraic_solver=Reduce_Solver; Solve='-A'; shift; ;; *) echo $1 is an unknown solver - use hybrd, hooke or reduce; exit;; esac;; -s ) mtt_switches="$mtt_switches $1"; sensitivity=sensitivity ;; -ss ) mtt_switches="$mtt_switches $1"; steadystate_computation=yes ;; -d ) |
︙ | |||
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 | 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 | + | echo ' -I prints more information' echo ' -abg start at abg.m representation' echo ' -c c-code generation' echo ' -d <dir> use directory <dir>' echo ' -dc Maximise derivative (not integral) causality' echo ' -dc Maximise derivative (not integral) causality' echo ' -i <implicit|euler|rk4> Use implicit, euler or rk4 integration' echo ' -ae <reduce|hybrd|hooke> Solve algebraic equations with Reduce, hybrd (fsolve) or "Hooke and Jeeves"' echo ' -o ode is same as dae' echo ' -oct use oct files in place of m files where appropriate' echo ' -opt optimise code generation' echo ' -p print environment variables' echo ' -partition partition hierachical system' echo ' -pdf generate pdf in place of ps' echo ' -r reset time stamp on representation' |
︙ | |||
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 | 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 | + + + | .PRECIOUS: %.cc # Don't let mtt delete them $1_%.cc: $1_%.m mtt_m2cc.sh $1 \$* cat mtt_%.cc: ${MTT_LIB}/cc/mtt_%.cc cp ${MTT_LIB}/cc/mtt_\$*.cc mtt_\$*.cc mtt_%.hh: ${MTT_LIB}/cc/mtt_%.hh cp ${MTT_LIB}/cc/mtt_\$*.hh mtt_\$*.hh ## .o files .PRECIOUS: $1_%.o $1_%.o: $1_%.cc $1_def.h $1_sympar.h $1_cr.h echo Compiling $1_\$*.cc ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DSTANDALONE .PRECIOUS: mtt_%.o |
︙ | |||
2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 | 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 | + + + + + | @echo > /dev/null $1_ode2odes_implicit.o : $1_cseo.o $1_csex.o $1_smxa.o $1_smxax.o mtt_implicit.o @echo "Creating $1_ode2odes_implicit.o" ar -cr \$@ \$^ $1_ode2odes_implicit.oct: $1_cseo.oct $1_csex.oct $1_smxa.oct $1_smxax.oct mtt_implicit.oct @echo > /dev/null mtt_Solver.cc: mtt_Solver.hh $1_ode2odes_${algebraic_solver}.cc: mtt_Solver.cc mtt_${algebraic_solver}.hh mtt_${algebraic_solver}.cc $1_ode2odes_${algebraic_solver}.o: mtt_Solver.o mtt_${algebraic_solver}.o @echo "Creating $1_ode2odes_${algebraic_solver}.o" ar -cr \$@ \$^ #SUMMARY numpar numerical parameter declaration (m) $1_numpar.m: $1_numpar.txt $1_sympars.txt mtt_txt2m $1 numpar #SUMMARY numpar numerical parameter declaration (c) #SUMMARY numpar numerical parameter declaration (view) |
︙ | |||
2527 2528 2529 2530 2531 2532 2533 | 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 | - + - + - + - + - + - + - + | $1_smxa.m $1_smxax.m\ $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ $1_csex.m $1_cseo.m $1_logic.m ifeq ($using_oct,yes) touch $1_ode2odes.m # Create a dummy which wont' be used mtt $mtt_switches -q -u $1 ode2odes oct else |
︙ |
Modified mttroot/mtt/bin/trans/make_ode2odes from [afde7a9c2a] to [a0a317a4de].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + + + + + | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.57.2.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. ## sys_ae.cc written for unsolved inputs. ## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). ## ## Revision 1.57 2001/04/01 03:38:54 geraint ## Reset row to zero after write to file, ready for subsequent runs. ## Eliminates SIGSEGV in Octave when _ode2odes called multiple times. ## ## Revision 1.56 2001/03/30 15:13:58 gawthrop ## Rationalised simulation modes to each return mtt_data ## |
︙ | |||
221 222 223 224 225 226 227 228 229 230 231 232 233 234 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | + + + + + + | filename=${sys}_ode2odes.${lang} if [ -n "$3" ]; then method=$3 else method=implicit fi if [ -n "$4" ]; then algebraic_solver=$4 else algebraic_solver="Reduce_Solver" fi echo Creating $filename with $method integration method # Find system constants Nx=`mtt_getsize $sys x` # States Nu=`mtt_getsize $sys u` # Inputs Ny=`mtt_getsize $sys y` # Inputs |
︙ | |||
346 347 348 349 350 351 352 | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | - + + | ;; esac cat <<EOF > $filename #include <octave/oct.h> #include <octave/load-save.h> #include <octave/lo-mappers.h> |
︙ | |||
442 443 444 445 446 447 448 | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + | fi cat <<EOF >> $filename void set_signal_handlers (void); #endif // STANDALONE |
︙ |
Modified mttroot/mtt/cc/include/useful-functions.hh from [61119a71b8] to [652bf845ed].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - - - - + - + - + - + | #define pi 3.14159 // Predefine pi #ifndef HAVE_USEFUL_FUNCTIONS_HH #define HAVE_USEFUL_FUNCTIONS_HH #ifndef __cplusplus #define inline /* strip */ |
︙ |
Added mttroot/mtt/lib/cc/mtt_HJ_Solver.cc version [649cd58504].