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 num_points_first = FREQ 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)
codet_g1s = (G1s - y_values_first[-1]) / gradient + x_values_first[-1] num_points_second = FREQ x_values_second = np.linspace(x_values_first[-1], t_g1s, num_points_second) y_values_second = y_values_first[-1] + gradient * ( x_values_second - x_values_first[-1] ) x_values = np.concatenate((x_values_first, x_values_second)) y_values = np.concatenate((y_values_first, y_values_second)) g1s_x = x_values_second[-1] g1s_y = y_values_second[-1] x_values = np.concatenate((x_values_first, [])) y_values = np.concatenate((y_values_first, [])) num_points_third = FREQ x_values_third = np.linspace(g1s_x, g1s_x + 1, num_points_third) y_values_third = np.linspace(g1s_y, 0, num_points_third) x_values = np.concatenate((x_values, x_values_third)) y_values = np.concatenate((y_values, y_values_third)) return x_values, y_values, g1s_x, g1s_y, t80_dmax, dmax_80 for the y_values_Third it starts from g1s_y and ends in 0. I don't want it to end in 0, I want it to end at the gradient from above. for example g1s_x and g1s_x + 1 are fiex, g1s_y is fix and the gradient is know, find gi1s_y - Assistant
To adjust the final segment from ending at zero to ending at a specific gradient, you'll need to calculate the new ending y-value (
g1s_y_third). Given that the x-values are fixed ( to ), and you want the slope of the last segment () to match the given gradient, you can determine using this gradient.