Overview
Comment:Further modifications. Now works on rcPPP
-- next jobs:
add identification to ppp_nlin_sim
create real-time ppp_nlin_run
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: c8c0565976bcad0b060f2cb9a5595c30272c1618a169ab9c8af83d48af96cf12
User & Date: gawthrop@users.sourceforge.net on 2001-05-26 18:36:43
Other Links: branch diff | manifest | tags
Context
2001-05-30
19:57:08
Fixes to sensitivity components for non-linear PPP check-in: ad7c2478fe user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-05-26
18:36:43
Further modifications. Now works on rcPPP
-- next jobs:
add identification to ppp_nlin_sim
create real-time ppp_nlin_run
check-in: c8c0565976 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:46:38
Updated to account for new nonlinear ppp check-in: b98931d137 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [56e4bd9cb2] to [7d4b078005].

12
13
14
15
16
17
18




19
20
21
22
23
24
25
# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$




## Revision 1.309  2001/04/28 03:15:03  geraint
## Fixed comment (interfered with "mtt help representations").
##
## Revision 1.308  2001/04/25 22:17:45  geraint
## Fixed icd.txt2 dependency.
##
## Revision 1.307  2001/04/15 21:15:41  geraint







>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.310  2001/05/08 08:30:12  gawthrop
## Added line to reverse the x^y --> pow(x,y) in default  _simp file to
## prettyfy LaTeX
##
## Revision 1.309  2001/04/28 03:15:03  geraint
## Fixed comment (interfered with "mtt help representations").
##
## Revision 1.308  2001/04/25 22:17:45  geraint
## Fixed icd.txt2 dependency.
##
## Revision 1.307  2001/04/15 21:15:41  geraint
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641




2642
2643
2644
2645
2646
2647
2648
		$1_ode.p $1_odeo.p  $1_logic.p
	mtt_m2p $1_ode2odes.m $integration_method $stdin
endif

$1_ode2odes.c: $1_ode2odes.p 
	mtt_p2c $info_switch $1 ode2odes

#SUMMARY sim Octave simulation function (m)

ifeq ($computation,octave)
$1_sim.m: $1_def.r $1_sympar.txt $1_cse.m $1_cseo.m $1_smxa.m $1_smxax.m $1_numpar.m $1_state.m
	mtt_make_sim $1 $integration_method $computation 
endif

ifeq ($computation,c)
$1_sim.m: $1_def.r $1_sympar.txt $1_ode2odes.out $1_numpar.m $1_state.m
	mtt_make_sim $1 $integration_method $computation 
endif

#SUMMARY ssim Octave sensitivity simulation function (m)
$1_ssim.m: $1_def.r
	make_ssim $1 m





#SUMMARY obs	observer equations for CGPC (r)
#SUMMARY obs*	observer equations for CGPC (m)
#SUMMARY obs	observer equations for CGPC (tex)
#SUMMARY obs*	observer equations for CGPC (view)
#SUMMARY obs	observer equations for CGPC (ps)
#Observer functions for GPC







|

|
|

|

|
|
|
|




>
>
>
>







2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
		$1_ode.p $1_odeo.p  $1_logic.p
	mtt_m2p $1_ode2odes.m $integration_method $stdin
endif

$1_ode2odes.c: $1_ode2odes.p 
	mtt_p2c $info_switch $1 ode2odes

##SUMMARY sim Octave simulation function (m)

#ifeq ($computation,octave)
#$1_sim.m: $1_def.r $1_sympar.txt $1_cse.m $1_cseo.m $1_smxa.m $1_smxax.m $1_numpar.m $1_state.m
	mtt_make_sim $1 $integration_method $computation 
#endif

#ifeq ($computation,c)
#$1_sim.m: $1_def.r $1_sympar.txt $1_ode2odes.out $1_numpar.m $1_state.m
#	mtt_make_sim $1 $integration_method $computation 
#endif

#SUMMARY ssim Octave sensitivity simulation function (m)
$1_ssim.m: $1_def.r
	make_ssim $1 m

