FEDEM Model Database  R8.0
Source code of the FEDEM model database
Functions
FFa Namespace Reference

Various math utilities. More...

Functions

int cubicSolve (double A, double B, double C, double D, double *X)
 Solves the cubic equation A*x3 + B*x2 + C*x + D = 0. More...
 
int bilinearSolve (const double *A, const double *B, double *X, double *Y)
 Solves a bi-linear set of equations in X and Y. More...
 

Detailed Description

Various math utilities.

Function Documentation

◆ bilinearSolve()

int FFa::bilinearSolve ( const double *  A,
const double *  B,
double *  X,
double *  Y 
)

Solves a bi-linear set of equations in X and Y.

The following set of equations are solved for the unknowns X and Y :

A0 * x*y + A1 * x + A2 * y = A3
B0 * x*y + B1 * x + B2 * y = B3
Parameters
[in]ACoefficients of the first equation
[in]BCoefficients of the second equation
[out]XSolution value(s) of the first unknown
[out]YSolution value(s) of the second unknown
Returns
Number of unique solutions found, negative on error

◆ cubicSolve()

int FFa::cubicSolve ( double  A,
double  B,
double  C,
double  D,
double *  X 
)

Solves the cubic equation A*x3 + B*x2 + C*x + D = 0.

See K. Rottmann, "Matematische Formelsammlung" (1960), pp. 13-16 for details.

Parameters
[in]ACoefficient of the cubic term
[in]BCoefficient of the quadratic term
[in]CCoefficient of the linear term
[in]DThe constant term
[out]XSolution(s)
Returns
Number of solutions found
  • -3 : No real solution, three complex roots detected
  • -2 : No real solution, two complex roots detected
  • 0 : No solutions at all (A, B and C were all zero)
  • 1 : One solution found (A and B were zero)
  • 2 : Two unique solution found (A was zero)
  • 3 : Three unique solutions found