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

Return Interpolated Value Functions #82

Open
pulsipher opened this issue Oct 29, 2020 · 3 comments
Open

Return Interpolated Value Functions #82

pulsipher opened this issue Oct 29, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers transformations Something to do with model transformations

Comments

@pulsipher
Copy link
Collaborator

We should build in some interpolation functionality to automatically construct start value functions and optionally return infinite variable solutions as functions.

@pulsipher pulsipher added the enhancement New feature or request label Oct 29, 2020
@pulsipher pulsipher added the good first issue Good for newcomers label Nov 20, 2020
@pulsipher pulsipher changed the title [FEATURE] Interpolation Value Functions Return Interpolated Value Functions Oct 22, 2021
@pulsipher
Copy link
Collaborator Author

This should probably just use Interpolations.jl. To avoid adding too many dependencies, it might be better to do this in a separate package.

@pulsipher pulsipher added the transformations Something to do with model transformations label Jan 6, 2022
@shobhitvoleti
Copy link

Hey, I've been using InfiniteOpt.jl for a race car track minimum time optimal control problem and it does really well! I'm pleased with the results and the interface is very intuitive! However, my next task is to extract the optimal control trajectory from InfiniteOpt and pass it through an MTK model to validate that the control will indeed predictably keep the lap time to a minimum in an external model. I'm using OpenMDAO's example as a benchmark to test against. They use a GaussLobatto orthogonal collocation scheme of degree 3. In my Julia code, I use this in the @infinite_parameter like this:

@infinite_parameter(m, τ in [0, chosen_track_length], num_supports = 51, derivative_method = OrthogonalCollocation(4))

My question is, when I extract the optimal control using
opt_thrust = value.(u[1], label = InfiniteOpt.All)
The trajectory I get looks physically infeasible. Is there a specific way to extract the control at the intermediate collocation points that I'm missing?

@pulsipher
Copy link
Collaborator Author

Hi @shobhitvoleti. Using the label = all keyword will extract all the intermediate collocation points. If you want to further interpolate, I suggest using Interpolations.jl on the provided discretized solutions.

The unexpected behavior you are seeing is likely because the collocation introduces additional degrees of freedom to the control variables. To resolve this, you can use constant_over_collcation to keep the control variables constant over the internal collocation nodes. Note that this has not been released quite yet and is available on the current release candidate of InfiniteOpt which you can install via:

import Pkg
Pkg.add(url = "https://github.com/infiniteopt/InfiniteOpt.jl", rev = "master")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers transformations Something to do with model transformations
Projects
None yet
Development

No branches or pull requests

2 participants