Function1s::Polynomial: Simplification

The coefficients in the polynomial are now specified in order of
increasing exponent, starting from the constant coefficient (i.e., zero
exponent). Exponents are no longer specified. This better fits the
definition of a polynomial, and it prevents the strange scenario when if
exponents are given as a vector or tensor or similar then the units of
the coefficients are not the same across the different components.

For example, polynomial y = -1 + x^2 + 2x^3 can be specified as:

    <name>  polynomial (-1 0 1 2);

Or, alternatively:

    <name>
    {
        type    polynomial;
        coeffs  (-1 0 1 2);
    }
This commit is contained in:
Will Bainbridge
2024-04-23 15:17:48 +01:00
parent f28110ae94
commit c3f131e816
5 changed files with 57 additions and 102 deletions

View File

@ -0,0 +1,5 @@
function polynomial (0 4 -4 1);
x0 -0.5;
x1 2.5;
nX 51;