Disciplined convex programming error: Invalid numeric values (NaNs) may not be used in CVX expressions.

After running my code, this error appeared. I have been modifying it for a long time but don’t know how to adjust it. What should I do about this?

This means that one or more input data values is NaN. So look at the input data values and find the offending data.

Are you using an iterative process in which one or more optimal variable values from a CVX problem are used to generate the input data for the next CXV problem? If so, if a problem is not solved to optimality (for example, infeasible, unbounded, or solver encounters numeric difficulties), CVX will populate the variable values as NaN, which could then result in NaN in the input data for the next CVX problem. You need to look at the solution status, and perhaps also be aware of the possibility of wilder and wilder solotuons eventually leading to CVX problem failure for some reason.

Related: See

Yes, in the process of solving my optimization problem using the SCA method, NaN values began to appear after a certain iteration. As a result, the objective function shows an error in the new iteration, but I don’t understand why this error occurs. Or, in other words, what does it mean by an SCA method without protective measures?May I ask you for advice?

Yes, use a non-convex solver, for instance under YALMIP, rather than trying to write your own SCA solver, which is very unreliable. Please read the link I provided.

OK, I’ll give it another try. Thank you for your help.