Overview
Comment:Sanity test on w
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: d1d13866616186053a2d5e705efea1768f5e5e5a409f3802a4e7e0a64b195395
User & Date: gawthrop@users.sourceforge.net on 2003-05-22 17:26:52
Other Links: branch diff | manifest | tags
Context
2003-06-06
06:40:34
Made compatible with current MTT. check-in: 9997e50efa user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-05-22
17:26:52
Sanity test on w check-in: d1d1386661 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-05-16
14:29:54
Linear intermittent PPP for real-time control -- Lego RCX in first instance check-in: 5b07002260 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/control/PPP/ppp_lin_run.m from [572a950a69] to [566d14aa8d].

39
40
41
42
43
44
45
46








47
48
49
50
51
52
53
  endif
  
  if nargin<6
    p_o.sigma = 0.001;
  endif

  if !struct_contains(p_c,"N")
    p_c.N = 10;			# Number of small samples








  endif
  
  if !struct_contains(p_c,"A_w")
    p_c.A_w = 0;
  endif
  
  if !struct_contains(p_c,"A_u")







|
>
>
>
>
>
>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  endif
  
  if nargin<6
    p_o.sigma = 0.001;
  endif

  if !struct_contains(p_c,"N")
    p_c.N = 10;			# Number of small samples per large sample
  endif
  
  if !struct_contains(p_c,"delta_ol")
    p_c.delta_ol = 1.0;	# OL sample interval
  endif
  
  if !struct_contains(p_c,"T")
    p_c.T = 5.0;			# Last time point.
  endif
  
  if !struct_contains(p_c,"A_w")
    p_c.A_w = 0;
  endif
  
  if !struct_contains(p_c,"A_u")
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
  
  ## System
  sys = mtt2sys(Name); # Create system
  [A,B,C,D] = sys2ss(sys);	# SS form
  [n_x, n_u, n_y] = abcddim(A,B,C,D)
  ol_poles = eig(A)







  ## Initialise
  x_0 = zeros(n_x,1);
  x_est = x_0;

  ## Initilise simulation state
  x = x_0;
##x(2) = 0.2;		
		#   x(2) = y_0(1);
				#   x(4) = y_0(2);

  if ControlType==0		# Step input
    N = 50;			# Number of small samples
    I = 1;			# Number of large samples 

    K_w = zeros(p_c.N_u,n_y);
    K_w(1,1) = 1;
    K_w(2,1) = -1;
    K_x = zeros(p_c.N_u,n_x);
    U = K_w*w;			# Initial control U
  else				# PPP control
    I = ceil(50/p_c.N);		# Number of large samples
    tau = [10:0.1:11]*(2/a_u);	# Time horizons
    [k_x,k_w,K_x,K_w] = ppp_lin(A,B,C,D,p_c.A_u,p_c.A_w,tau); # Design
    U = K_w*w			# Initial control U

    ## Checks
    cl_poles = eig(A - B*k_x)
  endif







>
>
>
>
>
>











<
|
>






|







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
  
  ## System
  sys = mtt2sys(Name); # Create system
  [A,B,C,D] = sys2ss(sys);	# SS form
  [n_x, n_u, n_y] = abcddim(A,B,C,D)
  ol_poles = eig(A)

  ## Check w.
  [n_w,m_w] = size(w);
  if ( (n_w<>n_y) || (m_w<>1) )
    error(sprintf("ppp_lin_run: w must a column vector with %i elements",n_y));
  endif
  
  ## Initialise
  x_0 = zeros(n_x,1);
  x_est = x_0;

  ## Initilise simulation state
  x = x_0;
##x(2) = 0.2;		
		#   x(2) = y_0(1);
				#   x(4) = y_0(2);

  if ControlType==0		# Step input

    I = 1;			# 1 large sample
    p_c.delta_ol = p_c.T	# I
    K_w = zeros(p_c.N_u,n_y);
    K_w(1,1) = 1;
    K_w(2,1) = -1;
    K_x = zeros(p_c.N_u,n_x);
    U = K_w*w;			# Initial control U
  else				# PPP control
    I = ceil(p_c.T/p_c.delta_ol); # Number of large samples
    tau = [10:0.1:11]*(2/a_u);	# Time horizons
    [k_x,k_w,K_x,K_w] = ppp_lin(A,B,C,D,p_c.A_u,p_c.A_w,tau); # Design
    U = K_w*w			# Initial control U

    ## Checks
    cl_poles = eig(A - B*k_x)
  endif


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