1
2
3
4
5
6
7
8
9
10
11
|
function [par,Par,Error,Y,iterations] = \
ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free,extras);
## Levenberg-Marquardt optimisation for PPP/MTT
## Usage: [par,Par,Error,Y,iterations] = ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free[,extras]);
## system_name String containing system name
## x_0 Initial state
## par_0 Initial parameter vector estimate
## simpar Simulation parameters:
## .first first time
## .dt time increment
## .stepfactor Euler integration step factor
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
|
function [par,Par,Error,Y,iterations,x] = \
ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free,extras);
## Levenberg-Marquardt optimisation for PPP/MTT
## Usage: [par,Par,Error,Y,iterations,x] = ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free[,extras]);
## system_name String containing system name
## x_0 Initial state
## par_0 Initial parameter vector estimate
## simpar Simulation parameters:
## .first first time
## .dt time increment
## .stepfactor Euler integration step factor
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3 2001/04/05 11:50:12 gawthrop
## Tidied up documentation + verbose mode
##
## Revision 1.2 2001/04/04 08:36:25 gawthrop
## Restuctured to be more logical.
## Data is now in columns to be compatible with MTT.
##
|
>
>
>
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## 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
## Tidied up documentation + verbose mode
##
## Revision 1.2 2001/04/04 08:36:25 gawthrop
## Restuctured to be more logical.
## Data is now in columns to be compatible with MTT.
##
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
while (abs(reduction)>extras.criterion)&&\
(abs(error)>extras.criterion)&&\
(iterations<extras.max_iterations)
iterations = iterations + 1; # Increment iteration counter
[y,y_par] = eval(sim_command); # Simulate
[N_data,N_y] = size(y);
if (N_y!=n_y)
mess = sprintf("n_y (%i) in data not same as n_y (%i) in model", n_y,N_y);
error(mess);
endif
|
|
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
while (abs(reduction)>extras.criterion)&&\
(abs(error)>extras.criterion)&&\
(iterations<extras.max_iterations)
iterations = iterations + 1; # Increment iteration counter
[y,y_par,x] = eval(sim_command); # Simulate
[N_data,N_y] = size(y);
if (N_y!=n_y)
mess = sprintf("n_y (%i) in data not same as n_y (%i) in model", n_y,N_y);
error(mess);
endif
|