Overview
Comment:Tidied up the optimisation stuff
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: ca9ae39eaab3bd71115eac98a6013fdfbfbc8635ffa5a65317c91ae5e10c70b5
User & Date: gawthrop@users.sourceforge.net on 2001-08-10 16:19:06.000
Other Links: branch diff | manifest | tags
Context
2001-08-10
16:20:43
Fixed error and added test system check-in: 722c460774 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:19:06
Tidied up the optimisation stuff check-in: ca9ae39eaa user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-08-09
03:09:23
Fixed zeroing of initial guess of unknown inputs. check-in: 67b14533e7 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes
︙︙
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
56
57
58
  s_system_name = sprintf("s%s", system_name); # Name of sensitivity system

  ## Set up parameters
  sim = eval([s_system_name, "_simpar;"]); # Simulation parameter
  sym = eval([s_system_name, "_sympar;"]); # Parameter names
  x0  = eval([s_system_name, "_state(par_0);"]); # Initial state

  ## Set up the free parameter list
  free = [];
  [n,m] = size(par_names);
  for i = 1:n
    p_name = deblank(par_names(i,:));
    s_name = sprintf("%ss", p_name);
    if struct_contains(sym, p_name)
      i_p = eval(sprintf("sym.%s;", p_name));
      if struct_contains(sym, s_name)
	i_s = eval(sprintf("sym.%s;", s_name));
	free_i = eval(sprintf("[%i,%i];", i_p, i_s));
	free = [free; free_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
  

  [par,Par,Error,Y] = ppp_optimise(s_system_name,x0,par_0,sim,u,y_0,free,extras);

endfunction











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







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
56
57
58
59
  s_system_name = sprintf("s%s", system_name); # Name of sensitivity system

  ## Set up parameters
  sim = eval([s_system_name, "_simpar;"]); # Simulation parameter
  sym = eval([s_system_name, "_sympar;"]); # Parameter names
  x0  = eval([s_system_name, "_state(par_0);"]); # Initial state

#   ## Set up the free parameter list
#   free = [];
#   [n,m] = size(par_names);
#   for i = 1:n
#     p_name = deblank(par_names(i,:));
#     s_name = sprintf("%ss", p_name);
#     if struct_contains(sym, p_name)
#       i_p = eval(sprintf("sym.%s;", p_name));
#       if struct_contains(sym, s_name)
# 	i_s = eval(sprintf("sym.%s;", s_name));
# 	free_i = eval(sprintf("[%i,%i];", i_p, i_s));
# 	free = [free; free_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
#   free
  free = ppp_indices(par_names,sym);
  [par,Par,Error,Y] = ppp_optimise(s_system_name,x0,par_0,sim,u,y_0,free,extras);

endfunction




︙︙
︙︙
24
25
26
27
28
29
30



31
32
33
34
35
36
37
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$



  ## Revision 1.5  2001/06/06 07:54:38  gawthrop
  ## Further fixes to make nonlinear PPP work ...
  ##
  ## Revision 1.4  2001/05/26 15:46:38  gawthrop
  ## Updated to account for new nonlinear ppp
  ##
  ## Revision 1.3  2001/04/05 11:50:12  gawthrop







>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.6  2001/07/03 22:59:10  gawthrop
  ## Fixed problems with argument passing for CRs
  ##
  ## Revision 1.5  2001/06/06 07:54:38  gawthrop
  ## Further fixes to make nonlinear PPP work ...
  ##
  ## Revision 1.4  2001/05/26 15:46:38  gawthrop
  ## Updated to account for new nonlinear ppp
  ##
  ## Revision 1.3  2001/04/05 11:50:12  gawthrop
︙︙
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    endif
    
    ## Use the last part of the simulation to compare with data
    y = y(1+N_data-n_data:N_data,:);
    y_par = y_par(1+N_data-n_data:N_data,:);

    if extras.verbose		# Diagnostics
      printf("y and y_0\n");
      [y,y_0]
    endif
    
    ##Evaluate error, cost derivative J and cost second derivative JJ
    error = 0; 
    J = zeros(n_th,1);
    JJ = zeros(n_th,n_th);
    







|
|







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    endif
    
    ## Use the last part of the simulation to compare with data
    y = y(1+N_data-n_data:N_data,:);
    y_par = y_par(1+N_data-n_data:N_data,:);

    if extras.verbose		# Diagnostics
##      printf("y and y_0\n");
##      [y,y_0]
    endif
    
    ##Evaluate error, cost derivative J and cost second derivative JJ
    error = 0; 
    J = zeros(n_th,1);
    JJ = zeros(n_th,n_th);
    
︙︙

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