Differences From Artifact [2bb203ef7d]:

To Artifact [7a48ad2de1]:


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
39
40
41
#!/bin/sh

## Makes the sensitivity simulation
## Copyright (C) 2001 by Peter J. Gawthrop

sys=$1
lang=$2

outfile=${sys}_sim.${lang}

echo Creating $outfile

make_m() {
mtt_header ${sys} sim m >  ${outfile}
cat >> ${outfile} <<EOF

 ## Pass input as a global
 global MTT_input MTT_input_index MTT_input_last

  [nx,ny] = ${sys}_def;
  y_par = [];
  MTT_input = u;
  [MTT_input_last,m] = size(u);

  MTT_input_index = 0;
  [mtt_data] = ${sys}_ode2odes(x0,par,simpar);
  y = mtt_data(:,2:1+ny);
  x = mtt_data(:,3+ny:2+ny+nx);
  ypar = [];







endfunction
EOF

}

case ${lang} in
    m)
	make_m
	;;
    *)
	echo Language ${lang} not supported - sorry
esac











>

|















>
>
>
>
>
>













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
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

## Makes the sensitivity simulation
## Copyright (C) 2001 by Peter J. Gawthrop

sys=$1
lang=$2

outfile=${sys}_sim.${lang}

echo Creating $outfile

make_m() {
mtt_header ${sys} sim m  >  ${outfile}
cat >> ${outfile} <<EOF

 ## Pass input as a global
 global MTT_input MTT_input_index MTT_input_last

  [nx,ny] = ${sys}_def;
  y_par = [];
  MTT_input = u;
  [MTT_input_last,m] = size(u);

  MTT_input_index = 0;
  [mtt_data] = ${sys}_ode2odes(x0,par,simpar);
  y = mtt_data(:,2:1+ny);
  x = mtt_data(:,3+ny:2+ny+nx);
  ypar = [];

  if nargout>2
    ## Create time vector
    [N,M] = size(y);
    t = simpar.dt*[0:N-1]';
  endif;

endfunction
EOF

}

case ${lang} in
    m)
	make_m
	;;
    *)
	echo Language ${lang} not supported - sorry
esac

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