yaocptool.methods.classic package¶
Submodules¶
yaocptool.methods.classic.collocationscheme module¶
Created on Thu Jul 13 17:08:34 2017
@author: marco
-
class
CollocationScheme(solution_method)[source]¶ Bases:
yaocptool.methods.base.discretizationschemebase.DiscretizationSchemeBase-
create_initial_guess(p=None, theta=None)[source]¶ Create an initial guess for the optimal control problem using problem.x_0, problem.y_guess, problem.u_guess, and a given p and theta (for p_opt and theta_opt) if they are given. If y_guess or u_guess are None the initial guess uses a vector of zeros of appropriate size.
Parameters: - p – Optimization parameters
- theta – Optimization theta
Returns:
-
create_initial_guess_with_simulation(u=None, p=None, theta=None)[source]¶ Create an initial guess for the optimal control problem using by simulating with a given control u, and a given p and theta (for p_opt and theta_opt) if they are given. If no u is given the value of problem.u_guess is used, or problem.last_u, then a vector of zeros of appropriate size is used. If no p or theta is given, an vector of zeros of appropriate size is used.
Parameters: - u –
- p – Optimization parameters
- theta – Optimization theta
Returns:
-
discretize(x_0=None, p=None, theta=None, last_u=None)[source]¶ Discretize the OCP, returning a Optimization Problem
Parameters: - x_0 – initial condition
- p – parameters
- theta – theta parameters
- last_u – last applied control
Return type:
-
get_system_at_given_times(x, y, u, time_dict=None, p=None, theta=None, functions=None, start_at_t_0=False)[source]¶ Parameters: - x (list) –
- y (list) –
- u (list) –
- time_dict (dict) – Dictionary of simulations times, where the KEY is the finite_element and the VALUE list a list of desired times example : {1:{‘t_0’: 0.0, ‘x’:[0.0, 0.1, 0.2], y:[0.2]}}
- p – list
- theta – dict
- start_at_t_0 – bool If TRUE the simulations in each finite_element will start at the element t_0, Otherwise the simulation will start the end of the previous element
- functions (dict) – Dictionary of Functions to be evaluated, KEY is the function identifier, VALUE is a CasADi Function with model.all_sym as input
-
set_data_to_optimization_result_from_raw_data(optimization_result, raw_solution_dict)[source]¶ Set the raw data received from the solver and put it in the Optimization Result object :type optimization_result: yaocptool.methods.base.optimizationresult.OptimizationResult :type raw_solution_dict: dict
-
time_interpolation¶
-
time_interpolation_algebraics¶
-
time_interpolation_states¶
-
yaocptool.methods.classic.directmethod module¶
Created on Fri Oct 21 16:40:15 2016
@author: marco
-
class
DirectMethod(problem, **kwargs)[source]¶ Bases:
yaocptool.methods.base.solutionmethodsbase.SolutionMethodsBase
yaocptool.methods.classic.directmethod.py.93e0bc8cbe8d318afa87baa70c15355a module¶
yaocptool.methods.classic.indirectmethod module¶
Created on Fri Oct 21 16:39:52 2016
@author: marco
-
class
IndirectMethod(problem, create_cost_state=False, **kwargs)[source]¶ Bases:
yaocptool.methods.base.solutionmethodsbase.SolutionMethodsBase-
__init__(problem, create_cost_state=False, **kwargs)[source]¶ Parameters: - problem – yaocptool.modelling.ocp.OptimalControlProblem
- create_cost_state (bool) – If True a cost state will be created to keep track of the dynamic cost.
- integrator_type – str
- solution_method – str
- degree – int
- discretization_scheme – str ‘multiple-shooting’ | ‘collocation’
-
degree_control¶
-
yaocptool.methods.classic.multipleshooting module¶
Created on Thu Jul 13 17:08:34 2017
@author: marco
-
class
MultipleShootingScheme(solution_method)[source]¶ Bases:
yaocptool.methods.base.discretizationschemebase.DiscretizationSchemeBase-
create_initial_guess(p=None, theta=None)[source]¶ Create an initial guess for the optimal control problem using problem.x_0, problem.y_guess, problem.u_guess, and a given p and theta (for p_opt and theta_opt) if they are given. If y_guess or u_guess are None the initial guess uses a vector of zeros of appropriate size.
Parameters: - p – Optimization parameters
- theta – Optimization theta
Returns:
-
create_initial_guess_with_simulation(u=None, p=None, theta=None)[source]¶ Create an initial guess for the optimal control problem using by simulating with a given control u, and a given p and theta (for p_opt and theta_opt) if they are given. If no u is given the value of problem.u_guess is used, or problem.last_u, then a vector of zeros of appropriate size is used. If no p or theta is given, an vector of zeros o appropriate size is used.
Parameters: - u – Control initial guess
- p – Optimization parameters
- theta – Optimization theta
Returns:
-
discretize(x_0=None, p=None, theta=None, last_u=None)[source]¶ Discretize the OCP, returning a Optimization Problem
Parameters: - x_0 – initial condition
- p – parameters
- theta – theta parameters
- last_u – last applied control
Return type:
-
get_system_at_given_times(x_var, y_var, u_var, time_dict=None, p=None, theta=None, functions=None, start_at_t_0=False)[source]¶ Parameters: - x_var – List[List[MX]]
- y_var – List[List[MX]]
- u_var – List[List[MX]]
- p – list
- theta – dict
- start_at_t_0 – bool If TRUE the simulations in each finite_element will start at the element t_0, Otherwise the simulation will start the end of the previous element
- functions – Dict[str, Function|Dict[int] dictionary of Functions to be evaluated, KEY is the function identifier, VALUE is a CasADi Function with model.all_sym as input
-