Defining partials of scipy interpolants (interp1d and RegularGridInterpolator) #3203
-
Hi everyone, I am building a model of a fuel cell powertrain using an ExplicitComponent to be used by Dymos later in an optimal control problem. I have some outputs that rely on interpolants (specifically interp1d and RegularGridInterpolator) to calculate their efficiencies and the polarisation curve of the fuel cell (i.e. the amount of current drawn for a certain amount of power). Let me give an example. The fuel cell in this powertrain is connected to a battery via a boosting DC/DC converter that steps up the voltage of the fuel cell (about 300V) to the voltage of the battery (around say 500V). One of the outputs of my model is the current that charges the battery which, I calculate as follows:
Where
Where So my question is how do I handle the partials best here? As I can't determine the analytical partials of the interpolants themselves I handled them as constants for now, but that is mathematically incorrect. I also saw something about openMDAO components that are interpolants themselves but I don't know how I would extract their partials either. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would recommend doing your upstream analysis that computes the inputs for the interpolants, and then using one of the interpolation components that come with OpenMDAO. For orthogonal data, use MetaModelStructuredComp. This will probably fit your needs, but another possible alternative is the Surrogate Modeling Toolbox, which provides derivatives of the interpolation, including the derivatives of the training data itself, if you require that. |
Beta Was this translation helpful? Give feedback.
I would recommend doing your upstream analysis that computes the inputs for the interpolants, and then using one of the interpolation components that come with OpenMDAO.
For orthogonal data, use MetaModelStructuredComp.
This will probably fit your needs, but another possible alternative is the Surrogate Modeling Toolbox, which provides derivatives of the interpolation, including the derivatives of the training data itself, if you require that.