#SUMMARY sim Octave simulation function (m)
$1_sim.m: $1_def.r
	make_sim $1 m

#SUMMARY obs	observer equations for CGPC (r)
#SUMMARY obs*	observer equations for CGPC (m)
#SUMMARY obs	observer equations for CGPC (tex)
#SUMMARY obs*	observer equations for CGPC (view)
#SUMMARY obs	observer equations for CGPC (ps)
#Observer functions for GPC

Modified mttroot/mtt/bin/trans/mtt_header from [63911c75bc] to [f2723c0fc8].

8
9
10
11
12
13
14



15
16
17
18
19
20
21
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.32  2001/05/24 07:42:12  gawthrop
## Included and updated the missing tf_r2m
##
## Revision 1.31  2001/04/03 14:49:42  gawthrop
## Revised to incorporate new ssim (sensitivity simulation)
## representation (m only just now).
##







>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.33  2001/05/26 15:46:38  gawthrop
## Updated to account for new nonlinear ppp
##
## Revision 1.32  2001/05/24 07:42:12  gawthrop
## Included and updated the missing tf_r2m
##
## Revision 1.31  2001/04/03 14:49:42  gawthrop
## Revised to incorporate new ssim (sensitivity simulation)
## representation (m only just now).
##
283
284
285
286
287
288
289







290
291
292
293
294
295
296
	states=no;
	inputs=no;
	parameters=yes;
        output=mttx
        args=mttpar
        declarestates=yes
	;;







    ssim)
	states=no;
        inputs=no;
	parameters=no;
        output='y,y_par,x'
        args='x0,par,simpar,u,index'
	;;







>
>
>
>
>
>
>







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
	states=no;
	inputs=no;
	parameters=yes;
        output=mttx
        args=mttpar
        declarestates=yes
	;;
    sim)
	states=no;
        inputs=no;
	parameters=no;
        output='y,x'
        args='x0,par,simpar,u'
	;;
    ssim)
	states=no;
        inputs=no;
	parameters=no;
        output='y,y_par,x'
        args='x0,par,simpar,u,index'
	;;

Modified mttroot/mtt/lib/control/PPP/ppp_nlin_sim.m from [7a76a326ac] to [8be58fd40d].

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
  

  ## Names
  s_system_name = sprintf("s%s", system_name);

  ## System details -- defines simulation within ol interval
  par = eval(sprintf("%s_numpar;", system_name));
  simpar = eval(sprintf("%s_simpar;", system_name))
  x_0 = eval(sprintf("%s_state(par);", system_name))
  [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name));

  ## Sensitivity system details -- defines moving horizon simulation
  simpars = eval(sprintf("%s_simpar;", s_system_name))
  sympars = eval(sprintf("%s_sympar;", s_system_name));
  pars = eval(sprintf("%s_numpar;", s_system_name));

  ## Times
  ## -- within opt horizon
  n_Tau = round(simpars.last/simpars.dt)
  dtau = simpars.dt
  Tau = [0:n_Tau-1]'*dtau;
  [n_tau,n_w] = size(w_s);
  tau = Tau(n_Tau-n_tau+1:n_Tau);
  w = w_s(length(w_s));		# Final value of setpoint

  ## -- within ol interval
  n_t = round(simpar.last/simpar.dt)
  dt = simpar.dt;
  t_ol = [0:n_t-1]'*dt;
  T_ol = n_t*dt;

  ## Weight and moving-horizon setpoint
#   weight = [zeros(n_y,n_Tau-n_tau), ones(n_y,n_tau)]; 
#   w_s = w*ones(n_tau,1);

  ## Create input basis functions
  [n_U,junk] = size(A_u);

  ## For moving horizon
  eA = expm(A_u*dtau);
  u_star_i = ones(n_U,1);
  u_star_tau = [];







|
|



|





|
|






|




