|
1 | 1 | Ts = 4.0 |
2 | 2 | sys = [ tf(1.90,[18.0,1]) tf(1.90,[18.0,1]) tf(1.90,[18.0,1]); |
3 | 3 | tf(-0.74,[8.0,1]) tf(0.74,[8.0,1]) tf(-0.74,[8.0,1]) ] |
4 | | - |
| 4 | +#= |
5 | 5 | @testset "SteadyKalmanFilter construction" begin |
6 | 6 | linmodel1 = LinModel(sys,Ts,i_u=[1,2]) |
7 | 7 | skalmanfilter1 = SteadyKalmanFilter(linmodel1) |
|
549 | 549 | @test x̂ ≈ [0, 0] |
550 | 550 | @test isa(x̂, Vector{Float32}) |
551 | 551 | end |
552 | | - |
| 552 | +=# |
553 | 553 | @testset "MovingHorizonEstimator construction" begin |
554 | 554 | linmodel1 = LinModel(sys,Ts,i_d=[3]) |
555 | 555 | f(x,u,d) = linmodel1.A*x + linmodel1.Bu*u + linmodel1.Bd*d |
|
680 | 680 | mhe1 = MovingHorizonEstimator(linmodel1, He=1, nint_ym=0) |
681 | 681 | setconstraint!(mhe1, x̂min=[-51,-52], x̂max=[53,54]) |
682 | 682 | @test all((mhe1.con.X̂min, mhe1.con.X̂max) .≈ ([-51,-52], [53,54])) |
683 | | - @test all((mhe1.con.x̂min, mhe1.con.x̂max) .≈ ([-51,-52], [53,54])) |
| 683 | + @test all((mhe1.con.x̃min, mhe1.con.x̃max) .≈ ([-51,-52], [53,54])) |
684 | 684 | setconstraint!(mhe1, ŵmin=[-55,-56], ŵmax=[57,58]) |
685 | 685 | @test all((mhe1.con.Ŵmin, mhe1.con.Ŵmax) .≈ ([-55,-56], [57,58])) |
686 | 686 | setconstraint!(mhe1, v̂min=[-59,-60], v̂max=[61,62]) |
|
689 | 689 | mhe2 = MovingHorizonEstimator(linmodel1, He=4, nint_ym=0) |
690 | 690 | setconstraint!(mhe2, X̂min=-1(1:10), X̂max=1(1:10)) |
691 | 691 | @test all((mhe2.con.X̂min, mhe2.con.X̂max) .≈ (-1(3:10), 1(3:10))) |
692 | | - @test all((mhe2.con.x̂min, mhe2.con.x̂max) .≈ (-1(1:2), 1(1:2))) |
| 692 | + @test all((mhe2.con.x̃min, mhe2.con.x̃max) .≈ (-1(1:2), 1(1:2))) |
693 | 693 | setconstraint!(mhe2, Ŵmin=-1(11:18), Ŵmax=1(11:18)) |
694 | 694 | @test all((mhe2.con.Ŵmin, mhe2.con.Ŵmax) .≈ (-1(11:18), 1(11:18))) |
695 | 695 | setconstraint!(mhe2, V̂min=-1(31:38), V̂max=1(31:38)) |
|
0 commit comments