66# performance of the functions used for optimization-base control.
77
88import numpy as np
9- import math
109import control as ct
1110import control .flatsys as fs
1211import control .optimal as opt
2120 'RK23' : ('RK23' , {}),
2221 'RK23_sloppy' : ('RK23' , {'atol' : 1e-4 , 'rtol' : 1e-2 }),
2322 'RK45' : ('RK45' , {}),
24- 'RK45' : ('RK45' , {}),
2523 'RK45_sloppy' : ('RK45' , {'atol' : 1e-4 , 'rtol' : 1e-2 }),
2624 'LSODA' : ('LSODA' , {}),
2725}
@@ -129,9 +127,6 @@ def time_optimal_lq_methods(integrator_name, minimizer_name, method):
129127 Tf = 10
130128 timepts = np .linspace (0 , Tf , 20 )
131129
132- # Create the basis function to use
133- basis = get_basis ('poly' , 12 , Tf )
134-
135130 res = opt .solve_ocp (
136131 sys , timepts , x0 , traj_cost , constraints , terminal_cost = term_cost ,
137132 solve_ivp_method = integrator [0 ], solve_ivp_kwargs = integrator [1 ],
@@ -223,8 +218,6 @@ def time_discrete_aircraft_mpc(minimizer_name):
223218 # compute the steady state values for a particular value of the input
224219 ud = np .array ([0.8 , - 0.3 ])
225220 xd = np .linalg .inv (np .eye (5 ) - A ) @ B @ ud
226- yd = C @ xd
227-
228221 # provide constraints on the system signals
229222 constraints = [opt .input_range_constraint (sys , [- 5 , - 6 ], [5 , 6 ])]
230223
@@ -234,7 +227,6 @@ def time_discrete_aircraft_mpc(minimizer_name):
234227 cost = opt .quadratic_cost (model , Q , R , x0 = xd , u0 = ud )
235228
236229 # Set the time horizon and time points
237- Tf = 3
238230 timepts = np .arange (0 , 6 ) * 0.2
239231
240232 # Get the minimizer parameters to use
0 commit comments