do-mpc icon indicating copy to clipboard operation
do-mpc copied to clipboard

Is it possible to add state-dependent parameters in model & mpc formulations?

Open shuoyang2000 opened this issue 1 year ago • 1 comments

Hi, I am using your toolbox recently and thanks for such a great toolbox -- it is really easy to understand and use.

However, I have a special MPC formulation, in which the time-varying parameters (_tvp) depends on current system state, not on current time. In the provided examples, I can only find around two cases that have _tvp variables which depend on time clock.

It will be good if there is some easy way to define state-varying parameters, and please let me know if such feature already exists :)

Just add a few background info of my MPC formulation: I am using it on autonomous vehicle to track a given trajectory in the map, and the road has different frictions for different parts (i.e., position-dependent friction), which requires state-dependent parameters.

shuoyang2000 avatar Dec 29 '23 17:12 shuoyang2000

Hi, first of all, thank you for using Do-MPC. Secondly, we apologize for the delayed response. Unfortunately, I am not sure I understand the issue at hand. From what I understand you have a parameter in your state equations (e.g. friction coefficent) that is depending from your states? As long as you have an equation for the friction dependence from your states, you can just formulate this as an equation e.g. myu_x=f(x,...), and include myu in your model equations. You would not need a _tvp parameter for this. Of cause, if-conditions cannot be implemented directly as you are using a gradient-based optimization, but maybe you find a continous approximation? I hope this helps, otherwise feel free to contact us if this is not entirely what you are looking for. Best regards Your Do-MPC Team

JoshuaAda avatar Apr 04 '24 20:04 JoshuaAda