- Notifications
You must be signed in to change notification settings - Fork441
-
Hi,
In this setting, it works just fine. But when I tried to change the horizon into something like (changing nothing but the number of points in the linspace):
the result seemed to be extremely strange, with the inputs u always remaining the same:
It's the case for all I'm confused by this results and wonder what's the actual use of 'horizon'? (I do notice from the comments that it's a "List of times at which the optimal input should be computed", but I still can't understand) Hope for any help. Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
This problem is addressed in PR#799 by switching to using collocation as the default method for solving optimal control problems. This is much more numerically stable and provides good solutions to the example problem from the documentation (and without the issues are the solution only working for a specific number of time points).
Replies: 3 comments 1 reply
-
I am struggling with the same problem. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I've got this on my list to take a look at, but haven't had a chance. One quick thing is that if you want to change the parameters sent to the optimizer, use the |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
A bit more information: the problem seems to be with the default method used by If you switch the solver to
The (abridged) result is now
The cost is now I'll keep looking at this, but the quick (but slow -:) fix is to use a different optimization method. BTW, the much faster way to solve this problem is to exploit the fact that the system is differentially flat:https://python-control.readthedocs.io/en/0.9.2/kincar-flatsys.html. Approach #3 in the example script is solving the same problem and returns a result instantaneously. |
BetaWas this translation helpful?Give feedback.
All reactions
-
This problem is addressed in PR#799 by switching to using collocation as the default method for solving optimal control problems. This is much more numerically stable and provides good solutions to the example problem from the documentation (and without the issues are the solution only working for a specific number of time points). |
BetaWas this translation helpful?Give feedback.