Clear Filters
Clear Filters

Solve Function Doesn't Give All Solutions

14 views (last 30 days)
Joey Qi
Joey Qi on 31 Mar 2024 at 13:28
Commented: Joey Qi on 1 Apr 2024 at 2:17
% this does not give all the solutions
A = [0.7 0.2;
0.05 0.64];
C = [0.5 -0.8;
0 0.7];
Q = [0.5 0;
0 0.7];
R = [1 0;
0 0.8];
T = sym('T',[2 2]);
L = sym('L',[2 2]);
[Pba,L2,G] = dare(A',C',Q,R);
P = C*Pba*C'+R;
f = trace(P^(-1)*(T*P*T'+L-P));
x = solve(f,[T,L])
The answer(solution) is like that:
x =
struct with fields:
T1_1: 0
T2_1: 0
T1_2: 0
T2_2: 0
L1_1: 1298074214633706853141718390451145/425558238297866865348786096439296
L2_1: 0
L1_2: 0
L2_2: 0
However, there are other solutions, such as T=[1,0;0,1], L=[0,0;0,0];
Why does the code not give me all the reasonable solutions for T and L?
Thanks!

Accepted Answer

Torsten
Torsten on 31 Mar 2024 at 13:40
Moved: Torsten on 31 Mar 2024 at 13:40
Using
x = solve(f,[T,L],'ReturnConditions',1)
instead of
x = solve(f,[T,L])
might help.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!