Differences From Artifact [83cf0feda3]:

To Artifact [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

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