Description Usage Arguments Details Value Examples
View source: R/f3.rbsb4.code.r
This function returns the root (or two roots) of the equation
ky*y + kx2*x^2 + kx*x + kk = 0
. When dx
is not null, it
is supposed to give the interval where the root lies, in that case
only one root is returned.
The first parameter can be a vector of
any length and all computations are vectorized.
Only real roots
are considered.
1 | solve2degree(y, ky, kx2, kx, kk, dx=NULL, x0=NULL)
|
y |
Vector of values for which the equation must be satisfied. |
ky |
Coefficient for |
kx2 |
Coefficient for |
kx |
Coefficient for |
kk |
Constant coefficient. |
dx |
|
x0 |
|
When dx
is defined only one root is returned, belonging to the
interval; if it is not possible (root(s) exist(s) and do(es) not
comply, then a fatal error is issued.
When every real number
complies with the equation, according to available arguments, the
returning value is x0
, mean(dx)
or 0
. When
is.null(dx)
either one or two roots is returned with NA
when the solution is complex.
A matrix having one or two columns according to the values of
ky,kx2,kx,kk,dx
.
1 2 3 4 | rbsb3k("RESET"); # for R checking compliance (useless)
solve2degree(1:10, 1, 1, 0, -20);
solve2degree( 3, -1, 1, 1, 1);
solve2degree( 3, -1, 1, 1, 1, c(0.5, 1.5));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.