csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
94 stars 20 forks source link

plot_trajectories errors if there are no input trajectories #229

Closed Peter230655 closed 1 month ago

Peter230655 commented 1 month ago

There seems to be an error in this method: If there are no input trajectories (like in the parameter estimation problem I am playing around with right now) it tries to put a title on a non existing axis; in line 421 of the code.

If you want me to, I will try to fix it and make a PR.

moorepants commented 1 month ago

If you want me to, I will try to fix it and make a PR.

You are always welcome to do so.

Best to document it here with an example of failure, in case you don't fix it.

Peter230655 commented 1 month ago

If you want me to, I will try to fix it and make a PR.

You are always welcome to do so.

Best to document it here with an example of failure, in case you don't fix it.

I am playing around with this parameter estimation idea you gave me; two independent measurements of the same motion...) and there are no input trajectories. This is how I noticed it. Then I looked at the code and it was clear. This simulation would be the example. When I make this PR should I also check for Derivative in the oems in the same PR or different PR? B.t.w. : the simulation finds the true curve very accurately (with a few % deviation), but the parameter estimations are way off! Unknown parameters should be at the end of the solution, right?

Peter230655 commented 1 month ago

If you want me to, I will try to fix it and make a PR.

You are always welcome to do so. Best to document it here with an example of failure, in case you don't fix it.

I am playing around with this parameter estimation idea you gave me; two independent measurements of the same motion...) and there are no input trajectories. This is how I noticed it. Then I looked at the code and it was clear. This simulation would be the example. When I make this PR should I also check for Derivative in the oems in the same PR or different PR? Both are just 2 - 3 lines of code in my opinion. B.t.w. : the simulation finds the true curve very accurately (with a few % deviation), but the parameter estimations are way off! Unknown parameters should be at the end of the solution, right?

moorepants commented 1 month ago

When I make this PR should I also check for Derivative in the oems in the same PR or different PR?

In general, you should make one PR per issue or one PR per idea. Mixing up things in a PR make it hard to review and think about.

Peter230655 commented 1 month ago

Makes sense! Will do so soon.

moorepants commented 1 month ago

Fixed by #231.