"Invalid quadratic form(s): not a square" AND "Error in '*' z = feval( oper, x, y )"

Hello everyone, I find errors when I solve this problem. Please help me


The errors are
Invalid quadratic form(s): not a square
and
Error in * (line 36)
z = feval( oper, x, y );
Thank you!

Invalid quadratic form(s): not a square is occurring because variables are being multiplied in contravention of CVX’;s rules. Specifically, opt_psi(2) is an affine function of variables caf and car. But opt_yy(3) and opt_psi(3) involve products of caf and car from opt_psi(2) with other caf and car terms on the RHS.

If you somehow change error_cost such that it is a valid convex expression, then presumably you want minimize(error_cost(5777)) or minimize(sum(error_cost)) rather than minimizing a vector as you currently have, which is not valid.

I will mark this as non-convex. However, I am not sure that all your stuff doesn’t crunch down to a convex problem, if only it were reformulated properly - but I doubt that is the case.

Also, in the future, please copy and paste your code into your post as text, and use the Pre-formatted code icon. Do not post images.

The first thing you need to do is to carefully read
Why isn't CVX accepting my model? READ THIS FIRST!