<
<
<
<







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
  

  ## Names
  s_system_name = sprintf("s%s", system_name);

  ## System details -- defines simulation within ol interval
  par = eval(sprintf("%s_numpar;", system_name));
  simpar = eval(sprintf("%s_simpar;", system_name));
  x_0 = eval(sprintf("%s_state(par);", system_name));
  [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name));

  ## Sensitivity system details -- defines moving horizon simulation
  simpars = eval(sprintf("%s_simpar;", s_system_name));
  sympars = eval(sprintf("%s_sympar;", s_system_name));
  pars = eval(sprintf("%s_numpar;", s_system_name));

  ## Times
  ## -- within opt horizon
  n_Tau = round(simpars.last/simpars.dt);
  dtau = simpars.dt;
  Tau = [0:n_Tau-1]'*dtau;
  [n_tau,n_w] = size(w_s);
  tau = Tau(n_Tau-n_tau+1:n_Tau);
  w = w_s(length(w_s));		# Final value of setpoint

  ## -- within ol interval
  n_t = round(simpar.last/simpar.dt);
  dt = simpar.dt;
  t_ol = [0:n_t-1]'*dt;
  T_ol = n_t*dt;





  ## Create input basis functions
  [n_U,junk] = size(A_u);

  ## For moving horizon
  eA = expm(A_u*dtau);
  u_star_i = ones(n_U,1);
  u_star_tau = [];
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
      pars(i_ppp(:,1)) = U;	# Put final value of U into the parameter vector
    else
      Error = [];
    endif
    opt_time = time-tick;  
    printf("Optimisation %i took %i iterations and %2.2f sec\n", i, \
	   length(Error), opt_time);
    ##title(sprintf("Moving horizon trajectories: Interval %i",i));
    ##grid;
    ##plot(tau,Y)
    
    ## Generate control
    u_ol = u_star_t*U;		# Not used - just for show

    ## Simulate system over one ol interval
    ## (Assumes that first gain parameter is one)
    ##U = [u_ol zeros(n_t,n_u-1)]; # Generate the vector input
    [y_ol,y_s,x_ol] = eval(sprintf("%s_ssim(x_0s, pars, simpar, u_star_t);", s_system_name));
    
    x_0  = x_ol(n_t+1,:)';	# Extract state for next time
    y_ol = y_ol(1:n_t,:);	# Avoid extra points due to rounding error 
    x_ol = x_ol(1:n_t,:);	# Avoid extra points due to rounding error 


    y = [y; y_ol];
    x = [x; x_ol];







<
<
<





<
<
|
|







148
149
150
151
152
153
154



155
156
157
158
159


160
161
162
163
164
165
166
167
168
      pars(i_ppp(:,1)) = U;	# Put final value of U into the parameter vector
    else
      Error = [];
    endif
    opt_time = time-tick;  
    printf("Optimisation %i took %i iterations and %2.2f sec\n", i, \
	   length(Error), opt_time);



    
    ## Generate control
    u_ol = u_star_t*U;		# Not used - just for show

    ## Simulate system over one ol interval


    [y_ol,ys_ol,x_ol] = eval(sprintf("%s_ssim(x_0s, pars, simpar, u_star_t);", s_system_name));

    x_0  = x_ol(n_t+1,:)';	# Extract state for next time
    y_ol = y_ol(1:n_t,:);	# Avoid extra points due to rounding error 
    x_ol = x_ol(1:n_t,:);	# Avoid extra points due to rounding error 


    y = [y; y_ol];
    x = [x; x_ol];

Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m from [df50e03584] to [0d87023b1f].

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
62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
## Figures.m
## Makes figures for the rc_PPP exasmple.
## $Log$



## Revision 1.1  2000/05/17 09:14:37  peterg
## Initial revision
##
system_name = "rcPPP";

## Uncomment the following the first time
## (Or do ./Make rcPPP in this directory)

## MTT stuff for the system simulation
##system("Make rcPPP");



t_s=[0:0.1:10];
u = [ones(1,length(t_s));ones(1,length(t_s))];
x_0 = rcPPP_state;
par  = rcPPP_numpar;

## Simulate the system
tick=time;
[y,x] = rcPPP_sim(x_0,u,t_s,par);

Elapsed = time-tick
plot(t_s,y,t_s,x);

