diff --git a/lib/con_aero.py b/lib/con_aero.py index 03d6bcf..16b1056 100644 --- a/lib/con_aero.py +++ b/lib/con_aero.py @@ -27,11 +27,17 @@ # constraints about aerodynamic conditions import numpy as np -from .utils_c import dynamic_pressure_pa, angle_of_attack_all_rad, q_alpha_pa_rad, dynamic_pressure_array_pa, angle_of_attack_all_array_rad, q_alpha_array_pa_rad +from .utils_c import ( + dynamic_pressure_pa, + angle_of_attack_all_rad, + q_alpha_pa_rad, + dynamic_pressure_array_pa, + angle_of_attack_all_array_rad, + q_alpha_array_pa_rad, +) from .coordinate_c import * - def dynamic_pressure_dimless(pos_eci_e, vel_eci_e, t_e, wind, units): """Returns dynamic pressure normalized by its maximum value.""" pos_eci = pos_eci_e * units[0] @@ -69,11 +75,7 @@ def q_alpha_dimless(pos_eci_e, vel_eci_e, quat, t_e, wind, units): pos_eci = pos_eci_e * units[0] vel_eci = vel_eci_e * units[1] t = t_e * units[2] - return ( - dynamic_pressure_pa(pos_eci, vel_eci, t, wind) - * angle_of_attack_all_rad(pos_eci, vel_eci, quat, t, wind) - / units[3] - ) + return q_alpha_pa_rad(pos_eci, vel_eci, quat, t, wind) / units[3] def q_alpha_array_dimless(pos_eci_e, vel_eci_e, quat, t_e, wind, units): diff --git a/lib/con_dynamics.py b/lib/con_dynamics.py index 3bd30ff..72332ab 100644 --- a/lib/con_dynamics.py +++ b/lib/con_dynamics.py @@ -342,13 +342,9 @@ def equality_jac_dynamics_velocity(xdict, pdict, unitdict, condition): submat_vel[1::3, 1::3] = pdict["ps_params"].D(i) submat_vel[2::3, 2::3] = pdict["ps_params"].D(i) - @profile def dynamics(mass, pos, vel, quat, t): if param[2] == 0.0: - if hasattr(mass, "__len__"): - return dynamics_velocity_NoAir(mass, pos, quat, param, units) - else: - return dynamics_velocity_NoAir_single(mass, pos, quat, param, units) + return dynamics_velocity_NoAir(mass, pos, quat, param, units) else: return dynamics_velocity( mass, pos, vel, quat, t, param, wind, ca, units diff --git a/lib/con_init_terminal_knot.py b/lib/con_init_terminal_knot.py index c32f60f..d7bad03 100644 --- a/lib/con_init_terminal_knot.py +++ b/lib/con_init_terminal_knot.py @@ -325,6 +325,7 @@ def equality_jac_knot_LGR(xdict, pdict, unitdict, condition): return jac + def equality_6DoF_LGR_terminal(xdict, pdict, unitdict, condition): """Equality constraint about terminal condition.""" @@ -370,7 +371,7 @@ def equality_6DoF_LGR_terminal(xdict, pdict, unitdict, condition): return np.concatenate(con, axis=None) -@profile + def equality_jac_6DoF_LGR_terminal(xdict, pdict, unitdict, condition): """Jacobian of equality_terminal.""" diff --git a/lib/con_trajectory.py b/lib/con_trajectory.py index 6ab7ee5..dc15214 100644 --- a/lib/con_trajectory.py +++ b/lib/con_trajectory.py @@ -38,11 +38,7 @@ def yb_r_dot(pos_eci, quat_eci2body): yb_dir_eci = quatrot(conj(quat_eci2body), np.array([0.0, 1.0, 0.0])) return yb_dir_eci.dot(normalize(pos_eci)) -<<<<<<< HEAD:lib/con_trajectory.py -@jit(nopython=True) -======= ->>>>>>> e71cae8 (remove numba dependincies):constraints_b.py def roll_direction_array(pos, quat): """Returns array of sine of roll angles for each state values.""" return np.array([yb_r_dot(pos[i], quat[i]) for i in range(len(pos))]) diff --git a/lib/con_user.py b/lib/con_user.py index 9b313a0..6128c3c 100644 --- a/lib/con_user.py +++ b/lib/con_user.py @@ -29,6 +29,7 @@ from user_constraints import equality_user, inequality_user from .jac_fd import jac_fd + def equality_jac_user(xdict, pdict, unitdict, condition): """Jacobian of user-defined equality constraint.""" if equality_user(xdict, pdict, unitdict, condition) is not None: