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.33 2000/05/11 19:33:18 peterg
## Uniform version for _sim.m
##
## Revision 1.32 2000/05/11 08:30:00 peterg
##
## Revision 1.31 2000/05/10 18:33:25 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.34 2000/05/16 18:56:14 peterg
## *** empty log message ***
##
## Revision 1.33 2000/05/11 19:33:18 peterg
## Uniform version for _sim.m
##
## Revision 1.32 2000/05/11 08:30:00 peterg
##
## Revision 1.31 2000/05/10 18:33:25 peterg
|
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
ilast = round(simpar.last/simpar.dt)+1; # Total number of steps
[u] = zero_input(1); # Zero the input
for it = 1:ilast #Integration loop
[y] = $1_cseo(x,u,t,par);# Output
[u] = $1_input(t,x,y); # Input
if (t>=simpar.first)
mtt_write(t,x,y,$Nx,$Ny); # Write it out
endif
[dx] = $1_cse(x,u,t,par); # State derivative
[AA] = $1_smxa(x,u,simpar.dt,par); # (I-Adt) and (I-Adt)x
[AAx] = $1_smxax(x,u,simpar.dt,par); # (I-Adt) and (I-Adt)x
[open_switches] = $1_switchopen(x); # Open switches
[x] = mtt_implicit(x,dx,AA,AAx,simpar.dt,$Nx,open_switches); # Implicit update
t = t + simpar.dt;
endfor; # Integration loop
|
<
|
<
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
ilast = round(simpar.last/simpar.dt)+1; # Total number of steps
[u] = zero_input(1); # Zero the input
for it = 1:ilast #Integration loop
[y] = $1_cseo(x,u,t,par);# Output
[u] = $1_input(t,x,y); # Input
mtt_write(t,x,y,$Nx,$Ny); # Write it out
[dx] = $1_cse(x,u,t,par); # State derivative
[AA] = $1_smxa(x,u,simpar.dt,par); # (I-Adt) and (I-Adt)x
[AAx] = $1_smxax(x,u,simpar.dt,par); # (I-Adt) and (I-Adt)x
[open_switches] = $1_switchopen(x); # Open switches
[x] = mtt_implicit(x,dx,AA,AAx,simpar.dt,$Nx,open_switches); # Implicit update
t = t + simpar.dt;
endfor; # Integration loop
|