Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 733212da425753c11e2bb651f49ff3bf68e6ccfa1190c70bd1ebb4b2b4a1e3fb
User & Date: gawthrop@users.sourceforge.net on 1999-09-06 23:26:05
Other Links: branch diff | manifest | tags
Context
1999-09-07
00:33:44
Initial revision check-in: 28ec3e5820 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-09-06
23:26:05
Initial revision check-in: 733212da42 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-09-04
04:59:08
Initial revision check-in: 732b893409 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/m/mtt_identify.m version [21f7e88261].













































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
function [theta,Theta,Error,Y] = mtt_identify (system_name,y_s,theta_0,criterion,max_iterations)

  ## usage:  [theta,Theta,Error] = mtt_identify (system_name,theta_0,criterion,max_iterations)
  ##      y_s   actual system output
  ##      theta_0   initial parameter estimate
  ##      criterion convergence criterion
  ##      max_iterations limit to number of iterations

  if nargin<4
    criterion = 1e-5;
  endif
  
  if nargin <5
    max_iterations = 20;
  endif

  alpha = 1.0;
  e_last = 1e20;
  error=1e10;
  theta = theta_0;
  Theta = [];
  Error = [];
  Y = [];
  iterations = 0;
  while abs(e_last-error)>criterion
    theta
    iterations = iterations + 1;
    e_last = error;
    [t,y,y_theta] = mtt_ssimulate(system_name,theta); # Simulate system
    Theta = [Theta theta];	# Save parameters
    Y = [Y y];			# Save output
    E = (y - y_s);		# Error(t)
    error = (E'*E);			# Sum the error
    Error = [Error error];
    theta = theta - alpha*((y_theta'*y_theta)\(y_theta'*E));
  endwhile

endfunction

Added mttroot/mtt/bin/trans/m/mtt_ssimulate.m version [5b7c3603ee].





































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
function [t,y,y_theta] = mtt_ssimulate(system_name,theta);
  ## usage: [t,y,y_theta] = mtt_ssimulate(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
  y_theta = [];
   for i=1:length(theta)
     args="";
     for j=1:length(theta)
       i_sensitivity=(j==i);
       args = sprintf("%s%i %g ",args, i_sensitivity, 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)];
   endfor

endfunction




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