Using interpolating functions in constraints with derivatives #212
-
I am trying a toy ODE problem of simulating volume in a tank when flowrate into the tank follows a set time profile. I was putting a constraint of the following form which gave the error below (qint(t) is an interpolation function) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
For functions that depend only on infinite parameters such as this one, we can use the parameter function syntax (https://pulsipher.github.io/InfiniteOpt.jl/stable/guide/expression/#par_func_docs). In this case you can do: @parameter_function(m, qint_func == t -> qint(t))
@constraint(m, deriv(V, t) == qint_func) |
Beta Was this translation helpful? Give feedback.
-
Thanks, that fixed it. |
Beta Was this translation helpful? Give feedback.
For functions that depend only on infinite parameters such as this one, we can use the parameter function syntax (https://pulsipher.github.io/InfiniteOpt.jl/stable/guide/expression/#par_func_docs). In this case you can do: