control-toolbox / control-toolbox/CTDirect.jl

Add internal constraint tf > t0

Open
#381 0 comments 0 reactions 2 assignees Claimed by @joseph-gergaud View on GitHub
internal dev
Dominant language
Julia
Stars
12
Forks
5
Avg merge
2h 44m
Merged PRs (30d)
1

Description

A very common mistake with free final time problems is that users tend to forget to put a lower bound on the variable for tf, which can prevent convergence by leading the optimization into negative time steps.

A simple fix, as previously done in Bocop, is to add an internal constraint t0 < tf to the discretized OCP. A natural extension, beyond just tf, is to consider more general event times such as phase changes, impulses, or even the full grid of time steps. It is then easier to work internally with optimizing the times deltas rather than the times themselves, since a simple positivity constraint is enough to ensure an increasing time grid.

For the specific cases when the user wants to disable this added constraint, add an option to `solve`, eg enforce_increasing_grid [=true].

Steps
- [ ] reformulate the free final time case with the automatic constraint
- [ ] same with the free initial time, or both
- [ ] may be related later to impulse case cf https://github.com/control-toolbox/CTDirect.jl/issues/358
- [ ] may be related later to adaptive grid cf https://github.com/control-toolbox/CTDirect.jl/discussions/170

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.