Switched#
A switched linear system with \(N_s\) modes is described by a collection of \(N_s\) LTI systems (modes), and a directed, unweighted adjacency graph \(\mathcal{G}\) with \(N_s\) vertices. Each subsystem \(j\) of the switched system can be represented as
The function \(\theta: \N \rightarrow 1, \ldots, N_s\) chooses the active subsystem at time \(k\). A trajectory \((x, w, z, \theta)_{k \in \N}\) of a switched system satisfies the relations
System#
The algorithmic interconnection is
- class system.switched.opt_system_switched#
Bases:
system.generic.opt_system_interfaceOPT_SYSTEM_SWITCHED interconnection of network and operators polytopic setting: a cell A = sum theta_i A_i for parameters theta_i
useful for switched systems, periodic systems, and LPV systems
- Constructor Summary
- opt_system_switched(op, P, K, adj, bind, tracking)#
OPT_SYSTEM constructor
- Property Summary
- adj#
switching graph (adjacency matrix)
- Method Summary
- build_plant(iqc_data)#
BUILD_PLANT: form the plant to be used for analysis or synthesis
- Parameters:
iqc_data – from manager.iqc_op_all, information about the operator iqc descriptions
rho – exponential weighting
- Returns:
alg_psi – plant with filters (psi)
iqc_op – iqcs for the robust uncertainties
alg_loop – plant without filters, but after loop transformation (should be stable)
- discount_schedule(ordermax)#
DISCOUNT_SCHEDULE exponential weights encountered when applying the FIR filters :param ordermax: maximum order of the IQCs
- Return:
pow – Exponent sequence of discounts
- Example:
[0; 1; 2] -> rho.^[0; 1; 2] for uniform exponential stability [0; 0; 1] -> rho.^[0; 0; 1] for shuffled switched stability
- get_K(param)#
TODO: override this with parameters
- get_P(param)#
GET_P get the plant
- get_arcs()#
GET_ARCS get transitions in the adjacency matrix
- get_discount()#
which subsystems are exponentially discounted?
- get_tracked_opt(param)#
GET_TRACKED_OPT get the tracked position of the optimal solution
\(\eta^*_{k+1} = S_\beta \eta^*, \beta^*_{k} = R_\beta \eta_k\).
- Args:
param: structure of parameters
- Returns:
Sbeta – exosystem for optimal solution
Rbeta – output of optimal solution
- get_type()#
get the type of the switched system
- nxi()#
nxi: number of states in controller
- nxn()#
nxn: number of states in network
- ss_zy_wu(param)#
get state space matrices at the current parameter values
Regulator#
The subsystems for an open switched system with disturbance \(d\) and regulated error \(e\) may be described as
The one-step regulator equations for this system are to find \((\Pi_j, \Gamma_j, \Phi_j)_{j=1}^{N_s}\) satisfying
over all arcs \((i, j)\) in the graph \(\mathcal{G}\).
Certification of robust stability and feasibility of these regulator equations are sufficient but not necessary to prove convergence. If these regulator equations fail, then there may exist a well-posed and convergent optimization algorithm for this network, but opt-syn will not find it.
- class system.switched.regulator_switched#
Bases:
system.generic.regulator_interfaceREGULATOR_SWITCHED Regulator for switched systems
- Constructor Summary
- regulator_switched(sys)#
REGULATOR_SWITCHED build the regulator
- Method Summary
- Nss()#
NSS: number of subsystems
- connect_model(plant, ind, rho)#
connect the model (nominal regulator equation)
- Parameters:
plant – original system
ind – index to examine
rho – exponential weighting
- Return:
plant_model – plant and model together
- create_vars()#
CREATE_VARS: create variables that parameterize the nullspace :param param_null: should the nullspace be searched (as :type param_null: bool :param variables):
- Returns:
vars_reg – structure with fields (Pi, Gam, Phi)
- exosystem(param)#
get the exosystem at each mode/internal model
- get_model(ind, vars_reg)#
fetch the internal model (nominal) at mode ‘ind’ with edits, allow for selection of model within feasible set :param vars_reg: variables of the problem (regulator)
- Return:
model – the full-order internal model
- ns()#
NS number of states of exosystem
- reg_K_sys_all()#
assemble the closed-loop regulator equation system
- Returns:
reg_mat – matrix for regulator equation
reg_ans – vector for regulator equation solution
- reg_K_sys_indiv(param)#
control regulator equation checks (closed-loop)
- reg_sys_all()#
assemble the regulator equation system
- sol_K_reg_all(reg_sol)#
recover the solution to the regulator equation system
- sol_reg_all(reg_sol)#
recover the solution to the regulator equation system
LMI Analysis#
- class system.switched.lmi_analysis_switched#
Bases:
system.generic.lmi_analysis_interfaceLMI_ANALYSIS_SWITCHED analysis LMIs for algorithmic interconnections involving switched linear networks and controllers
- Constructor Summary
- lmi_analysis_switched(sys, config)#
LMI_DISPATCH_LTI Construct an instance of this class Detailed explanation goes here
- Method Summary
- Nss()#
NSS: Number of subsystems
- cons_dynamic(vars, cons, diss)#
CONS form the dissipation and sign constraints
- Parameters:
vars – variables of the problem
cons – accumulated constraints
diss (
diss_data) – structure describing the dissipation constraint %
- Returns:
cons – accumulated constraints
objective – term to be minimized
- create_vars_spec(cons, specs)#
CREATE_VARS_SPEC declare variables for the specifications
- Parameters:
cons – accumulated constraints
alg_psi – the filtered algorithmic interconnection
name – a name for the variable
- Returns:
vars_spec – variables of the problem in the specifications
cons – accumulated constraints
- create_vars_storage(cons, alg_psi, name)#
create_vars_storage create variables for the dissipation constraints. A cell of G(s) functions, one for each subsystem.
- Parameters:
cons – accumulated constraints
alg_psi – the filtered algorithmic interconnection
name – a name for the variable
- Returns:
vars_diss – variables of the problem in the dissipation constraints
cons – accumulated constraints
- h2(vars, cons, diss)#
H2: certificate of stochastic performance
- Parameters:
vars – variables of the problem
cons – accumulated constraints
diss (
diss_data) – structure describing the dissipation constraint
- Returns:
cons – accumulated constraints
objective – term to be minimized
con_M – PSD blocks for the dynamics constraint
- quad(vars, cons, diss)#
QUAD: certificate of infinite-horizon quadratic performance
- Parameters:
vars – variables of the problem
cons – accumulated constraints
diss (
diss_data) – structure describing the dissipation constraint
- Returns:
cons – accumulated constraints
objective – term to be minimized
con_M – PSD blocks for the dynamics constraint
LMI Synthesis#
- class system.switched.lmi_synthesis_switched#
Bases:
system.generic.lmi_synthesis_interfaceLMI_SYNTHESIS_SWITCHED synthesis LMIs for algorithmic interconnections involving switched linear networks and controllers
- Constructor Summary
- lmi_synthesis_switched(sys, config)#
LMI_SYNTHESIS_SWITCHED Constructor
- Method Summary
- Nss()#
NSS: Number of subsystems
- common()#
is a common storage function used?
- con_spread(cons, vars)#
CON_SPREAD increase numerical conditioning by separating the primal and dual blocks. Invoke this over multiple subsystems
- Parameters:
cons – accumulated constraints
GX – primal storage matrix
GY – dualstorage matrix
- Returns:
cons – accumulated constraints
- connect_model(diss, rho)#
connect the plant to the internal model :param diss: information about dissipation relation :type diss: diss_data :param rho: discount rate
- Returns:
P_model – generalized plant with internal model attached
- cons_dynamic(vars, cons, diss)#
CONS form the dissipation and sign constraints
- Parameters:
vars – variables of the problem
cons – accumulated constraints
diss (
diss_data) – structure describing the dissipation constraint
- Returns:
cons – accumulated constraints
objective – term to be minimized
- create_vars_controller(cons, alg_psi, name)#
CREATE_VARS_CONTROLLER create the nonlinearly-transformed controller matrices :param cons: accumulated constraints :param alg_psi: the filtered algorithmic interconnection :param name: a name for the variable :param D_mask: sparsity pattern for D of the controller
- Returns:
vars_K – controller variables [Ak, Bk, Ck, Dk], or some subset if elimination is used.
cons – accumulated constraints
- create_vars_storage(cons, alg_psi, name)#
create_vars_storage create variables for the dissipation constraints. A cell of G(s) functions, one for each subsystem.
- Parameters:
cons – accumulated constraints
alg_psi – the filtered algorithmic interconnection
name – a name for the variable
- Returns:
vars_diss – variables of the problem in the dissipation constraints
cons – accumulated constraints
- get_D_mask()#
GET_D_MASK get the direct feedthrough terms
- Returns:
D_mask – sparsity pattern for D of the controller
- get_storage_slack(vars_diss, vars_reg)#
GET_STORAGE_SLACK get the slack storage function matrix Gslack. Used in the extended LMI characterization of stability
- Parameters:
vars_diss – variables of the problem in the dissipation constraints
vars_reg – variables for regulator equation
- Returns:
G – the closed-loop storage matrix (warped)
- get_vars_involved(vars, ind)#
GET_VARS_INVOLVED get variables involved in the current mode :param vars: variables of the problem :param ind: index of subsystem/mode
- Returns:
vars_inv – variables (diss, reg) at subsystem ind
- h2(vars, cons, diss)#
H2: certificate of stochastic performance
- Parameters:
vars – variables of the problem
cons – accumulated constraints
diss (
diss_data) – structure describing the dissipation constraint
- Returns:
cons – accumulated constraints
objective – term to be minimized
con_M – PSD blocks for the dynamics constraint
- quad(vars, cons, diss)#
QUAD: certificate of infinite-horizon quadratic performance
- Parameters:
cons – accumulated constraints
specs – performance specifications
- Returns:
vars_spec – variables for performance specification cons: accumulated constraints
- recover_subcontroller(alg_psi, P_trans, sol)#
RECOVER_SUBCONTROLLER recover the subcontroller of the current mode/control
- Parameters:
alg_psi – the filtered algorithmic interconnection
P_trans – the transformed generalized plant before IQC
sol – solution structure
- Returns:
sol – solution structure
- recover_subcontroller_warp(P_trans, vars_rec)#
RECOVER_SUBCONTROLLER_WARP recover the nonlinearly warped controller :param alg_psi: the filtered algorithmic interconnection :param P_trans: the transformed generalized plant before IQC :param sol: solution structure
- Output:
K_nofeed: subcontroller without direct feedthrough Gcl: closed-loop storage matrix (original) Ycl: similarity transformation/nonlinear warping
- validate_recovery_gain(alg_trans, iqc_op_all)#
VALIDATE_RECOVERY validate that the system obeys the stability constraint (not yet supported)
- Parameters:
alg_trans – the plant with confirmed performance by LMIs
iqc_op_all – all IQCs
- Return:
gain – [Passivity index, H-infinity index].