Overview
Comment:Upgraded to return Nx3 matrix of indices
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: e0b1b92895c0fbe738ddd5a8846b9bb53b9c1ebc216ccce14d8ff4f89d167647
User & Date: gawthrop@users.sourceforge.net on 2002-05-07 12:04:49
Other Links: branch diff | manifest | tags
Context
2002-05-07
13:48:43
Improved clarity of code generated for -cc and -oct (except ode2odes).
Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents.
check-in: 058538fe27 user: geraint@users.sourceforge.net tags: origin/master, trunk
12:04:49
Upgraded to return Nx3 matrix of indices check-in: e0b1b92895 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:13:48
Files marked by update as out of sync check-in: 615e55d26d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/control/PPP/ppp_indices.m from [83cf0feda3] to [719278145f].

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
function indices = ppp_indices (names,sympar)

  ## usage:  indices = ppp_indices (names,sympar)
  ##
  ## names: column vector of component names


  ## sympar: mtt-generated data structure od symbolic parameters













  ## Set up the
  indices = [];
  [n,m] = size(names);
  for i = 1:n
    p_name = deblank(names(i,:));
    s_name = sprintf("%ss", p_name);
    if struct_contains(sympar, p_name)
      i_p = eval(sprintf("sympar.%s;", p_name));
      if struct_contains(sympar, s_name)
	i_s = eval(sprintf("sympar.%s;", s_name));


	indices_i = eval(sprintf("[%i,%i];", i_p, i_s));
	indices = [indices; indices_i];
      else



	printf("Sensitivity parameter %s does not exist: ignoring \
	parameter %s\n", s_name, p_name);
      endif
    else
      printf("Parameter %s does not exist: ignoring\n", p_name)
    endif
  endfor
  

endfunction
|




>
>
|

>
>
>
>
>

>
>
>
>
>
>






|
|
|
|
>
>
|
|
|
>
>
>
|



|


|
<

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
function indices = ppp_indices (names,sympar,sympars)

  ## usage:  indices = ppp_indices (names,sympar)
  ##
  ## names: column vector of component names
  ## sympar symbolic parameter structure for system
  ## sympars symbolic parameter structure for sensitivity system
 

  ## Returns a matrix indices with 3 columns, one row per name
  ## First  col: index of ith parameter of sensitivity system
  ## Second col: index of ith sensitivity parameter of sensitivity system
  ## Third col : index of ith parameter of system
  ## Copyright (C) 2002 by Peter J. Gawthrop

  ## Sanity check
  if nargin<3
    printf("Usage: ppp_indices (names,sympar,sympars)\n");
    return
  endif
  
  ## Set up the
  indices = [];
  [n,m] = size(names);
  for i = 1:n
    p_name = deblank(names(i,:));
    s_name = sprintf("%ss", p_name);
    if struct_contains(sympars, p_name)
      i_ps = eval(sprintf("sympars.%s;", p_name));
      if struct_contains(sympars, s_name)
	i_s = eval(sprintf("sympars.%s;", s_name));
	if struct_contains(sympar, p_name)
	  i_p = eval(sprintf("sympar.%s;", p_name));
	  indices_i = eval(sprintf("[%i,%i,%i];", i_ps, i_s, i_p));
	  indices = [indices; indices_i];
	else
	  printf("Parameter %s does not exist in sympar: ignoring\n", p_name)
	endif
      else
	printf("Sensitivity parameter %s does not exist in sympars: ignoring \
	parameter %s\n", s_name, p_name);
      endif
    else
      printf("Parameter %s does not exist in sympars: ignoring\n", p_name)
    endif
  endfor


endfunction

Modified mttroot/mtt/lib/control/PPP/ppp_ippp.m from [5bf17145e3] to [d40f70c238].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function i_ppp = ppp_ippp (n_ppp,sympar,sympars)

  ## usage:  i_ppp = ppp_ippp (n_ppp,sympar,sympars)
  ## nppp   number of ppp parameters
  ## sympar symbolic parameter structure for system
  ## sympar symbolic parameter structure for sensitivity system
  ## Returns a matrix i_ppp with n_ppp rows and 3 columns
  ## First  col: index of ith ppp parameter of sensitivity system
  ## Second col: index of ith ppp sensitivity parameter of sensitivity system
  ## Third col : index of ith ppp sensitivity parameter of system
  ## Copyright (C) 2002 by Peter J. Gawthrop

  i_ppp = [];
  for i=1:n_ppp
    i_ppp_i = eval(sprintf("[sympars.ppp_%i, sympars.ppp_%is \
			     sympar.ppp_%i];",i,i,i));
    i_ppp = [i_ppp ; i_ppp_i];
  endfor

endfunction




|




|










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function i_ppp = ppp_ippp (n_ppp,sympar,sympars)

  ## usage:  i_ppp = ppp_ippp (n_ppp,sympar,sympars)
  ## nppp   number of ppp parameters
  ## sympars symbolic parameter structure for system
  ## sympar symbolic parameter structure for sensitivity system
  ## Returns a matrix i_ppp with n_ppp rows and 3 columns
  ## First  col: index of ith ppp parameter of sensitivity system
  ## Second col: index of ith ppp sensitivity parameter of sensitivity system
  ## Third col : index of ith ppp  parameter of system
  ## Copyright (C) 2002 by Peter J. Gawthrop

  i_ppp = [];
  for i=1:n_ppp
    i_ppp_i = eval(sprintf("[sympars.ppp_%i, sympars.ppp_%is \
			     sympar.ppp_%i];",i,i,i));
    i_ppp = [i_ppp ; i_ppp_i];
  endfor

endfunction


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