(class from pyomo.contrib.cspline_external.cspline_parameters)
pyomo.contrib.cspline_external.cspline_parameters
Bases: object
object
Cubic spline parameters class. This can be used to read and write parameters or calculate cubic spline function values and derivatives for testing.
Methods
__init__([model, fptr])
__init__
Cubic spline parameters class.
add_linear_extrapolation_segments()
add_linear_extrapolation_segments
Add a segment on the front and back of the cspline so that any extrapolation will be linear.
dfdx(x)
dfdx
Get d/dx(f(x))
f(x)
f
Get f(x)
get_parameters_from_file(fptr)
get_parameters_from_file
Read parameters from a file
get_parameters_from_model(m)
get_parameters_from_model
Read parameters from a Pyomo model used to calculate them
segment(x)
segment
Get the spline segment containing x.
write_parameters(fptr)
write_parameters
Write parameters to a file
Attributes
n_knots
Number of knots
n_segments
Number of segments
valid
Ensure that the number of knots and cubic parameters is valid
Member Documentation
x – location, numpy array float
df/dx numpy array if x is numpy array or float
f(x) numpy array if x is numpy array or float
x – location, float or numpy array
segment(s) containing x, if x is a numpy array a numpy array of integers is returned otherwise return an integer