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.9 1998/08/15 13:46:59 peterg
## New versions of integration routines
##
## Revision 1.8 1998/08/11 13:28:03 peterg
## Lowercase mttLAST etc
##
## Revision 1.7 1998/07/30 11:29:54 peterg
|
>
>
>
|
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.10 1998/08/25 12:22:45 peterg
## Put _switch after update and also at initilisation
##
## Revision 1.9 1998/08/15 13:46:59 peterg
## New versions of integration routines
##
## Revision 1.8 1998/08/11 13:28:03 peterg
## Lowercase mttLAST etc
##
## Revision 1.7 1998/07/30 11:29:54 peterg
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
$1_simpar; # Read in simulation parameters
$1_numpar; # Read in parameters
MTTilast = round(mttlast/mttdt); # Total number of steps
#Initialise
MTTt = 0.0;
[MTTx] = $1_state; # Read in initial state
[MTTx] = $1_switch(MTTx); # Switches
[MTTu] = $1_input(MTTx,MTTt); # Evaluate initial input
[MTTy] = $1_odeo(MTTx,MTTu,MTTt); # Evaluate initial output
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 mttmethod==1 #Euler
|
<
>
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
$1_simpar; # Read in simulation parameters
$1_numpar; # Read in parameters
MTTilast = round(mttlast/mttdt); # Total number of steps
#Initialise
MTTt = 0.0;
[MTTx] = $1_state; # Read in initial state
[MTTu] = $1_input(MTTx,MTTt); # Evaluate initial input
[MTTx] = $1_switch(MTTx); # Switches
[MTTy] = $1_odeo(MTTx,MTTu,MTTt); # Evaluate initial output
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 mttmethod==1 #Euler
|