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

WIP - Onepass #132

Merged
merged 15 commits into from
May 23, 2024
Merged

WIP - Onepass #132

merged 15 commits into from
May 23, 2024

Conversation

ocots
Copy link
Member

@ocots ocots commented May 15, 2024

J'ai fait quelques ajouts dans la définition de l'ocp en abstrait. J'espère ne pas avoir cassé les cohérences. En gros, on peut donner des labels directement aux variables, états et contrôles. Ces labels sont utilisés pour l'affichage de la solution. J'ai aussi ajouté la possibilité d'écrire un Lagrange (Bolza aussi):

0.5 * ( u(t)^2 )  min

src/onepass.jl Outdated
:( $e2 ≥ $e1, $label ) => p_constraint!(p, ocp, e1 , e2, nothing, label; log)
# lagrange cost
:( ∫($e1) → min ) => p_lagrange!(p, ocp, e1, :min; log)
:( $e1 * ∫($e2) → min ) => p_lagrange!(p, ocp, :( $e1 * $e2 ), :min; log)
Copy link
Member

@jbcaillau jbcaillau May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocots convenient but: this kind of expression only makes sense if e1 does not contain references to state or control (variable allowed, though). Otherwise we would allow something like

x(t) * (u(t))  min # nonsense

as equivalent to

(x(t) * u(t))  min # ... becomes meaningful 

etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocots I am taking care of the changes suggested in the review above before merging.

@jbcaillau jbcaillau marked this pull request as draft May 16, 2024 15:59
@jbcaillau jbcaillau marked this pull request as ready for review May 16, 2024 15:59
@jbcaillau jbcaillau changed the title Onepass WIP - Onepass May 21, 2024
@ocots
Copy link
Member Author

ocots commented May 22, 2024

:(       $e1 * ($e2)  min    ) => p_lagrange!(p, ocp, :( $e1 * $e2 ), :min; log)

Forbid e1 = ...x(t)...u(t)... and, more generally, evaluating at t where t is the declared time.

Do we accept

  • 2∫(u(t)) (done!)
  • ∫(u(t))/2

@ocots
Copy link
Member Author

ocots commented May 22, 2024

Add the use of square brackets:

x = [y, z]  R², state

Done!

@ocots
Copy link
Member Author

ocots commented May 23, 2024

I have added left multiplication and right division.

@ocots
Copy link
Member Author

ocots commented May 23, 2024

And restructured the tests for onepass.

@jbcaillau jbcaillau removed the request for review from PierreMartinon May 23, 2024 17:09
@ocots ocots merged commit 1aeaa43 into main May 23, 2024
4 checks passed
@ocots ocots deleted the onepass branch May 23, 2024 17:21
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

Successfully merging this pull request may close these issues.

2 participants