Hi,
It would be great if someone can elaborate on using m.cspline as an interpolant to
1. evaluate functions/ act as a lookup table, where given x_data and y_data it can readily provide the value y at a query point x_query. In my case, x_query is an intermediate variable written in terms of the state variables of a system of ODEs that I intend to simulate.
For e.g. Can m.cspline( x_query, x_data, y_data) --> give us y* which needs to be plugged into the source term of a system of ODEs that I would like to simulate?
2. fit splines between manipulated variables that need to be solved for in an optimization routine for least squares loss minimization.
For e.g. let us say we do not know the y_data from the e.g. in bullet point 1, So we would have to set that up as a gekko vector of decision variables at all the corresponding x_data points, let us called it y_unknown. Then can we use m.cspline in the same manner as indicated in bullet point 1, to simulate the odes, such that values for y_unknown are being optimized such that the simulated ODE profiles from the optimal values closely matches the actual profiles from simulating the odes should we have actually had the y_data values.
So here, we would need to implement m.cspline(x_query, x_data, y_unknown)--> y'' that gets plugged into ODE source term to give us a predicted profile such that loss= (predicted profile- actual profile)^2 is minimized.
I would greatly appreciate any leads on approaching this because I have not been able to find documentation of the m.cspline to adapt it to this scenario.
Thanks and regards,
Anjana.