## Simulate the system to give just the final few point
t_s1 = [9:0.1:10];
tick=time;
[y,x] = rcPPP_sim(x_0,u,t_s1,par);
Elapsed = time-tick
plot(t_s1,y,t_s1,x);

## Sensitivity system simulation parameters
x_0s = srcPPP_state;

pars  = srcPPP_numpar;
sympars  = srcPPP_sympar;













## Simulate the sensitivity system
sensitivities = [sympars.ppp_1s,sympars.ppp_2s,sympars.rs]

tick=time;
[y,ys] = srcPPP_sim(x_0s,u,t_s,[sympars.r,2.0],sensitivities);
Elapsed = time-tick
plot(t_s,y,t_s,ys);

### PPP parameters
A_w = 0;
A_u = ppp_aug(A_w,laguerre_matrix(1,10)); # Specify basis functions: constant & exp(-5t)
tau = [0.9:0.01:1];		# Optimisation interval
t_ol = [0:0.01:0.2];		# Open-loop interval
N = 5;				# Number of open-loop intervals in simulation
w = 1;				# Setpoint


## Linear system





[A,B,C,D] = rcPPP_sm;
Q = 1;
w = 1;
ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau,Q,w,x_0);
psfig("rcPPP_lin");

## Simulate non-linear PPP (on this linear system)
extras.U_initial = "zero";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 10;
extras.alpha = 0.1;
extras.verbose = 0;


##  -- with no optimisation using linear PPP with continuation
extras.U_initial = "linear";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 0;
[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras);

##  -- with no optimisation using linear PPP at each step
extras.U_initial = "linear";
extras.U_next = "linear";
extras.criterion = 1e-5;
extras.max_iterations = 0;
[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras);

##  -- with no optimisation using nonlinear PPP with continuation
extras.U_initial = "zero";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 100;
[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras);


## Plots
title("");

## U, U_c and U_l
I = 1:N;
IU1 = [I' U(1,:)'];
IU1_c = [I' U_c(1,:)'];
IU1_l = [I' U_l(1,:)'];
gset grid; xlabel "Interval"
gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1"
psfig("rcPPP_U1");

IU2 = [I' U(2,:)'];
IU2_c = [I' U_c(2,:)'];
IU2_l = [I' U_l(2,:)'];
gset grid; xlabel "Interval "
gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2"
psfig("rcPPP_U2");

## y & u
gset grid; xlabel "Time (sec)"
ty = [t' y'] ; tu =  [t' u']; 
gplot ty title "Output", tu title "Input"

psfig("rcPPP_yu");

title("");
gset grid; xlabel "Time (sec)"
ty_c = [t' y_c'] ; 
ty_l = [t' y_l'] ; 
ty = [t' y'] ; 
tu =  [t' u']; 
gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation"
psfig("rcPPP_ylco");
 



>
>
>











|
|
|
<
|
<

|
|
|
>
|
<

|
<
|
|
|
|


|
>

|

>
>
>
>
>
>
>
>
>
>
>
>

|
>

|

|


<
<


|

>


>
>
>
>
>
|


|









>






|






|

|




|






|
|
|
|




|
|
|






|




<

|
|
|
|



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


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
## Figures.m
## Makes figures for the rc_PPP exasmple.
## $Log$
## Revision 1.2  2000/05/17 17:02:58  peterg
## Fixed documentation
##
## Revision 1.1  2000/05/17 09:14:37  peterg
## Initial revision
##
system_name = "rcPPP";

## Uncomment the following the first time
## (Or do ./Make rcPPP in this directory)

## MTT stuff for the system simulation
##system("Make rcPPP");

# ## System info
par  = rcPPP_numpar;
simpar  = rcPPP_simpar;

x_0 = rcPPP_state(par);


# ## Set up the input
# t = [0:simpar.dt:simpar.last];
# A_w = 0;
# A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T)
# u = ppp_ustar(A_u,1,t,0,0);


# ## Simulate the system

# tick=time;
# [y,x] = rcPPP_sim(x_0,par,simpar,u);
# Elapsed = time-tick
# plot(t,y)

