hey assistent I have this def stopapproachphase(starttime, gradient): t80dmax =…
- User
hey assistent I have this def stop_approach_phase(start_time, gradient): t80_dmax = start_time + T80 dmax_80 = 0.8 * DMAX remainder_time = abs(dmax_80) / abs(gradient) num_points_first = FREQ // 2 x_values_first = np.linspace(start_time, t80_dmax, num_points_first) normalized_x = (x_values_first - start_time) / T80 y_values_first = DMAX - (DMAX - dmax_80) * (normalized_x**2.5)
codenum_points_second = FREQ - num_points_first x_values_second = np.linspace( t80_dmax, t80_dmax + remainder_time, num_points_second ) y_values_second = dmax_80 + gradient * (x_values_second - t80_dmax) x_values = np.concatenate((x_values_first, x_values_second)) y_values = np.concatenate((y_values_first, y_values_second)) differences = np.abs(y_values - G1s) closest_index = np.argmin(differences) g1s_x = x_values[closest_index] g1s_y = y_values[closest_index] return x_values, y_values, g1s_x, g1s_y, t80_dmax, dmax_80 witch works but I have a problem. The G1S point is a variable that must make stop to be 1 second apart. That meens modifying is value must modify the y_values_second. I want to this such that when G1S is changed, the x and y_values_second is changed so that last x_values_second value is 1 second apart from G1s. That can be done by modifying the gradient or something - Assistant