nonlinear variable state space observer pole placement

11 views (last 30 days)
Hi,
i want to place some observer poles in dependency of an variable. The variable v is speed and it is changing with the time.
Example:
  1. option
syms v
A = [-1 2; v -1]
c = [0 1]
p = [-2; -3];
so,
L = place(A',c',p).'; %doesnt work
-----------
2.option
syms v lambda l1 l2
L =[l1;l2];
solve((det(lambda * [1 0; 0 1] - (A - L*c)) == (lambda+2)*(lambda+3)),[l1 l2]); %matlab doesn't eliminate lambda
l1 = ?
l2 = ?
do i need to calculate the det matrix by myself or can matlab help me in a faster way?
Thanks and Regards
Bernd

Accepted Answer

Paul
Paul on 16 Nov 2022
Hi Bernd,
Matlab assumes by default that all sym variables are complex, and this assumption can sometimes lead to unexpected results.
Your code works if we explicitly assume that v and the estimator gains are real (my experience is to include all relevant assumptions)
syms v l1 l2 real
syms lambda
A = [-1 2; v -1];
c = [0 1];
p = [-2; -3];
L = [l1;l2];
sol = solve((det(lambda * [1 0; 0 1] - (A - L*c)) == (lambda+2)*(lambda+3)),[l1 l2]) %matlab doesn't eliminate lambda
Warning: Solutions are only valid under certain conditions. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
sol = struct with fields:
l1: (2*v + 2)/v l2: 3
If v == 0, then A,C are not an observable pair, so we should exclude v == 0 from the analysis
assumeAlso(v ~= 0);
sol = solve((det(lambda * [1 0; 0 1] - (A - L*c)) == (lambda+2)*(lambda+3)),[l1 l2])
sol = struct with fields:
l1: (2*v + 2)/v l2: 3
Or more compactly without hardcoding anything
sol = solve(det(lambda*eye(2)- (A - L*c)) == poly2sym(poly(p),lambda),L)
sol = struct with fields:
l1: (2*v + 2)/v l2: 3
Or, using Ackerman's formula
alpha(lambda) = poly2sym(poly(p),lambda)
alpha(lambda) = 
O = [c ; c*A];
(A^2 + 5*A + 6*eye(2))*inv(O)*[0;1]
ans = 
  11 Comments
Bernd Pfeifer
Bernd Pfeifer on 27 Nov 2022
One question left.
Is there a reason why you chose the left eigenvectors for the assignement and not the right eigenvectors?
Regards
Bernd
Paul
Paul on 27 Nov 2022
Assuming you mean the right eigenvectors of A - LC, I didn't see how that could work, because we need L (or transpose(L) ) to multiply V, but with a right eigvector we get a term LCV.

Sign in to comment.

More Answers (1)

Sam Chak
Sam Chak on 16 Nov 2022
Edited: Sam Chak on 16 Nov 2022
Long time I didn't solve math puzzles like this one. Generally, you should be able find the analytical solution for L that satisfies the condition of eigenvalues of that gives and .
The following is an attempt to solve the problem heuristically for . You can attempt for .
v = 1:10;
c = [0 1];
p = [-2; -3];
for j = 1:length(v)
A = [-1 2; v(j) -1];
L = place(A', c', p) % always return L = [m 3]
m(j) = L(:, 1);
end
L = 1×2
4.0000 3.0000
L = 1×2
3.0000 3.0000
L = 1×2
2.6667 3.0000
L = 1×2
2.5000 3.0000
L = 1×2
2.4000 3.0000
L = 1×2
2.3333 3.0000
L = 1×2
2.2857 3.0000
L = 1×2
2.2500 3.0000
L = 1×2
2.2222 3.0000
L = 1×2
2.2000 3.0000
plot(v, m, 'p'), xlabel('v'), ylabel('L_1')
The pattern can be intuitively recognived as:
vv = linspace(1, 10, 901);
L1 = (4 + 2*(vv - 1))./vv;
plot(vv, L1), grid on, xlabel('v'), ylabel('L_1')
  2 Comments
Bernd Pfeifer
Bernd Pfeifer on 17 Nov 2022
Hi Sam,
thanks for the answer, but i want to implement the observer in simulink so i need one equation.
Paul already helped a lot and i think we get the problem in his way solved :)
Regards
Bernd
Sam Chak
Sam Chak on 18 Nov 2022
Edited: Sam Chak on 18 Nov 2022
@Bernd Pfeifer, don't mention it. @Paul is a helpful and knowledgeable person in control design.
For implementation in Simulink, both equations for are exactly the same (for your original 2nd-order system):
My equation came from my recognition of the numerical pattern as something related to the arithmetic sequence (without employing the curve-fitting tool), while Paul's equation is the solution as a direct result from his analytical mind and the computational power of MATLAB.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!