Tracking an Oscillator#
This example continues the Oscillator simulation demonstration.
Figure 1 plots bounds on the convergence rate \(\rho\) as \(\omega\) is swept in the range \([-\pi, \pi]\). Each Analysis run uses the same orders for each operator. The \(\rho=1\) stability boundary is shown by the gray dashed line, convergence is certified if \(\rho <1\).
Figure 1: Convergence rate bound v.s. \(\omega\)#
Figure 1: Convergence rate bound v.s. \(\omega\)#
Figure 1 certifies algorithm convergence at \(\pi/4 \approx 0.7854\), and does not certify convergence at \(\pi/2\approx 1.5708\). Figure 2 plots an algorithm trajectory at the certified-convergent \(\omega = \pi/4\).
Figure 2: Convergence at \(\omega = \pi/4\)#
Figure 2: Convergence at \(\omega = \pi/4\)#
Figure 3 plots a nonconvergent algorithm trajectory at \(\omega = \pi/2\).
Figure 3: Nonconvergence at \(\omega = \pi/2\)#
Figure 3: Nonconvergence at \(\omega = \pi/2\)#
1%define the operators
2m = [1, 1, 1, 1];
3L = [2, 4, 6, 8];
4s = length(m);
5
6op_list = cell(s, 1);
7for i = 1:s
8 op_list{i}= op_sml(m(i), L(i));
9end
10
11%parameters of the controller, independent of omega
12b0 = [-0.05; -0.1; -0.05];
13b1 = -0.05;
14b2 = -0.1;
15
16BK = b0 * ones(1, s);
17CK = ones(s, 1) * Rbeta;
18
19DK = zeros(s);
20DK(end, :)= DK(end, :) + b1;
21DK(:, 1)= DK(:, 1) + b2;
22
23
24%sweep over the angle
25Nomega = 320;
26omegalist = pi * linspace(-1, 1, Nomega);
27
28rholist = zeros(1, Nomega);
29
30order = {2, 2, 2, 2};
31parfor i = 1:length(omegalist)
32
33 %define the path of the optimal solution
34 theta = omegalist(i);
35 Sbeta = blkdiag(1, givens(cos(theta), sin(theta)));
36 Rbeta = [1, 1, 0];
37
38
39 %create the controller
40 K = ss(Sbeta, BK, CK, DK, 1);
41
42
43 %form the system
44 sys = opt_system(op_list, [], K);
45
46
47 %run Analysis and store result
48 man = opt_analysis(sys);
49 sol = man.bisect(order);
50
51 rholist(i) = sol.rho;
52end