Tracking an Oscillator

Tracking an Oscillator#

This example continues the Channel Memory simulation demonstration.

A two-operator problem is solved over a network with channel memory, parameterized by a forgetting factor \(\alpha>0\)

\[\begin{split}\begin{align*} z^1_k &= u_k^1 - \alpha z^1_{k-1}, & y_k^1 &= w_k^1 - \alpha y_{k-1}^1, \\ z^2_k &= u_k^2, & y_k^2 &= w_k^2. \end{align*}\end{split}\]

An \(\alpha\)-dependent controller

\[\begin{split} \mat{c}{x_{k+1}^c \hl u_k^1 \\ u_k^2} = \mat{c|cc}{I & -\gamma \lambda & \frac{ -\gamma \lambda}{\alpha+1} \hl (1+\alpha) I & 0 & 0 \\ I & -\gamma I & -\frac{ -\gamma }{\alpha+1} I } \mat{c}{x_{k}^c \hl y_k^1 \\ y_k^2}\end{split}\]

is used to solve the problem with values of \(\gamma = 0.4, \lambda = 0.2\). The operator \(F_1\) is the subdifferential of a function in \(S_{1, 5}\). The operator \(F_2\) is the subdifferential of a function in \(S_{0, \infty}\).

Figure 1 plots Analysis-computed upper-bounds on \(\rho\) as the forgetting factor \(\alpha\) increases. The same order is used for each operator. \(\rho=2\) is used as an upper bound in bisection: a rate of \(\rho<2\) is certified as a worst-case bound.

../../_images/channel_memory_alpha_dark.png

Figure 1: Convergence rate v.s. forgetting factor#

../../_images/channel_memory_alpha_light.png

Figure 1: Convergence rate v.s. forgetting factor#

Code for Channel Memory sweep analysis#
 1%pose the operator class
 2m = 1; L = 5;
 3op1 = op_sml(m, L);
 4
 5op2 = op_pcc();
 6ops = {op1, op2};
 7
 8
 9%use a transfer function representation 
10%to model the channel memory
11z = tf('z', 1);
12
13%sweep over alpha and order
14Nalpha = 100;
15alpha_list = logspace(-2, 1, Nalpha);
16orderlist = {0, [1, 0], [0, 1], [1, 1], [2, 0], [0,2]};
17Norder = length(orderlist);
18rho_list = zeros(Nalpha, Norder);
19
20
21parfor i = 1:Nalpha
22    alpha = alpha_list(i);
23    ascale = (2*(alpha+1));
24    
25    %form the channel memory network
26    P = [0, 0, z/(z+alpha), 0;
27        0 , 0, 0, 1;
28        z/(z+alpha), 0, 0, 0;
29        0, 1, 0, 0];
30    
31    network = genplant(P);
32    network.nw = 2; network.nu = 2;
33    network.nz = 2; network.ny = 2;
34
35    %create the controller
36    gamma = 0.4;
37    lambda = 0.2;
38
39    K = ss([1], [-gamma*lambda, -gamma*lambda/(alpha+1)], ...
40        [1+alpha; 1], [0, 0; -gamma, -gamma/(alpha+1)],1);
41    
42    sys = opt_system(ops, network, K);
43    
44    %solve Analysis at each order
45    man = opt_analysis(sys);    
46    for j = 1:Norder
47        order = {orderlist{j}, orderlist{j}};
48        sol = man.bisect(order);
49        rho_list(i, j) = sol.rho;
50    end
51       
52end