Error solving system of inequalities
Mostrar comentarios más antiguos
kvalue = solve(C(:,1)>0,k,'ReturnConditions',true);
k = kvalue.conditions;
As title states , I'm trying to solve this system. I tried to create my own routh criterion function and ,in order to check the result of the criterion ,I need to verify that all the elements of the first column of the matrix C are greater than zero. Therefore I have a system of inequalities with respect to k ,as you can see in the code I've attached, but when I run the code I keep getting the following error :
Warning: Unable to find explicit solution. For options, see help.
> In solve (line 317)
In routh (line 32)
ans =
Empty sym: 0-by-1
What should I do? Thanks in advance.
1 comentario
darova
el 23 de Abr. de 2020
Use linprog for solving inequalities
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 30 de Abr. de 2020
sol = solve(simplify(C(:,1))>0,k)
The answer will be 3. Which will likely not be what you want if you care about the value of k.
If you just care about the whether a solution exists then
all(isAlways(C(:,1)>0,'Unknown', 'true'))
This is not exactly correct: there are formulas that exist that isAlways cannot decide for even though the result might be provable. For example
syms k
isAlways(k^2>0)
is not something it can decide: in this case because k was not constrained to real values, so potentially k might be complex-valued and k^2 might be negative or complex-valued. In more general cases, you could imagine formula and complex sets of constraints on the values that might just be too messy for isAlways to understand. And isAlways certainly cannot prove the Riemann Hypothesis, so asking isAlways(Imag(NextZetaZero(x))==1/2) is not something it would be able to prove.
Now, if on the other hand, you want MATLAB to return a set of (reduced) inequalities that define the complete solutions, then solve() cannot do that for you, but you can get at the inequalities if you are willing to feval(symengine) and analyze the result.
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!