Objective function with summation

I want to solve an MPC problem in matlab using fmincon function.
Im having hard time in figuring it out the way to write the objective function . Minimization is only wrt u ( x(t+1) = Ax(t)+Bu(t) )
Could someone please help else guide me to relevant sources

5 个评论

What are the dimensions of A and B ? How large do you want to choose N ?
I assume x(0) is given ?
I do not understand the notation. x subscript k+t is normally a scalar, butit does not make sense to transpose a scalar.
@Torsten A is 2x2 matrix and B 2x1 matrix
@Walter Roberson or simply x(k+t|t) means at time t we have the observation/value x(t) and the summation is k=0 to N hence it would be x(t+1),....,x(t+N) . x is a scalar if A and B are assumed scalars (1x1 matrices) else they would be a vector
Torsten
Torsten 2021-5-28
编辑:Torsten 2021-5-28
B is (2x1) - so u is a scalar for each t ?
How big is N ? x0 is a given 2x1 vector ?
@Torsten yes u is scalar for each t.
let me re-write the problem in clearer way :

请先登录,再进行评论。

 采纳的回答

Torsten
Torsten 2021-5-28
Choose u_0,...,u_N as unknowns.
In the objective function, calculate x_1,...x_(N+1) from A and u_0,...u_N.
Return u_0^2 + ... + u_N^2 + x_1.'*x_1 + ... + x_(N+1).'*x_(N+1)
That's all.
No constraints are necessary.

更多回答(0 个)

类别

帮助中心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!

Translated by