poly_func :
A polynomial function for xreal-typed signals.
The poly_func
primitive defines a polynomial function for xreal-typed signals. With this primitive, one can define a nonlinear DC transfer function with upto three inputs.
The parameter num_in
specifies the number of inputs, of which maximum value is 3. Depending on the value of this num_in
parameter, the parameter array data
defines the coefficients of the input-to-output polynomail equation as listed below:
1) For a single-input polynomial (num_in = 1):
out = data[0] + data[1]*in + data[2]*in^2 + data[3]*in^3 + data[4]*in^4 + ...
2) For a two-input polynomial (num_in = 2):
out = data[0] + data[1]*in[1] + data[2]*in[0] + data[3]*in[1]^2 + data[4]*in[1]*in[0] + data[5]*in[0]^2 + data[6]*in[1]^3 + data[7]*in[1]^2*in[0] + data[8]*in[1]*in[0]^2 + data[9]*in[0]^3 + data[10]*in[1]^4 + ...
3) For a three-input polynomial (num_in = 3):
out = data[0] + data[1]*in[2] + data[2]*in[1] + data[3]*in[0] + data[4]*in[2]^2 + data[5]*in[2]*in[1] + data[6]*in[2]*in[0] + data[7]*in[1]^2 + data[8]*in[1]*in[0] + data[9]*in[0]^2 + data[10]*in[2]^3 + data[11]*in[2]^2*in[1] + data[12]*in[2]^2*in[0] + data[13]*in[2]*in[1]^2 + data[14]*in[2]*in[1]*in[0] + data[15]*in[2]*in[0]^2 + data[16]*in[1]^3 + data[17]*in[1]^2*in[0] + data[18]*in[1]*in[0]^2 + data[19]*in[0]^3 +data[19]*in[2]^4 + ...
The coefficients can also be defined by a file by specifying the parameter filename
. The file defines the parameter values in Python format, e.g.:
num_in = 1 data = [1.0, 2.0, 1.0]
Input/Output Terminals
Name | I/O | Type | Description |
out | output | xreal | output signal |
in | input | xreal | input signals |
Parameters
Name | Type | Default | Unit | Description |
num_in | integer | 1 | None | number of inputs |
data | real array | ‘{0.0} | None | polynomial coefficients |
filename | string | “” | None | parameter definition file |