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

function problem.new_phase_like does not copy integral_variable guess #79

Open jtheinen opened 1 year ago

jtheinen commented 1 year ago

Minimal reproduction:

problem = pycollo.OptimalControlProblem( name="Simple Block Slide",) phase_A = problem.new_phase(name="A") phase_A.integrand_functions = [Fx **2] phase_A.bounds.integral_variables = [[0,1000]] phase_A.guess.integral_variables = [0]

phase_B = problem.new_phase_like( phase_for_copying=phase_A, name="B", ) print(phase_A.guess.integral_variables) print(phase_B.guess.integral_variables)

OUT: [0] None

Solution

input phase_B.guess.integral_variables manually