How to measure time that fmincon takes to extract one solution from a NMPC running in Simulink
조회 수: 3 (최근 30일)
이전 댓글 표시
I am running a Non-linear MPC at Simulink and I would like to know if it is possible to measure the computational time it takes for the fmincon to generate a solution for the controller per simulation time step. I have seen commands like tic/toc, cputime etc, but my issue is that I don't know a way that I could go "under the hood" and put these commands before and after fmincon.
If somebody knows, could you please help me?
댓글 수: 1
Benotsmane Rabab
2022년 11월 5일
By building your nonlinear controller, you need to create the object nlopc, when you excute your model, call this function:
t= timeit(nlopc(nx, ny, nu))
where nx, ny, nu are the numbers of states variables, outputes, and inputes of your controller.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Predictive Control Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!