SOLVE doesn't work on a concatenated symbolic matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!