MATLAB Answers

How to define time as input in nlobj.Model.StateFcn used in nlmpc

1 view (last 30 days)
Saeid Bayat
Saeid Bayat on 29 Mar 2021
Edited: Saeid Bayat on 29 Mar 2021
As it is mentioned in the documentation, Model.StateFcn = @(x,u,params) myStateFunction(x,u,params). However, in my case, dynamic is also a function of wind speed (which itself is a function of time). How can I access time to define the dynamic? As it is shown above, StateFcn is not a function of time, so I do not know how can I get time in the "myStateFunction" to define state derivatives.
I though about using wind speed as measured distubance input, but I do not knwo how I can change it through simulation. For example if I suppose wind speed is a sinusoidal function of time, in the "nlmpcmove" I can only define the initial value of wind speed. So my question is how I can define it at other times?

Answers (0)

Community Treasure Hunt

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

Start Hunting!