Overview
Comment:Optimises only when requested (-opt).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 79930fee8fc0de6ba3a9a5ab3cf2e2dbfd9c5cf83e30ae1b1865d9724320bda7
User & Date: geraint@users.sourceforge.net on 2001-07-27 23:29:10
Other Links: branch diff | manifest | tags
Context
2001-07-27
23:38:38
Changed comment below (# SUMMARY) - fixes xmtt. check-in: 99b821e087 user: geraint@users.sourceforge.net tags: origin/master, trunk
23:29:10
Optimises only when requested (-opt). check-in: 79930fee8f user: geraint@users.sourceforge.net tags: origin/master, trunk
00:51:51
This should not have been here! check-in: 5e46372586 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [f47318450c] to [fbd95eaeb2].

13
14
15
16
17
18
19



20
21
22
23
24
25
26
# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



## Revision 1.317  2001/07/24 00:55:17  gawthrop
## Resolved clashes -- marked with ## >>>
##
## Revision 1.316  2001/07/22 19:24:03  geraint
## Multiple '-v' increases verbosity.
##
## Revision 1.315  2001/07/13 04:54:04  geraint







>
>
>







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.318  2001/07/24 04:17:30  gawthrop
## Removed all " from #SUMMARY lines - messes up xmtt
##
## Revision 1.317  2001/07/24 00:55:17  gawthrop
## Resolved clashes -- marked with ## >>>
##
## Revision 1.316  2001/07/22 19:24:03  geraint
## Multiple '-v' increases verbosity.
##
## Revision 1.315  2001/07/13 04:54:04  geraint
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
#SUMMARY cse	constrained-state equations (ps)
#Constrained-state equations
${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r 
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} cse r
endif
	dae2cse_r $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r
$1_csex.r: $1_cse.r
	touch $1_csex.r
$1_cseo.r: $1_cse.r
	touch $1_cseo.r

#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r  $1_subs.r 
#	cse_r2m $1; matlab_tidy $1_cse.m







|







2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
#SUMMARY cse	constrained-state equations (ps)
#Constrained-state equations
${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r 
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} cse r
endif
	dae2cse_r $optimise $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r
$1_csex.r: $1_cse.r
	touch $1_csex.r
$1_cseo.r: $1_cse.r
	touch $1_cseo.r

#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r  $1_subs.r 
#	cse_r2m $1; matlab_tidy $1_cse.m
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636

ifeq ($dae_is_ode,1)
$1_ode.r: $1_dae.r
	echo Copying $1_dae.r to $1_ode.r
	cp $1_dae.r  $1_ode.r
else
$1_ode.r: $1_cse.r $1_cseo.r $1_def.r $1_sympar.r $1_subs.r
	cse2ode_r $1; tidy $1_ode.r
endif

$1_odeo.r: $1_ode.r
	touch $1_odeo.r

$1_ode.m: $1_def.r $1_ode.r
	mtt_r2m $optimise -parameters $1 ode m; #  matlab_tidy $1_ode.m
$1_odeo.m: $1_def.r $1_odeo.r
	mtt_r2m $1 odeo m

$1_odea.m: $1_ode.m
	touch $1_odea.m

$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex


$1_lde.r: $1_dae.r
	dae2lde_r $1; tidy $1_lde.r

$1_lde.tex: $1_lde.r  $1_sympar.r $1_simp.r
	lde_r2tex $1; latex_tidy $1_lde.tex

# The main simulation programme
ifeq ($integration_method,implicit)
$1_ode2odes.m : $1_def.r $1_sympars.txt \







|


















|







2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639

ifeq ($dae_is_ode,1)
$1_ode.r: $1_dae.r
	echo Copying $1_dae.r to $1_ode.r
	cp $1_dae.r  $1_ode.r
else
$1_ode.r: $1_cse.r $1_cseo.r $1_def.r $1_sympar.r $1_subs.r
	cse2ode_r $optimise $1; tidy $1_ode.r
endif

$1_odeo.r: $1_ode.r
	touch $1_odeo.r

$1_ode.m: $1_def.r $1_ode.r
	mtt_r2m $optimise -parameters $1 ode m; #  matlab_tidy $1_ode.m
$1_odeo.m: $1_def.r $1_odeo.r
	mtt_r2m $1 odeo m

$1_odea.m: $1_ode.m
	touch $1_odea.m

$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex


$1_lde.r: $1_dae.r
	dae2lde_r $optimise $1; tidy $1_lde.r

$1_lde.tex: $1_lde.r  $1_sympar.r $1_simp.r
	lde_r2tex $1; latex_tidy $1_lde.tex

# The main simulation programme
ifeq ($integration_method,implicit)
$1_ode2odes.m : $1_def.r $1_sympars.txt \
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
#SUMMARY sm	state matrices (icad)
#SUMMARY sm	state matrices (tex)
#SUMMARY sm	state matrices (c)
#SUMMARY sm*	state matrices (view)
#SUMMARY sm	state matrices (ps)
#Linearised system: state matrices
$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $1 sm; tidy $1_sm.r
$1_sm.m: $1_def.r $1_sm.r $1_sympars.txt 
		mtt_r2m $optimise  -parameters $1 sm
$1_sm.icad:  $1_sm.m $1_numpar.m
		sm_m2icad $1
$1_sm.c: $1_def.r $1_sm.r $1_sympar.c
		sm_r2c $1
$1_sm.tex: $1_sm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1 sm; latex_tidy $1_sm.tex

#SUMMARY ssm	sensitivity state matrices (r)
#SUMMARY ssm	sensitivity state matrices (icad)
#SUMMARY ssm	sensitivity state matrices (tex)
#SUMMARY ssm	sensitivity state matrices (c)
#SUMMARY ssm	sensitivity state matrices (ps)
#Linearised system: sensitivity state matrices
$1_ssm.r: $1_scsm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $1 ssm; tidy $1_ssm.r
$1_ssm.m: $1_def.r $1_ssm.r $1_sympars.txt 
		mtt_r2m $optimise -parameters $1 ssm
$1_ssm.tex: $1_ssm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1 ssm; latex_tidy $1_ssm.tex

#SUMMARY smx	state matrices with variable state x (r)
#SUMMARY smx	state matrices with variable state x (m)







|
















|







2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
#SUMMARY sm	state matrices (icad)
#SUMMARY sm	state matrices (tex)
#SUMMARY sm	state matrices (c)
#SUMMARY sm*	state matrices (view)
#SUMMARY sm	state matrices (ps)
#Linearised system: state matrices
$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $optimise $1 sm; tidy $1_sm.r
$1_sm.m: $1_def.r $1_sm.r $1_sympars.txt 
		mtt_r2m $optimise  -parameters $1 sm
$1_sm.icad:  $1_sm.m $1_numpar.m
		sm_m2icad $1
$1_sm.c: $1_def.r $1_sm.r $1_sympar.c
		sm_r2c $1
$1_sm.tex: $1_sm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1 sm; latex_tidy $1_sm.tex

#SUMMARY ssm	sensitivity state matrices (r)
#SUMMARY ssm	sensitivity state matrices (icad)
#SUMMARY ssm	sensitivity state matrices (tex)
#SUMMARY ssm	sensitivity state matrices (c)
#SUMMARY ssm	sensitivity state matrices (ps)
#Linearised system: sensitivity state matrices
$1_ssm.r: $1_scsm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $optimise $1 ssm; tidy $1_ssm.r
$1_ssm.m: $1_def.r $1_ssm.r $1_sympars.txt 
		mtt_r2m $optimise -parameters $1 ssm
$1_ssm.tex: $1_ssm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1 ssm; latex_tidy $1_ssm.tex

#SUMMARY smx	state matrices with variable state x (r)
#SUMMARY smx	state matrices with variable state x (m)

Modified mttroot/mtt/bin/trans/cse2ode_r from [4586038e86] to [945a7d1a16].

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
39
40
41
42
43
44
45
46
# Copyright (c) P.J.Gawthrop, 1991, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.1.4.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.1  2000/12/28 12:21:31  peterg
## Put under RCS
##
## Revision 1.2  1997/01/06 21:17:10  peterg
## Removed:  OFF Exp; OFF GCD;
##
## Revision 1.1  1996/08/25 10:05:45  peter
## Initial revision
##
###############################################################













# Create the reduce output code
def2write_r $1 ode
def2write_r $1 odeo

#Inform user
echo Creating $1_ode.r
echo Creating $1_odeo.r

# Remove the old log file
rm -f cse2ode_r.log

# Use reduce to accomplish the transformation
$SYMBOLIC >cse2ode_r.log << EOF








>
>
>
















>
>
>
>
>
>
>
>
>
>
>
>

|
|


|
|







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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright (c) P.J.Gawthrop, 1991, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  2001/07/13 04:54:04  geraint
## Branch merge: numerical-algebraic-solution back to main.
##
## Revision 1.1.4.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.1  2000/12/28 12:21:31  peterg
## Put under RCS
##
## Revision 1.2  1997/01/06 21:17:10  peterg
## Removed:  OFF Exp; OFF GCD;
##
## Revision 1.1  1996/08/25 10:05:45  peter
## Initial revision
##
###############################################################

optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
    case $1 in
	-optimise)
	    optimise='-optimise'
	    optimise_msg=' with optimisation' ;;
	*)
	    echo "$1 is an invalid argument - ignoring" ;;
    esac
    shift
done

# Create the reduce output code
def2write_r $optimise $1 ode
def2write_r $optimise $1 odeo

#Inform user
echo Creating $1_ode.r $optimise_msg
echo Creating $1_odeo.r $optimise_msg

# Remove the old log file
rm -f cse2ode_r.log

# Use reduce to accomplish the transformation
$SYMBOLIC >cse2ode_r.log << EOF

Modified mttroot/mtt/bin/trans/csm2sm_r from [f47703e67d] to [d62d77923d].

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
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.2  1996/08/25 10:11:32  peter
## Added END in output file.
## Error handling.
##
## Revision 1.1  1996/08/19 15:06:16  peter
## Initial revision
##
###############################################################













# Create the reduce output code
def2write_r $1 $2

# Inform user
echo Creating $1_$2.r

case $2 in
    sm)
        rep=csm;
        ;;
    ssm)
        rep=scsm







>
>
>









>
>
>
>
>
>
>
>
>
>
>
>

|


|







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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  2000/12/28 12:24:03  peterg
## Put under RCS
##
## Revision 1.2  1996/08/25 10:11:32  peter
## Added END in output file.
## Error handling.
##
## Revision 1.1  1996/08/19 15:06:16  peter
## Initial revision
##
###############################################################

optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
    case $1 in
	-optimise)
	    optimise='-optimise'
	    optimise_msg=' with optimisation' ;;
	*)
	    echo "$1 is an invalid argument - ignoring" ;;
    esac
    shift
done

# Create the reduce output code
def2write_r $optimise $1 $2

# Inform user
echo Creating $1_$2.r $optimise_msg

case $2 in
    sm)
        rep=csm;
        ;;
    ssm)
        rep=scsm

Modified mttroot/mtt/bin/trans/dae2cse_r from [58cb32da86] to [a2463771db].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.15.2.4  2001/06/26 00:55:48  geraint
## Writes algebraic equation Jacobian _aej.r (not used yet).
##
## Revision 1.15.2.3  2001/05/09 00:19:22  geraint
## Fixed EOF error when MTTNYZ=0.
##
## Revision 1.15.2.2  2001/05/05 20:50:16  geraint







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.16  2001/07/13 04:54:04  geraint
## Branch merge: numerical-algebraic-solution back to main.
##
## Revision 1.15.2.4  2001/06/26 00:55:48  geraint
## Writes algebraic equation Jacobian _aej.r (not used yet).
##
## Revision 1.15.2.3  2001/05/09 00:19:22  geraint
## Fixed EOF error when MTTNYZ=0.
##
## Revision 1.15.2.2  2001/05/05 20:50:16  geraint
91
92
93
94
95
96
97
98
99

100
101
102
103




104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
## Sorted out bug when MTTNz=0
##
## Revision 1.1  1996/08/15 16:47:02  peter
## Initial revision
##
###############################################################

#Explicit solution option
solve=0

while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
        -A )
                solve=1;;




        *)
                echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

# Create the reduce output code
def2write_r $1 cse      
def2write_r $1 csex  # Version without E matrix
def2write_r $1 cseo

if [ "$solve" = "1" ]; then
    echo "Creating $1_cse.r (with explicit solution of algebraic equations)"
else
    echo "Creating $1_cse.r"
fi

echo "Creating $1_csex.r"
echo "Creating $1_cseo.r"

# Remove the old log file
rm -f dae2cse_r.log

# Remove some files
rm -f $1_cse.r? $1_cseo.r?








|
|
>



|
>
>
>
>







|
|
|

<
<
<
|
<
<
|
|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122



123


124
125
126
127
128
129
130
131
132
## Sorted out bug when MTTNz=0
##
## Revision 1.1  1996/08/15 16:47:02  peter
## Initial revision
##
###############################################################

#Explicit solution option and optimise option
solve=0; solve_msg=''
optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
        -A )
                solve=1
		solve_msg=' with explicit solution of algebraic equations' ;;
	-optimise)
	    optimise='-optimise'
	    optimise_msg=' with optimisation' ;;
        *)
                echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

# Create the reduce output code
def2write_r $optimise $1 cse 
def2write_r $optimise $1 csex # Version without E matrix
def2write_r $optimise $1 cseo




echo "Creating $1_cse.r $solve_msg $optimise_msg"


echo "Creating $1_csex.r $optimise_msg"
echo "Creating $1_cseo.r $optimise_msg"

# Remove the old log file
rm -f dae2cse_r.log

# Remove some files
rm -f $1_cse.r? $1_cseo.r?

Modified mttroot/mtt/bin/trans/dae2lde_r from [1356811527] to [ec8a1424aa].

9
10
11
12
13
14
15



16
17












18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



###############################################################













# Create the reduce output code
def2write_r $1 lde
def2write_r $1 ldeo

#Inform user
echo Creating $1_lde.r
echo Creating $1_ldeo.r

# Remove the old log file
rm -f cse2lde_r.log

# Use reduce to accomplish the transformation
$SYMBOLIC  << EOF >cse2lde_r.log








>
>
>


>
>
>
>
>
>
>
>
>
>
>
>

|
|


|
|







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
39
40
41
42
43
44
45
46
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  2000/12/28 12:25:13  peterg
## Initial revision
##
###############################################################

optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
    case $1 in
	-optimise)
	    optimise='-optimise'
	    optimise_msg=' with optimisation' ;;
	*)
	    echo "$1 is an invalid argument - ignoring" ;;
    esac
    shift
done

# Create the reduce output code
def2write_r $optimise $1 lde
def2write_r $optimise $1 ldeo

#Inform user
echo Creating $1_lde.r $optimise_msg
echo Creating $1_ldeo.r $optimise_msg

# Remove the old log file
rm -f cse2lde_r.log

# Use reduce to accomplish the transformation
$SYMBOLIC  << EOF >cse2lde_r.log

Modified mttroot/mtt/bin/trans/def2write_r from [4a06362261] to [6639ce8c03].

9
10
11
12
13
14
15



16
17
18
19
20
21
22
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.7.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.7  2001/04/11 09:44:26  gawthrop
## Fixed cc and c problems to do with pow(x,y) and integers







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.8  2001/07/13 04:54:04  geraint
## Branch merge: numerical-algebraic-solution back to main.
##
## Revision 1.7.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.7  2001/04/11 09:44:26  gawthrop
## Fixed cc and c problems to do with pow(x,y) and integers
38
39
40
41
42
43
44












