SOLVE doesn't work on a concatenated symbolic matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I'm trying to get MATLAB to solve a (concatenated) symbolic matrix, but it keeps returning no answer. However, when I put the items in individually, it returns an answer! My code is as follows:
syms K s
pnum = -520*s - 10.3844;
pden = s^3 + 2.6817*s^2 + 0.11*s + 0.0126;
P=pnum/pden;
G = K;
Geq = G*P;
T = Geq/(1+Geq);
T = simplifyFraction(T);
[tnum, tden] = numden(T);
tnum = coeffs(tnum,s,'all');
tden = coeffs(tden,s,'all');
RHmat=RH(tden);
cond1 = RHmat(:,1).' >0;
cond2 = det(RHmat(1:2,1:2))>0;
conds=[cond1, cond2];
sol = solve(conds);
The function RH is one I wrote to compute the Routh-Hurwitz matrix (I'm trying to solve for K such that the first column is all positive integers).
Here
conds = [0 < 10000, 0 < 26817, 0 < 1344700/1277 - (138409960000*K)/26817, 0 < 126 - 103844*K, 0 < 138409960000*K - 28238700]
My problem is that solve( conds ) returns nothing, while
solve(0 < 10000, 0 < 26817, 0 < 1344700/1277 - (138409960000*K)/26817, 0 < 126 - 103844*K, 0 < 138409960000*K - 28238700)
returns the value that I want. Somebody please help me understand what exactly is going on here and how I can fix it! I think it has something to do with how solve() interprets both inputs, but it doesn't make sense to me because both solve( cond1 ) and solve( cond2 ) work even though they are both symbolic matrices (type 'sym') like conds . I've even tried concatenating cond1 and cond2 manually into a variable and solving, but nothing is working. Please help!
Thanks,
Ben
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!