MatthewPeterKelly / MatthewPeterKelly/OptimTraj

Bug (?) in OptimTraj wrapper for GPOPS?

Open
#19 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
MATLAB
Stars
703
Forks
219
PR merge metrics
No merged PRs in 30d

Description

I'm having some trouble getting the OptimTraj gpops method to work on my problem in certain cases. Do you know what might be causing the error below? I think this error may be related to how OptimTraj wraps GPOPS-II, because whenever I use GPOPS-II independently from OptimTraj on my optimal control problem, I never get this error.

| |
| Finding Solution on Mesh 2 |
|___________________________________________________________________|
Computing Radau Points, Integration Weights, and Integration Matrix
Creating Bounds For Nonlinear Program
Creating Guess For Nonlinear Program
Error using griddedInterpolant
Interpolation requires at least two sample points in each dimension.

Error in interp1 (line 161)
F = griddedInterpolant(X,V,method);

Error in gpopsGuessRPMI

Error in gpopsSolveRPMI

Error in gpopsMeshShell

Error in gpops2

Error in gpopsWrapper (line 84)
output = gpops2(setup);

Error in optimTraj (line 190)
soln(iter) = gpopsWrapper(P);

Error in invoke_OptimTraj (line 176)
soln = optimTraj(problem);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the missing optimal-control problem and inspect the call path from optimTraj through gpopsWrapper at line 84 into gpops2 and gpopsGuessRPMI. Trace which input reaches interp1 with fewer than two sample points, then verify the fix against the reported Mesh 2 failure and a regression case.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.