Overview
Comment:Now works for multi output systems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 3fb6f8c245a29a1aa27e6aac58f7688c34e4b9c7adde784dbc397b70af0a0cda
User & Date: gawthrop@users.sourceforge.net on 1999-11-12 06:56:44
Other Links: branch diff | manifest | tags
Context
1999-11-14
21:27:11
*** empty log message *** check-in: dc6bcbe09c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-11-12
06:56:44
Now works for multi output systems. check-in: 3fb6f8c245 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
06:56:18
*** empty log message *** check-in: cd23f4d0ce user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/mtt_stime.m from [49ae0c3d81] to [72e598c099].

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

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
49
50


51
52
53
54
55
-
+












+
+
+

-
+


-
-
-
+
+
+
+


+
+
+
+
-
-
+
+
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+

-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-





function [t,y,y_theta] = mtt_stime(system_name,theta,indices);
function [t,y,y_theta,x] = mtt_stime(system_name,theta,free);
  ## usage: [t,y,y_theta] = mtt_stime(system_name,theta);
  ##
  ## Simulate system with name system_name and parameter vector theta
  ## The order of components in theta is determined in system_numpar.txt:
  ## y_theta contains the corresponding sensitivity functions
  ## Assumes system generated by the sBG approach
  ## Copyright (C) 1999 by Peter J. Gawthrop

  ## 	$Id$	

  ## Simulate using mtt-generated function

  N = length(theta);

  eval(sprintf("[nx,ny,nu,nz,nyz] = %s_def;", system_name));
  if nargin<3
    indices = ones(size(theta))
    free = 1;
  endif
  
  N = length(theta);
  if N!=length(indices)
    error(sprintf("The length (%i) of indices must be the same as that of theta (%i)",length(indices),N));
  y_theta = [];

  if length(free)==0
    free=1;			# Make the loop happen once to get y and X
  endif
  
  [n,m]  = size(free);
  if m==1
    free = free';
  endif
  y_theta = [];
  for i=1:length(theta)
  
  for i=free
    if indices(i)
      args="";
      for j=1:length(theta)
    args=sprintf("%i",i);
    for j=1:length(theta)
	i_sensitivity=(j==i);
	args = sprintf("%s%i %g ",args, i_sensitivity, theta(j));
      endfor
      args
      command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args);
      system(command);
      args = sprintf("%s %g",args, theta(j));
    endfor

    command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args);
    system(command);

      ## Retrieve data
      load -force mtt_data.dat
      t = mtt_data(:,1);
      y = mtt_data(:,2);
      y_theta = [y_theta mtt_data(:,3)];
    ## Retrieve data
    load -force mtt_data.dat
    y_theta = [y_theta mtt_data(:,3:2:1+ny)];
  endfor

  ## System data
  [n,m]=size(mtt_data);
  t = mtt_data(:,1);
  y = mtt_data(:,2:2:ny);
  x = mtt_data(:,3+ny:m);
    endif
  endfor

endfunction




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