# Mass-spring system: weighted norm

 Mass-spring system with masses on a line.

The weighted norm is given by

Since

we use the re-weighted scheme of Candes et al. ’08

where is the optimal sparse feedback gain from the previous re-weighted iteration.

At , the solution of the optimal control problem is computed from the positive definite solution of the algebraic Riccati equation. For a fixed value of , we initialize the re-weighted scheme using the solution from the previous value of . We update the weights until convergence or a maximum number of iterations is reached.

We next show the Matlab code and the computational results obtained using lqrsp.m. We set and select logarithmically-spaced points for .

## Matlab code

```% Mass-spring system

% State-space representation of the mass-spring system with N = 50 masses
N = 50;
I = eye(N,N);
Z = zeros(N,N);
T = toeplitz([2 -1 zeros(1,N-2)]);
A = [Z I; -T Z];
B1 = [Z; I];
B2 = [Z; I];
Q = eye(2*N);
R = 10*I;

% Compute the optimal sparse feedback gains
options = struct('method','wl1','gamval',logspace(-4,-1,50),...
'rho',100,'maxiter',100,'blksize',[1 1],'reweightedIter',5);
tic
solpath = lqrsp(A,B1,B2,Q,R,options);
toc
```

## Computational results

### Sparsity patterns

The number of nonzero elements in decreases with .

 The number of nonzero elements in the feedback gain as a function of . For a system with masses, there are total of elements in .

The number of nonzero sub-diagonals in both position and velocity feedback gains decreases with For large values of both and become diagonal matrices.

 Sparsity pattern of the feedback gain matrix for .
 Sparsity pattern of the feedback gain matrix for .
 Sparsity pattern of the feedback gain matrix for .

### Performance of sparse feedback gains

In the absence of sparsity constraints, i.e., at , the optimal controller

is obtained from the positive definite solution of the algebraic Riccati equation

As increases, the feedback gain becomes sparser and the quadratic performance deteriorates.

 Sparsity level:
 Performance loss:

The above results demonstrate that the optimal sparse feedback gain, with of nonzero elements relative to the centralized feedback gain , introduces performance loss of only compared to .

Sparsity vs. performance

### Diagonals of sparse feedback gains

The elements on the main diagonals of the optimal sparse feedback gains become larger as the number of the sub-diagonals of drops. Thus, in order to compensate for communication with smaller number of neighboring masses, each mass places more emphasis on its own position and velocity when forming control action.

 Diagonal of the optimal sparse for different values of : , , . Blue circles are almost on the top of the main diagonal of the optimal centralized .
 Diagonal of the optimal sparse for different values of : , , . Blue circles are almost on the top of the main diagonal of the optimal centralized .

Also see computational results obtained using other sparsity-promoting functions.

Back to mass-spring system example