where ‘d’ is a function of ‘x_next’. I need to know how can I do this with CVX i.e. how can I perform minimization where every time the value of ‘x_next’ is passed to a function that computes ‘d’. I was thinking of using a function handle in place of ‘d’ but one of the previous posts suggests this is not possible with CVX. Any ideas, suggestions or way around this??
First of all: is your problem convex? I suspect that it is not, given your use of a presumably continuous nonlinear function in a quadratic form. If your model is not convex, CVX cannot solve it.
If d is affine, then your model is indeed convex, assuming both P and R are PSD. But since CVX doesn’t support opaque linear operators, only matrices, you might as well be expressing d(x_next) as A_d * x_next + b_d for some appropriate choice of A_d and b_d.
This section of the users guide describes two ways to add new functions that are compatible with CVX. However, this truly is an advanced topic, because of the restrictions I listed in the previous paragraph. In my experience very few users even attempt to do this, and we are unable to support this, generally.