I'm getting the following error while doing the state update in mpc

조회 수: 2 (최근 30일)
I'm applying mpc for 2input, 1output system with 2states. and I'm unable to make the system state update.
For the above code I'm getting the error as
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix
matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error in Bstwdmpcmov (line 75)
x = A*x + B1(:,1)*u;
please let me know, which corrections are needed..
thank you

채택된 답변

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2023년 2월 22일
Looks like the error is quite descriptive here, please check the dimensions of A, x, u, and B1 maybe by using a break point to see where the dimension mismatch is.
  댓글 수: 2
Sarala Gurijala
Sarala Gurijala 2023년 2월 22일
Thanks sir. I have removed the above mentioned error sir. But I'm unable plot the graph sir. It is showing the error as "The constraints are overly stringent. No feasible solution. Previous optimal sequence will be used. In mpc/mpcmove" Please Suggest me sir
Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2023년 2월 22일
Since this is a separate question, ideally it should be on a new post for discoverability. In any case, the error in this case is also pretty helpful. The optimization problem you are asking MPC to solve becomes infeasible. Try again by relaxing the constraints or making them soft

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Refinement에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by