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

Make args and kwargs in Problem explicit (so default values are shown) #129

Closed
Peter230655 opened this issue Feb 26, 2024 · 8 comments · Fixed by #130
Closed

Make args and kwargs in Problem explicit (so default values are shown) #129

Peter230655 opened this issue Feb 26, 2024 · 8 comments · Fixed by #130

Comments

@Peter230655
Copy link

This is optional, as I read the docs. midpoint and backward euler are available.
Which one is the default value? (I would assume, that the default method is normally better)

Thanks!

@moorepants
Copy link
Member

The default is backward euler.

@moorepants
Copy link
Member

It is clear here:

opty.direct_collocation.ConstraintCollocator(equations_of_motion, state_symbols, num_collocation_nodes, node_time_interval, known_parameter_map={}, known_trajectory_map={}, instance_constraints=None, time_symbol=None, tmp_dir=None, integration_method='backward euler', parallel=False)

But we don't expose that in Problem:

class opty.direct_collocation.Problem(obj, obj_grad, *args, **kwargs)

@Peter230655
Copy link
Author

Thanks!!
I must admit, that I have no idea what
opty.direct_collocation.ConstraintCollocator(equations_of_motion, state_symbols, num_collocation_nodes, node_time_interval, known_parameter_map={}, known_trajectory_map={}, instance_constraints=None, time_symbol=None, tmp_dir=None, integration_method='backward euler', parallel=False)

means.

@moorepants
Copy link
Member

Reopening because it would be better to have all the args and kwargs be explicit in Problem.

@moorepants
Copy link
Member

opty.direct_collocation.ConstraintCollocator(equations_of_motion, state_symbols, num_collocation_nodes, node_time_interval, known_parameter_map={}, known_trajectory_map={}, instance_constraints=None, time_symbol=None, tmp_dir=None, integration_method='backward euler', parallel=False)

Is the signature for the ConstraintCollocator class. It shows what arguments and keyword arguments it accepts and for the keyword arguments it shows what the default values are.

@Peter230655
Copy link
Author

I am ignorant in these things: What is the ConstraintCollocator class?
Maybe too complicated to expalin to me.

@moorepants
Copy link
Member

@moorepants moorepants changed the title Question regarding the integration_method Make args and kwargs in Problem explicit (so default values are shown) Feb 26, 2024
@Peter230655
Copy link
Author

Even printed out on my desk, but I never looked at it, as in the examples only Problem was used.
I need to learn more about the basic structure of things like opty.

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 a pull request may close this issue.

2 participants