1- using GenericLinearAlgebra
1+ using GenericLinearAlgebra, RobustAndOptimalControl, ControlSystems
22
3- # # Test higher prec hinfsyn
4- # Example from "A robust numerical method for the γ-iteration in H∞ control"
5- a = b = d = n = e2 = 1.0
6- e1 = 0
7- A = - 1.0 I (2 )
8- B1 = [e1 0 ; 0 e2]
9- B2 = ones (2 )
10- C1 = diagm ([a, b])
11- C2 = [d n]
12- D11 = diagm ([0.5 , 0.5 ])
13- D12 = [0 ; 1 ]
14- D21 = [0 1 ]
15- D22 = [0 ;;]
16- P = ss (A,B1,B2,C1,C2,D11,D12,D21,D22)
17- K, γ = hinfsynthesize (P, γrel= 1.01 , ftype= BigFloat)[1 : 2 ] #
18- @test_broken hinfnorm2 (lft (P, K)) ≈ 0.806 atol= 1e-2
19- @test_broken γ ≈ 0.806 atol= 1e-2 # Not numerically robust enough to pass this test despite highprec
3+ @testset " Numerical difficulties 1" begin
4+ # # Test higher prec hinfsyn
5+ # Example from "A robust numerical method for the γ-iteration in H∞ control"
6+ a = b = d = n = e2 = 1.0
7+ e1 = 0
8+ A = - 1.0 I (2 )
9+ B1 = [e1 0 ; 0 e2]
10+ B2 = ones (2 )
11+ C1 = diagm ([a, b])
12+ C2 = [d n]
13+ D11 = diagm ([0.5 , 0.5 ])
14+ D12 = [0 ; 1 ]
15+ D21 = [0 1 ]
16+ D22 = [0 ;;]
17+ P = ss (A,B1,B2,C1,C2,D11,D12,D21,D22)
18+ K, γ = hinfsynthesize (P, γrel= 1.01 , ftype= BigFloat)[1 : 2 ] #
19+ @test_broken hinfnorm2 (lft (P, K)) ≈ 0.806 atol= 1e-2
20+ @test_broken γ ≈ 0.806 atol= 1e-2 # Not numerically robust enough to pass this test despite highprec
21+ end
22+
23+
24+ @testset " Numerical difficulties 2" begin
25+ # # Numerically difficult problem instance
26+ Gsyn3A = [0.0 1.0 0.0 ; - 1.2000000000000002e-6 - 0.12000999999999999 0.0 ; - 11.2 - 0.0 - 2.0e-7 ]
27+ Gsyn3B = [0.0 0.0 ; 0.0 1.0 ; 1.0 0.0 ]
28+ Gsyn3C = [- 7.466666666666666 - 0.0 19.999999866666666 ; 0.0 0.0 0.0 ; - 11.2 - 0.0 0.0 ]
29+ Gsyn3D = [0.6666666666666666 0.0 ; 0.0 1.0 ; 1.0 - 0.0 ]
30+ Gsyn3 = ss (Gsyn3A, Gsyn3B, Gsyn3C, Gsyn3D)
31+ Gsyn = partition (Gsyn3, 1 , 2 )
32+ K, γ = hinfsynthesize (Gsyn, ftype= BigFloat, γrel = 1 )[1 : 2 ]
33+ @test_broken γ ≈ 4.4825150 atol= 1e-2 # value by slicot
34+ @test γ ≈ 4.4825150 atol= 2e-2 # slightly less strict test is passed
35+
36+
37+ Gsynb, _ = balance_statespace (Gsyn, false )
38+ K, γ = hinfsynthesize (Gsynb, ftype= BigFloat, γrel = 1 )[1 : 2 ]
39+ @test_broken γ ≈ 4.4825150 atol= 1e-2 # value by slicot
40+ @test γ ≈ 4.4825150 atol= 2e-2 # slightly less strict test is passed
41+ end
0 commit comments