Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPC getinfo results #76

Closed
caxelrud opened this issue Jun 6, 2024 · 3 comments
Closed

MPC getinfo results #76

caxelrud opened this issue Jun 6, 2024 · 3 comments

Comments

@caxelrud
Copy link

caxelrud commented Jun 6, 2024

Hi, I am getting the following results when using getinfo().
N is 200.
it looks like, for multivariable inputs and outputs, the results are flattened but clamped to the size N.

info=getinfo(mpc)
info[:Rhaty ]
julia>
200-element Vector{Float64}:
 50.0
 30.0
  ⋮
 50.0
 30.0
@franckgaga
Copy link
Member

franckgaga commented Jun 6, 2024

I'm not able to reproduce, are you using the last version v.0.21.3 ? Did you solve the mpc problem at least one time with moveinput! ?

Here's the result on my side:

using ModelPredictiveControl, ControlSystemsBase
mpc = LinMPC(LinModel(append(tf(2,[10,1]), tf(3,[5, 1])), 1.0), Hp=200);
u = moveinput!([2,10]);
info = getinfo!(mpc);
info[:Rhaty]

results in:

400-element Vector{Float64}:
  2.0
 10.0
  2.0
 10.0
  2.0
  ⋮
  2.0
 10.0
  2.0
 10.0

@caxelrud
Copy link
Author

caxelrud commented Jun 7, 2024

I found a bug in my testing code.
All looks good now so, please, disregard my issue.

@franckgaga
Copy link
Member

Alright, let me know if there is another issue !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants