when Nt=4,the problem can be solved.But when Nt=2:
Trivial infeasibilities detected; solution determined analytically. Status: Infeasible Optimal value
The most likely explanation is you have made mistake. Based on the very limited information you provide that is the best guess.
If you provide data etc. so it is possible to reproduce the issue you may be lucky that someone investigate the issue. Including log information is also very useful. For instance if you use CVX+MOSEK then the MOSEK solution summary provide a lot of useful information.
This occurs when CVX’s presolve believes it can determine the solution without even calling the solver. For instance, if it sees a constraint that reduces to 1 == 0, it knows the model is infeasible.
This of course depends on the exact numerical values being fed in, so without the data it is not possible to know for sure whether CVX is doing the right thing or making a mistake.