Getting conditions for a dense algebraic second degree equation

I have a dense algebraic second degree equation, with five parameters in each coefficiente.
I'd like to get conditions about positivity of the solutions.
Do you know if this is factible in MATLAB?
Thank you in advance.

4 comentarios

So you have a quadratic polynomial
f(x) = a*x^2+b*x+c
where a, b and c depend on 5 parameters a = a(p1a,p2a,p3a,p4a,p5a), b= b(p1b,p2b,p3b,p4b,p5b) and c=c(p1c,p2c,p3c,p4c,p5) and you want to know when
x(1) = -b/(2a) + 1/(2*a)*sqrt(b^2- 4ac) and
x(2) = -b/(2a) - 1/(2*a)*sqrt(b^2- 4ac)
are both positive ?
Noemi ZM
Noemi ZM el 18 de Mzo. de 2022
Editada: Noemi ZM el 18 de Mzo. de 2022
Yes, that's it!! In fact, the 5 parameters are the same for each coefficient, and I want to get a law for exactly one of this in relation to the others s.t. the solution are positive.
If b^2-4*a*c is positive, a sufficient condition is
b/(2*a) < 1/(2*a)*sqrt(b^2- 4ac) < -b/2a
Thank you, Torsten, but the coefficients are really hard, so I'd like a program that can isolate the parameter p1 for me, could you understand?

Iniciar sesión para comentar.

 Respuesta aceptada

Hi Noemi ZM,
Let us assume that the coefficients of the algebraic equation are governed by the parameters “p1, p2, p3, p4, and p5”. The algebraic equation be , where the coefficients are all some functions of the parameters, say,
a = computeA(p1, p2, p3, p4, p5);
b = computeB(p1, p2, p3, p4, p5);
c = computeC(p1, p2, p3, p4, p5);
Please note that, when the two solutions of a second-degree equation are to be positive, the following conditions should hold,
  1. The discriminant value should be greater than or equal to zero. That implies, .
  2. The product of the two solutions should be greater than zero. That implies, c and a should have same sign.
  3. The sum of the two solutions should be greater than zero. That implies, b and a should have the opposite signs.
We can design a function in MATLAB, that does the following.
  1. Input the five parameters.
  2. Compute the coefficients.
  3. Verify if the conditions to hold are satisfied.
  4. Return true if all conditions are met, otherwise false.
function result = areSolutionsPositive(p1, p2, p3, p4, p5)
conditionsSatisfied = 0;
% Compute the coefficients
a = computeA(p1, p2, p3, p4, p5);
b = computeB(p1, p2, p3, p4, p5);
c = computeC(p1, p2, p3, p4, p5);
% Compute discriminant(delta)
delta = b * b - 4 * a * c;
% Condition 1: delta is greater than or equal to zero
if delta >= 0
conditionsSatisfied = conditionsSatisfied + 1;
end
% Condition 2: c and a should have the same sign
% In other words, c * a should be greater than zero
if c * a > 0
conditionsSatisfied = conditionsSatisfied + 1;
end
% Condition 3: b and a should have opposite signs
if b * a < 0
conditionsSatisfied = conditionsSatisfied + 1;
end
% Verify if all the three conditions are satisfied
if conditionsSatisfied == 3
result = true;
else
result = false;
end
end
Hope this answer helps you the solve the issue you are facing.

1 comentario

Thank you, Ravi, varying the parameters in a mesh I hope to get important clues with your idea.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 18 de Mzo. de 2022

Comentada:

el 25 de En. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by