How to formulate this exprestion

Let’s we have a heat equation on a graph with its Laplacian matrix E and some heat sources F as
\frac{\partial}{\partial t}T(x,t) = E(.) T(x,t) + F(x,t)
Assume T_0 is given(as an initial temperature on each node).
After computing T from heat equation then we want to know which edges are using in the heat transformation. Then we have a least square formulation for each node in each step
$$\min_{x\in {0,1}} \sum_{i=1}^n \sum_{j=1}^m (\hat{T_j}(x,t_i) - T_j(x,t_i))^2$$
The solution from this optimization problem will provide information on which edges are present in transformation. By Updating the Laplacian of the graph we compute the new E and will repeat this process.

My question is that how we could formulate the optimization problem in cvx?

Thanks in advance!!!

Are \hat{T} and T affine? If not, it’s quite unlikely this is convex.

OK, but in what way does T depend on x? And are you saying that \hat{T}_j=T_{j+1}? Honestly, I don’t think this is really a CVX-specific question. You need to figure out how you would compute these values just in MATLAB alone. The CVX model will not be much different.

Here is my suggestion. You need to post MATLAB code that shows how to compute your objective function given a numeric value of x. Once you have that, we can suggest how to make it work for a CVX variable x. If you can’t do that, we can’t help you; this is not a MATLAB support page.

@mcg thanks for the comments . Now, I added some more explanation. I hope this time it is clear what I mean.

Yeah, I’m afraid we’re not going to be able to help. This is really not a CVX-specific question, really. It’s more of a general modeling question about how to represent this problem as a finite-dimensional convex program; whether you use CVX or not is secondary. This is not the right forum.

But I think I do not have any problem with the modeling. I would like to ask how one can define least square problem with one extra summation in CVX and the above objective function is exactly mentioning this. I think it is a simple question. Of course, T it is affine.

If it were simple (to me) I would have answered it. I stand by my previous comment.