Overview
Comment:Model-based identification for PPP
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 5c2f55298a9a6da6d431bd3d3a7f4874cccf882cba989ef909ce574e17ebb7b8
User & Date: gawthrop@users.sourceforge.net on 2001-04-05 11:51:42
Other Links: branch diff | manifest | tags
Context
2001-04-05
12:00:18
Identification example check-in: 5ad84ea3e2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:51:42
Model-based identification for PPP check-in: 5c2f55298a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:50:12
Tidied up documentation + verbose mode check-in: c15b1f601a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/lib/control/PPP/ppp_identify.m version [842e30c8e0].



























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
56
57
58
59
60
61
function [par,Par,Error,Y] = ppp_identify (system_name,u,y_0,par_names,par_0,extras)
  ## ppp_identify: System identification for PPP
  ## usage:  [par,Par,Error,Y] = ppp_identify(system_name,u,y_0,par_names,par_0,extras)
  ##
  ##  system_name     String containing system name
  ##  u               System input (column vector, each row is u')
  ##  y_0             Desired model output
  ##  par_names       Column vector of (padded) strings - the adjustable
  ##                  parameter names
  ##  par_0           Initial parameter vector estimate
  ##  extras (opt)    optimisation parameters
  ##        .criterion convergence criterion
  ##        .max_iterations limit to number of iterations
  ##        .v  Initial Levenberg-Marquardt parameter

  
  if nargin<6
    extras.criterion = 1e-5;
    extras.max_iterations = 10;
    extras.v = 1e-5;
    extras.verbose = 0;
  endif  

  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








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