control_traj {netcontrol} | R Documentation |
Calculate the trajectory of a discrete linear time invariant system under a given control scheme
Description
This function is designed to work with control_scheme objects generated by control_scheme_DLI_freestate
In future versions of netcontrol
this function will be used to simulate any control trajectory.
For general details on control theory trajectories, see (Lewis et al. 2012).
Usage
control_traj(t_max, x_0, A, B, theta = NA, gamma = NA, control_scheme,
delta = NA, d_nosign = F, d_toggle = F, upper_bounds = NA,
lower_bounds = NA, u_pos = F)
Arguments
t_max |
Required. An integer total number of time points to determine the trajectory over |
x_0 |
Required. A |
A |
Required. A |
B |
Required. A |
theta |
Optional. A |
gamma |
Optional. A |
control_scheme |
Required. A list containing an entry labeled |
delta |
Optional. A vector of length 2, where the first entry contains the point of saturation for control inputs, and the second entry contains the saturation value for control inputs. |
d_nosign |
Optional. Boolean. If |
d_toggle |
Optional. Boolean. If |
upper_bounds |
Optional. A |
lower_bounds |
Optional. A |
u_pos |
Optional. Boolean. If |
Details
CAUTION: Use of saturation parameters and/or bound parameters delta, d_nosign, d_toggle, upper.bound, lower.bound, u.pos
leads to estimates of the optimal trajectory to be sub-optimal, as the Kalman gain calculations do not take any of those restrictions into account.
This functionality will be added later, and this caution statement removed at that time.
Value
A list containing 4 entries: a 't_max x p' state value matrix, a 't_max x p' observation matrix, a 't_max-1 x q' matrix of control inputs and a 't_max' length vector of cost function values.
References
Lewis FL, Vrabie DL, Syrmos VL (2012). Optimal Control, 3rd ed edition. Wiley, Hoboken. ISBN 978-0-470-63349-6..
Examples
A = matrix(c(0,-3,-2,2,-2,1,-1,2,-1), 3,3)
#Normalize rows to sum to 1
A = solve(diag(rowSums(A))) %*% A
B = S = Q_seq = R_seq = diag(3)
CS = control_scheme_DLI_freestate(100, A, B, S, Q_seq, R_seq)
traj = control_traj(100, rep(100,3), A, B, control_scheme = CS)
#First 5 control inputs
print(head(traj[[3]]))