## Sensitivity system simulation parameters
simpars  = srcPPP_simpar;
sympars  = srcPPP_sympar;
pars  = srcPPP_numpar;
x_0s = srcPPP_state(pars);

t = [0:simpars.dt:simpars.last];
A_w = 0;
A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T)
u = ppp_ustar(A_u,1,t,0,0);


## Setup the indices of the adjustable stuff
i_ppp = [sympars.ppp_1, sympars.ppp_1s
	 sympars.ppp_2, sympars.ppp_2s]; # PPP params
i_par = [sympars.x_0,  sympars.x_0s
	 sympars.r,    sympars.rs]; # State and r component

## Simulate the sensitivity system
sensitivities = [i_ppp(:,2); i_par(:,2)]
u = ppp_ustar(A_u,1,t,0,0); 
tick=time;
[y,ys,x] = srcPPP_ssim(x_0s,pars,simpars,u,sensitivities);
Elapsed = time-tick
plot(t,y,t,ys);

### PPP parameters


tau = [0.9:0.01:1];		# Optimisation interval
t_ol = [0:0.01:0.2];		# Open-loop interval
N = 10;				# Number of open-loop intervals in simulation
w = 1;				# Setpoint
w_s = w*ones(10,1);                  # The setpoint witnin the horizon

## Linear system
n_Tau = round(simpars.last/simpars.dt);
dtau = simpars.dt;
Tau = [0:n_Tau-1]'*dtau;
[n_tau,n_w] = size(w_s);
tau = Tau(n_Tau-n_tau+1:n_Tau)
[A,B,C,D] = rcPPP_sm(par);
Q = 1;
w = 1;
ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau',Q,w);
psfig("rcPPP_lin");

## Simulate non-linear PPP (on this linear system)
extras.U_initial = "zero";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 10;
extras.alpha = 0.1;
extras.verbose = 0;
extras.v = 1e-5;

##  -- with no optimisation using linear PPP with continuation
extras.U_initial = "linear";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 0;
[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras);

##  -- with no optimisation using linear PPP at each step
extras.U_initial = "linear";
extras.U_next = "linear";
extras.criterion = 1e-5;
extras.max_iterations = 0;
[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras);

##  -- with optimisation using nonlinear PPP with continuation
extras.U_initial = "zero";
extras.U_next = "continuation";
extras.criterion = 1e-5;
extras.max_iterations = 100;
[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras);


## Plots
title("");

## U, U_c and U_l
I = [1:N]';
IU1 = [I U(:,1)];
IU1_c = [I U_c(:,1)];
IU1_l = [I U_l(:,1)];
gset grid; xlabel "Interval"
gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1"
psfig("rcPPP_U1");

IU2 = [I U(:,2)];
IU2_c = [I U_c(:,2)];
IU2_l = [I U_l(:,2)];
gset grid; xlabel "Interval "
gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2"
psfig("rcPPP_U2");

## y & u
gset grid; xlabel "Time (sec)"
ty = [t y] ; tu =  [t u]; 
gplot ty title "Output", tu title "Input"

psfig("rcPPP_yu");


gset grid; xlabel "Time (sec)"
ty_c = [t y_c] ; 
ty_l = [t y_l] ; 
ty = [t y] ; 
tu =  [t u]; 
gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation"
psfig("rcPPP_ylco");
 

Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make from [e246f48d9d] to [37eadad62c].

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
#!/bin/sh

## Makes the files needed for Figures.m
## Copyright (C) 2000 by Peter J. Gawthrop









if [ -z "$1" ]; then
    echo Usage ./Make system_name
    exit
else


    echo "Making simulation for system $1 (for use in Figures.m)"


fi



## System
mtt -q -c -stdin $1 ode2odes out
mtt -q -c -stdin $1 sim m
mtt -q  $1 state m
mtt -q  $1 sympar m
mtt -q  $1 numpar m

## Sensitivity system
mtt -q -c -stdin -s s$1 ode2odes out
mtt -q -c -stdin -s s$1 sim m
mtt -q  -s s$1 state m
mtt -q  -s s$1 sympar m

mtt -q  -s s$1 numpar m


## Additional system reps for PPP
mtt -q  $1 sm m
mtt -q  $1 def m
mtt -q  -s s$1 def m





>
>
>
>
>
>
>
>

|


>
>
|
>
>


>
>

|
|
|
|
|


|
|
|
|
>
|
>


|
|
|
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
#!/bin/sh

## Makes the files needed for Figures.m
## Copyright (C) 2000 by Peter J. Gawthrop

sys=$1

if [ -z "$2" ]; then
    code=oct
else
    code=$2
fi

if [ -z "$1" ]; then
    echo 'Usage ./Make system_name [m|oct]'
    exit
else
    echo "Making sensitivity simulation for system ${sys} (code ${code})"
fi

if [ "${code}" == "oct" ]; then
    oct='-oct'
fi

echo Switches ${oct}

## System
mtt -q ${sys} sympar m
mtt -q ${sys} simpar m
mtt -q ${sys} numpar m
mtt -q ${sys} state m


## Sensitivity system
mtt -q -stdin -s s${sys} ssim m
mtt -q -stdin -s s${sys} sympar m
mtt -q -stdin -s s${sys} simpar m
mtt -q -stdin ${oct} -s s${sys} input ${code}
mtt -q -stdin ${oct} -s s${sys} ode2odes ${code}
mtt -q -stdin ${oct} -s s${sys} state ${code}
mtt -q -stdin ${oct} -s s${sys} numpar ${code}

## Additional system reps for PPP
mtt -q -stdin  ${sys} sm m
mtt -q -stdin  ${sys} def m
mtt -q -stdin  -s s${sys} def m

Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt from [622bfa4d7a] to [e921254017].

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
# -*-octave-*- Put Emacs into octave-mode
# Numerical parameter file (rcPPP_numpar.txt)
# Generated by MTT at Tue Apr 18 18:53:40 BST 2000

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Parameters
c = 	1.0; # CS,rcPPP
e_0 = 	1.0; # CS
e_s = 	1.0; # Se

ppp_1 = 	1.0; # rcPPP
ppp_2 = 	0.0; # rcPPP
q_0 = 	1.0; # rcPPP
r = 	1.0; # rcPPP

## Physical parameters
c =     1.0;
q_0 =   0.0;
r =     1.0;










>
>
>




|
|
>


<
<






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
# -*-octave-*- Put Emacs into octave-mode
# Numerical parameter file (rcPPP_numpar.txt)
# Generated by MTT at Tue Apr 18 18:53:40 BST 2000

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.1  2000/12/28 17:31:27  peterg
# %% To RCS
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Parameters
c = 	1.0; # CS,rcPPP
## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_0 = 	1.0; # CS
## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_s = 	1.0; # Se

ppp_1 = 	1.0; # rcPPP
ppp_2 = 	0.0; # rcPPP



## Physical parameters
c =     1.0;
q_0 =   0.0;
r =     1.0;

Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt from [4b14133500] to [bea2eabf2a].

1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
%% Label file for system srcPPP (srcPPP_lbl.txt)
%SUMMARY srcPPP
%DESCRIPTION 

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Port aliases

% Argument aliases
%ALIAS	$1	ppp_1









>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%% Label file for system srcPPP (srcPPP_lbl.txt)
%SUMMARY srcPPP
%DESCRIPTION 

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.1  2000/12/28 17:31:27  peterg
% %% To RCS
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Port aliases

% Argument aliases
%ALIAS	$1	ppp_1
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

%% Each line should be of one of the following forms:
%	     a comment (ie starting with %)
%	     component-name	cr_name	arg1,arg2,..argn
%	     blank

% ---- Component labels ----

	ppp_1	lin		ppp_1;ppp_1s
	ppp_2	lin		ppp_2;ppp_2s

% Component type CS
	c	lin		effort,c;x_0;cs;x_0s

% Component type De
	y	SS		external

% Component type R
	r	lin		flow,r;rs

% Component type Se
	u1	SS		external;0
	u2	SS		external;0









