brocksam / pycollo

General-purpose optimal control, trajectory optimisation and parameter optimisation using direct collocation
https://brocksam.github.io/pycollo/
MIT License
8 stars 3 forks source link

OCP.number_parameter_variables #83

Open jtheinen opened 1 year ago

jtheinen commented 1 year ago

OCP.number_parameter_variables

https://github.com/brocksam/pycollo/blob/5d3b5540d1e6ca4ad3939a7f5f69077b92b3d2df/pycollo/optimal_control_problem.py#L219-L221

Problem

There is no return function and the ._s_var_user is always an NamedTuple.

Solution

  1. Get rid of whole property
  2. Change to: return self._s_var_user.len()
jtheinen commented 1 year ago

OCP.scaling

https://github.com/brocksam/pycollo/blob/5d3b5540d1e6ca4ad3939a7f5f69077b92b3d2df/pycollo/optimal_control_problem.py#L280-L282

Minimal repr

problem = pycollo.OptimalControlProblem(
    name= "hello",)
problem.scaling

Error

https://github.com/brocksam/pycollo/blob/5d3b5540d1e6ca4ad3939a7f5f69077b92b3d2df/pycollo/scaling.py#L41-L42

AttributeError: 'EndpointScaling' object has no attribute '_ocp'

jtheinen commented 1 year ago

OCP. mesh_iterations

Minimal repro

problem = pycollo.OptimalControlProblem( name= "hello",) problem.mesh_iterations

Error

https://github.com/brocksam/pycollo/blob/5d3b5540d1e6ca4ad3939a7f5f69077b92b3d2df/pycollo/optimal_control_problem.py#L292-L294 AttributeError: 'OptimalControlProblem' object has no attribute '_mesh_iterations'