Overview
Comment:Added -sort option to allow direct generation of ode2odes.m using sese.m
instead of ode/csex.

"mtt -sort rc odeso view" works without Reduce installed!!!

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: dbcd7bca490fb7d5e8ca6db781847e54cf10b520bd25f54030acb5c88d930574
User & Date: geraint@users.sourceforge.net on 2003-04-17 20:57:29
Other Links: branch diff | manifest | tags
Context
2003-05-08
18:43:09
Generate pdf from ps (using hyperref package for links etc) check-in: 594befbf9c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-04-17
20:57:29
Added -sort option to allow direct generation of ode2odes.m using sese.m
instead of ode/csex.

"mtt -sort rc odeso view" works without Reduce installed!!! check-in: dbcd7bca49 user: geraint@users.sourceforge.net tags: origin/master, trunk

20:07:33
Added rule to create _sese.m check-in: 5fdf656744 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [92127b1f9b] to [df325aac7a].

13
14
15
16
17
18
19



20
21
22
23
24
25
26
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29







+
+
+







# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.373  2003/04/17 20:07:32  geraint
## Added rule to create _sese.m
##
## Revision 1.372  2003/03/24 12:03:36  gawthrop
## Added -I switch to sese transformation
##
## Revision 1.371  2003/03/13 15:47:35  gawthrop
## Added sese rep.
##
## Revision 1.370  2003/02/11 20:04:08  geraint
1458
1459
1460
1461
1462
1463
1464




1465
1466
1467
1468
1469
1470
1471
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478







+
+
+
+







			echo $1 is an unknown solver - use hybrd, hooke or reduce;
			exit;;
	        esac;;
	-s )
                sensitivity_switch='-s';
                mtt_switches="$mtt_switches $1";
		sensitivity=sensitivity ;;
	-sort )
                mtt_switches="$mtt_switches $1";
		use_sorted_equations="yes";
		integration_method="sorted_euler";;
	-ss )
                mtt_switches="$mtt_switches $1";
		steadystate_computation=yes ;;
	-d )
		directory=$2; cd $directory; shift ;;
	-dc )
		mtt_switches="$mtt_switches $1";
1631
1632
1633
1634
1635
1636
1637

1638
1639
1640
1641
1642
1643
1644
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652







+







    echo '         -optg optimise code generation (global : full vector) (EXPERIMENTAL)'
    echo "         -ntmpvar <N>  declare N temporary variables (default=$num_tmp_var)"
    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'
    echo '         -s  generate sensitivity BG (use mtt -s sSys rep lang)'
    echo '         -sort use sorted equations (sese) and Euler integration (EXPERIMENTAL)'
    echo '         -ss use steady-state info to initialise simulations'
    echo '         -stdin read input data from standard input for  simulations'
    echo '         -sub <subsystem> operate on this subsystem'
    echo '         -t  tidy mode (default)'
    echo '         -trace  Just indicate what mtt will do - but do not do it'
    echo '         -u  untidy mode (leaves files in current dir)'
    echo '         -v  verbose mode (multiple uses of -v increase the verbosity level)'
2983
2984
2985
2986
2987
2988
2989





2990
2991
2992

2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013

3014
3015
3016
3017
3018
3019
3020







+
+
+
+
+



+







-







	touch $1_ode2odes.m # Create a dummy which wont' be used
	mtt $mtt_switches -q -u $1 ode2odes oct
else
	make_ode2odes $1 m $integration_method $algebraic_solver
endif
endif
ifneq ($integration_method,implicit)
ifeq ($integration_method,sorted_euler)
$1_ode2odes.m : $1_def.r $1_sympars.txt\
		$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
		$1_sese.m $1_logic.m
else
$1_ode2odes.m : $1_def.r $1_sympars.txt\
		$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
		$1_ode.m $1_odeo.m  $1_logic.m
endif
ifeq ($using_oct,yes)
	echo "*** Warning: Shouldn't be here! Creating dummy $1_ode2odes.m"
	touch $1_ode2odes.m # Create a dummy which wont' be used
	mtt $mtt_switches -q -u $1 ode2odes oct
else
	make_ode2odes $1 m $integration_method $algebraic_solver
endif

endif

#SUMMARY ode2odes Simulation function (m)
#SUMMARY ode2odes Simulation function (cc)
#SUMMARY ode2odes Simulation function (oct)
#SUMMARY ode2odes Simulation function (exe)
$1_ode2odes.exe: $1_def.h $1_sympar.h\

Modified mttroot/mtt/bin/trans/make_ode2odes from [2a9d7b1d9e] to [2efe87b571].

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











+
+
+







#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
    ######################################

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.83  2002/08/07 14:27:14  geraint
## Changes to make "-i dassl" work again.
##
## Revision 1.82  2002/07/24 14:00:12  geraint
## Corrected arguments passed to mtt_write when dumping data (sigint).
##
## Revision 1.81  2002/07/11 13:00:23  geraint
## Declared more function arguments to be "const" - improves compiler optimisation.
##
## Revision 1.80  2002/05/22 09:35:49  geraint
351
352
353
354
355
356
357



358
359
360
361
362
363
364
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370







+
+
+







	algorithm="mtt_implicit(x,dx,AA,AAx,ddt,$Nx,open_switches)"
	;;
    "dassl")
	ode=ode
	odeo=odeo
	algorithm="mtt_dassl(x,u,t,par,dx,ddt,MTTNX,MTTNYZ,open_switches)"
	;;
    "sorted_euler")
	algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)"
	;;
    "euler" | "rk4" | *)
	ode=ode
	odeo=odeo
	algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)"
	;;
esac

393
394
395
396
397
398
399







400




401
402
403
404
405
406
407
408
409
410
411
412
413




414
415
416
417
418
419
420
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441







+
+
+
+
+
+
+

+
+
+
+













+
+
+
+







  for MTTi=1:$Ny
    y(MTTi) = 0;
  endfor;

  mttj = 0;
    for it = 1:ilast		#Integration loop
    [u] = ${sys}_input(x,y,t,par);	# Input
EOF
if [ "$method" = "sorted_euler" ]; then
cat <<EOF >> $filename
    [dx,y] = ${sys}_sese(x,u,t,par); # Output
EOF
else
cat <<EOF >> $filename
    [y] = ${sys}_$odeo(x,u,t,par);  # Output 

EOF
fi
cat <<EOF >> $filename
    if mttj==0
     mtt_write(t,x,y,$Nx,$Ny,simpar.first);   # Write it out
    endif
EOF

if [ "$method" = "rk4" ]; then
cat << EOF >> $filename
    [k1] = ddt * ${sys}_${ode}(x,u,t,par);
    [k2] = ddt * ${sys}_${ode}(x+k1/2,u,t+ddt/2,par);
    [k3] = ddt * ${sys}_${ode}(x+k2/2,u,t+ddt/2,par);
    [k4] = ddt * ${sys}_${ode}(x+k3,u,t+ddt,par);
    [dx] = [k1 + 2.0 * [k2 + k3] + k4] / (6.0 * ddt);
EOF
elif [ "$method" = "sorted_euler" ]; then
cat <<EOF >> $filename
    [dx,y] = ${sys}_sese(x,u,t,par); # State derivative and Output
EOF
else
cat << EOF >> $filename
    [dx] = ${sys}_$ode(x,u,t,par);	# State derivative
EOF
fi

if [ "$method" = "implicit" ]; then


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]