Borrar filtros
Borrar filtros

Solve inequation not working with sqrt

2 visualizaciones (últimos 30 días)
Diego Marvid
Diego Marvid el 28 de Sept. de 2020
Respondida: Prudhvi Peddagoni el 1 de Oct. de 2020
I tried to solve a simple inequation that had square root of the variable and the solve() function is not giving me the correct answer.
The inequation is:
The code is:
clear;
syms k real
eq = ( -1 + sqrt(1-4*k) )/2 < 1;
solve(eq, k)
And the answer is 0.
Since k is real the answer should be the interval (-2, 1/4)

Respuesta aceptada

Prudhvi Peddagoni
Prudhvi Peddagoni el 1 de Oct. de 2020
Hi,
It seems that you did not enable ReturnConditions parameter. So the function is returning only one solution
solve(eq, k,'ReturnConditions',true);
This will return all the possible solutions. Please refer this link for more info.

Más respuestas (0)

Categorías

Más información sobre Specialized Power Systems 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!

Translated by