Skip to content

Conversation

@EveCharbie
Copy link
Collaborator

@EveCharbie EveCharbie commented Jan 13, 2026

The name polynomial_degree is misleading (at least in the case of Legendre polynomial as the value of this variable is rather polynomial_degree + 1).

This change is Reviewable

@EveCharbie
Copy link
Collaborator Author

I think the tests failing are the same as on my other PR.
@Ipuch if you think of a better variable name, I could change it.

@Ipuch
Copy link
Collaborator

Ipuch commented Jan 13, 2026

Why don't you like polynomial degree ?

@EveCharbie
Copy link
Collaborator Author

I feel "polynomial_degree" is misleading in the case of Legendre polynomial it holds the value of the order of the polynomial + 1 in practice.
It just took me an hour to understand this, so I would like to change the name to avoid this from happening to someone else (or me) in the future XD

@Ipuch
Copy link
Collaborator

Ipuch commented Jan 13, 2026

Okay, I'm asking because i kinda disagree to change its name here.

The Lagrange interpolation class should be in fact decoupled from the NLP transcription. The NLP transcription, indeed add some points either at the begining or at the end depending on the nature of the time grid (legendre vs radau and if there a point for the final point or not).

So the time_grid_length changes is more related to the CollocationIntegrator that adds extra points.

Nonetheless, I think you've landed where i've stopped thinking during that refactoring.

By systematically adding the zero, "we artificially augment the degree of the polynomial", that's why i've left the unused classmethod, with the idea that we should only use it through the class method and maybe something was wrong with the way we define the lagrange interpolation, because by sending the zero we can't trace back to the initial degree of the polynomial. So we SHOULD be able to either have polynomial degree as property of the LagrangeInterpolation but also the collocation time grid length needed for optimal control.

Let me know what you think.

Ipuch
Ipuch previously approved these changes Jan 13, 2026
@Ipuch Ipuch changed the title variable name change + removed unused and untested code Lagrange interpolation: variable name change + removed unused and untested code Jan 13, 2026
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

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

@pariterre reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie).

@pariterre pariterre merged commit 9d4bb4a into pyomeca:master Jan 28, 2026
15 of 22 checks passed
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.

3 participants