Curve#
A Curve node defines a two-dimensional relation between x- and y-values. Several attributes of other nodes
allow the assignment of a curve. An example is the assignment of a speed-power curve which takes the speed
as an x-value and returns the required power as a y-value.
Calculations in curves are done using the following formula, where \(y(x)\) is the value looked up in the table:
The Addition is applied before the Multiplier, and the bounds are applied last.
An attribute that references the node holds \(y\) to its own minimum and maximum value as well: an inclusive one clamps \(y\), and \(y\) reaching an exclusive one stops the run with an error. See Assigning attributes.
Example:
Curve "speed_power_curve" {
Table = [
10, 3.4;
11, 4.8;
12, 7.2;
13, 9.2;
14, 11.2;
15, 13.9;
16, 17.1;
17, 20.5;
18, 24.5;
19, 28.9;
20, 33.9;
21, 39.9;
22, 46.7;
23, 54.5;
]
Extrapolate = LINEAR
}
Attributes#
Table#
This attribute sets the table of x- and y-values that the curve interpolates in. The table must hold at least two rows and its x-values must be finite and strictly increasing. A y-value may be INF or -INF, but never nan. With Interpolate LINEAR, the value between an infinite point and its neighbours is that infinity, while the neighbours keep their own values: a table of the points (0, 1), (10, 2) and (20, INF) gives 2 at 10 and INF above it; Navigate warns of such a table, as PREVIOUS or NEXT sets where the value turns infinite. The table must not hold both INF and -INF; such a curve is rejected. The syntax is described under Assigning tables.
Data type:
TableDefault: None. Must be provided by the user.
Addition#
Sets a value that is added to the y-value looked up in the table, before the Multiplier is applied, according to the formula at the top of this page. The value may be an expression of numbers; an expression that references a node is rejected. INF and -INF are rejected.
Data type:
Float,ExpressionExample value:
10Default: 0
Multiplier#
Sets a factor that the y-value looked up in the table, plus the Addition, is multiplied by, according to the formula at the top of this page. The value may be an expression of numbers; an expression that references a node is rejected. INF and -INF are rejected.
Data type:
Float,ExpressionExample value:
2.5Default: 1
LowerBound#
Sets the lower bound that the result is clamped to after the Addition and the Multiplier are applied, according to the formula at the top of this page. -INF means no lower bound; INF is rejected. It must not exceed UpperBound, nor the upper bound an attribute referencing the node requires.
Data type:
FloatExample value:
-5Default: -INF
UpperBound#
Sets the upper bound that the result is clamped to after the Addition and the Multiplier are applied, according to the formula at the top of this page. INF means no upper bound; -INF is rejected. It must not be below LowerBound, nor the lower bound an attribute referencing the node requires.
Data type:
FloatExample value:
5Default: INF
Interpolate#
This attribute sets the interpolation method used to interpolate in the table. PREVIOUS and NEXT cannot be combined with Extrapolate = LINEAR; such a curve is rejected.
Data type:
IDLegal values: Interpolate1DID
Default: LINEAR
Extrapolate#
This attribute sets the extrapolation method used to extrapolate outside the table. With FLAT, the values of Below and Above are used. With Interpolate = LINEAR, LINEAR cannot be combined with a finite end value whose neighbour is INF or -INF, as the slope it would continue is infinite; such a curve is rejected. Beyond an infinite end value, the extrapolation is that infinity.
Data type:
IDLegal values: ExtrapolateID
Default: LINEAR
Below#
Sets the flat extrapolation value below the first x-value of the table. It is only used when Extrapolate is FLAT, and it then takes the place of the table’s y-value in the formula at the top of this page; when Extrapolate is not FLAT, a value set here is ignored with a warning. The value may be an expression of numbers; an expression that references a node is rejected. INF and -INF are accepted, and are checked against each attribute the curve is assigned to (see Assigning attributes).
Data type:
Float,ExpressionExample value:
-5Default: Not set. The first y-value in the table is used.
Above#
Sets the flat extrapolation value above the last x-value of the table. It is only used when Extrapolate is FLAT, and it then takes the place of the table’s y-value in the formula at the top of this page; when Extrapolate is not FLAT, a value set here is ignored with a warning. The value may be an expression of numbers; an expression that references a node is rejected. INF and -INF are accepted, and are checked against each attribute the curve is assigned to (see Assigning attributes).
Data type:
Float,ExpressionExample value:
5Default: Not set. The last y-value in the table is used.