45
46
47
48
49
50
51
52
53
54
55
56
57
## Revision 1.2  2000/10/10 21:02:17  peterg
## Added cse reps
##
## Revision 1.1  2000/10/10 09:07:32  peterg
## Initial revision
##
###############################################################













sys=$1 # System name
rep=$2 # System representation

# Inform User
echo Creating $1_$2_write.r

# Find system constants
Nx=`mtt_getsize $sys x` # States
Nxx=`mtt_getsize $sys xx` # States x States
Nu=`mtt_getsize $sys u` # Inputs 
Ny=`mtt_getsize $sys y` # Outputs 
Nyz=`mtt_getsize $sys yz` # Zero outputs







>
>
>
>
>
>
>
>
>
>
>
>





|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## Revision 1.2  2000/10/10 21:02:17  peterg
## Added cse reps
##
## Revision 1.1  2000/10/10 09:07:32  peterg
## Initial revision
##
###############################################################

optimise=''
while [ -n "`echo $1 | grep '^-'`" ]; do
    case $1 in
	-optimise)
	    opt='-optimise'
	    optimise_msg=' with optimisation' ;;
	*)
	    echo "$1 is an invalid argument - ignoring" ;;
    esac
    shift
done

sys=$1 # System name
rep=$2 # System representation

# Inform User
echo Creating $1_$2_write.r $optimise_msg

# Find system constants
Nx=`mtt_getsize $sys x` # States
Nxx=`mtt_getsize $sys xx` # States x States
Nu=`mtt_getsize $sys u` # Inputs 
Ny=`mtt_getsize $sys y` # Outputs 
Nyz=`mtt_getsize $sys yz` # Zero outputs
101
102
103
104
105
106
107
108






109
110
111
112
113
114
115
116

117
118
119
120
121





122
123
124
125
	;;
    *)
        echo def2write_r: representation $rep not recognised
        exit
esac

# Write out the code
echo 'off echo$ load scope$'                    >$1_$2_write.r







for matrix in $matrices; do
    n=`first "$ns"`; ns=`rest "$ns"` 
    m=`first "$ms"`; ms=`rest "$ms"`
    is=`n2m 1 $n`; 
    js=`n2m 1 $m`; 
    for i in $is; do
      for j in $js; do

        echo 'optimize'                      >>$1_$2_write.r
        name=`echo MTT$matrix'('$i','$j')'`
        echo '  '$comma$name ':=:' $name >>$1_$2_write.r
        echo 'INAME mtt_tmp$'                 >>$1_$2_write.r
        comma=''





      done
    done
done
echo 'END$'                           >>$1_$2_write.r







|
>
>
>
>
>
>








>
|
|
|
|
|
>
>
>
>
>




116
117
118
119
120
121
122
123
124
125
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
	;;
    *)
        echo def2write_r: representation $rep not recognised
        exit
esac

# Write out the code
echo 'off echo$'                    >$1_$2_write.r

if [ ${opt:-""} = "-optimise" ]; then
    echo 'load scope$'
else
    echo 'load gentran$'
fi >> $1_$2_write.r

for matrix in $matrices; do
    n=`first "$ns"`; ns=`rest "$ns"` 
    m=`first "$ms"`; ms=`rest "$ms"`
    is=`n2m 1 $n`; 
    js=`n2m 1 $m`; 
    for i in $is; do
      for j in $js; do
	if [ ${opt:-""} = "-optimise" ]; then
       	    echo 'optimize'
	    name=`echo MTT$matrix'('$i','$j')'`
	    echo '  '$comma$name ':=:' $name
	    echo 'INAME mtt_tmp$'
	    comma=''
	else
	    echo 'write'
	    name=`echo MTT$matrix'('$i','$j')'`
	    echo '  '$comma$name ':=' $name '$'
	fi >> $1_$2_write.r
      done
    done
done
echo 'END$'                           >>$1_$2_write.r


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