pyoptools.misc.function_2d.poly_2d.poly_2d module

class pyoptools.misc.function_2d.poly_2d.poly_2d.Poly2D

Bases: Function2D

Class to define a 2D polynomial

z=c0+
c1*x+c2*y+
c3*x^2+c4*x*y+c5*y^2+
c6*x^3+c7*x^2*y+c8*x*y^2+c9*y^3+...

coefficients
dxdy()

Calculate the derivative with respect to X and Y for the polynomial.

Returns:

A tuple (dx, dy) containing two Poly2D objects representing the derivatives with respect to X and Y, respectively.

Return type:

tuple

Note

This method caches the derivative results the first time it is called. If you modify the coeff attribute, the cache will not be updated.

eval_1d(x, y)
num_coefficients
order
pyoptools.misc.function_2d.poly_2d.poly_2d.index_to_powers(i)

Convert index of coefficient vector to x and y powers in a polynomial.

index

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

xpower

0

1

0

2

1

0

3

2

1

0

4

3

2

1

0

ypower

0

0

1

0

1

2

0

1

2

3

0

1

2

3

4

pol_order

0

1

1

2

2

2

3

3

3

3

4

4

4

4

4

Parameters:

i (int) – Index in the coefficient vector.

Returns:

A tuple (x_power, y_power) representing the powers of x and y for the term.

Return type:

(int, int)

pyoptools.misc.function_2d.poly_2d.poly_2d.indices_to_powers(indices)

Convert a vector of coefficient indices into the corresponding x and y exponents for a polynomial.

pyoptools.misc.function_2d.poly_2d.poly_2d.ord2i(o)

Method that returns the number of coefficients of a polynomial of order o

order

0

1

2

3

4

i

1

3

6

10

15

pyoptools.misc.function_2d.poly_2d.poly_2d.pxpy2i(px, py)

Method that returns the index given power in x and the power in y