.TRANSFORM.Math.cubicRoots_Real

Analytical solution for the real roots of a cubic equation (a*x^3+b*x^2+c*x+d=0)

Information

Uses ccubicRoots but only returns on the real portion of the roots (i.e., roots[*] = Real). If a root has a imaginary portion greater than machine tolerance than a dummy value is returned for that root.

nRoots helps to identify the number of expected real roots based on the result from the polynomial discriminant, D.

Interface

function cubicRoots_Real
  input Real a;
  input Real b;
  input Real c;
  input Real d;
  output Real[3] roots "Real roots";
  output Real nRoots "Number of distinct real solutions expected";
end cubicRoots_Real;

Generated at 2025-04-01T18:24:36Z by OpenModelicaOpenModelica 1.24.5 using GenerateDoc.mos