>
|
|


|





|






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

%% Each line should be of one of the following forms:
%	     a comment (ie starting with %)
%	     component-name	cr_name	arg1,arg2,..argn
%	     blank

% ---- Component labels ----
% Component type Ae
	ppp_1	slin		ppp_1;ppp_1s
	ppp_2	slin		ppp_2;ppp_2s

% Component type CS
	c	slin		effort,c;x_0;cs;x_0s

% Component type De
	y	SS		external

% Component type R
	r	slin		flow,r;rs

% Component type Se
	u1	SS		external;0
	u2	SS		external;0


Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt from [ab280343fb] to [00ff26769b].

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
# -*-octave-*- Put Emacs into octave-mode
# Numerical parameter file (srcPPP_numpar.txt)
# Generated by MTT at Tue Apr 18 09:13:31 BST 2000

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$

# %% $Log$
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


## Dummies
c = 0.0;
c_s = 0.0;
cs = 0.0;
e_0 = 0.0;
e_0s = 0.0;
e_s = 0.0;
g = 0.0;
k = 0.0;
k_s = 0.0;
ppp_1 = 0.0;
ppp_1s = 0.0;
ppp_2 = 0.0;
ppp_2s = 0.0;
r = 0.0;
rs = 0.0;
x_0 = 0.0;
x_0s = 0.0;

# Parameters
c = 	1.0; # CS,rcPPP
e_0 = 	1.0; # CS
e_s = 	1.0; # Se

ppp_1 = 	1.0; # rcPPP
ppp_2 = 	0.0; # rcPPP
#q_0 = 	1.0;

r = 	1.0; # rcPPP

## Physical parameters
c =     1.0;
q_0 =   0.0;

r =     1.0;

|
<
<
|
<
<
<
|
>
|
<
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|
|
|
|
>
|
|
|
>
|

|
|
|
>
|
|
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
## -*-octave-*- Put Emacs into octave-mode ##


 



## 
## System srcPPP, representation numpar, language txt; 
## File srcPPP_numpar.txt; 

## Generated by MTT on Sat May 26 08:47:19 BST 2001; 




















## Parameters
c	= 1.0;
r	= 1.0;

## PPP coefficients
ppp_1	= 0.0; # Default
ppp_2	= 1.0; # Default

## State
x_0	= 0.0; # Default

## Sensitivities
cs	= 0.0; # Default
ppp_1s	= 0.0; # Default
ppp_2s	= 0.0; # Default
rs	= 0.0; # Default
x_0s	= 0.0; # Default

Modified mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt from [8ad9573e20] to [370b8dff18].

1
2
3
4
5
6
7
8



9
10
11
12

13
14
15
16
17
18
# -*-octave-*- Put Emacs into octave-mode
# Simulation parameters for system srcPPP (srcPPP_simpar.txt)
# Generated by MTT on Fri Apr 14 17:43:36 BST 2000.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



###############################################################


LAST        = 10.0;       # Last time in simulation

DT          = 0.1;        # Print interval
STEPFACTOR  = 1;          # Integration steps per print interval
WMIN        = -1;         # Minimum frequency = 10^WMIN
WMAX        = 2;          # Maximum frequency = 10^WMAX
WSTEPS      = 100;        # Number of frequency steps
INPUT       = 1;          # Index of the input








>
>
>



|
>
|





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*-octave-*- Put Emacs into octave-mode
# Simulation parameters for system srcPPP (srcPPP_simpar.txt)
# Generated by MTT on Fri Apr 14 17:43:36 BST 2000.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  2000/12/28 17:31:27  peterg
## To RCS
##
###############################################################


FIRST        = 0.0;       # Last time in simulation
LAST        = 2.0;       # Last time in simulation
DT          = 0.01;        # Print interval
STEPFACTOR  = 1;          # Integration steps per print interval
WMIN        = -1;         # Minimum frequency = 10^WMIN
WMAX        = 2;          # Maximum frequency = 10^WMAX
WSTEPS      = 100;        # Number of frequency steps
INPUT       = 1;          # Index of the input


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