Solving Inequalities using symbolic tool box
36 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
When I try to solve simple inequality
let say ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1523641/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1523641/image.png)
the solution is ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1523646/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1523646/image.png)
but matlab is giving wierd answers
syms x
solve(x^2 - 25>0,x)
can somone help me, how to fix this issue?
2 Kommentare
Torsten
am 28 Okt. 2023
syms x real
sol = solve(x^2 - 25>0,x,'ReturnConditions',1);
sol.x(1)
sol.x(2)
sol.conditions
Antworten (1)
Walter Roberson
am 31 Okt. 2023
It is common with the symbolic engine that in practice you need to convert inequalities into equalities by introducing a non-negative or a positive "excess" variable -- so if f(x) > y(x) then f(x) - y(x) > 0; let δ quantify how much more so f(x) - y(x) = delta for positive delta. Now you can try to solve() your system for the other variables and you will get back a system of solutions in terms of the quantified-excess variables
1 Kommentar
Walter Roberson
am 31 Okt. 2023
syms x real
syms delta positive
eqn = x^2 - 25 == delta %amount difference of terms is greater than 0
sol = solve(eqn, x)
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!