hey assisten I have this length = abs(DMAX) / abs(gradient) witch calulcates the…
- User
hey assisten I have this length = abs(DMAX) / abs(gradient) witch calulcates the distance from my start point(DMAX) depeiding on the gradient. I have a problem though. I have this point G1S that is between Dmax and end that must be 1 second before end. I need to add this point somehow to the length so that evreytime G1S the length is always incresed so that end is 1 second before G1s
- Assistant
To ensure that the endpoint is always 1 second before ( G1S ), you need to adjust the calculation of length to account for this condition. Essentially, you want to ensure that when you compute the length, the endpoint derived from this length should consistently position it 1 second before ( G1S ). Here's a general approach to modify your calculation:
-
Define Key Parameters:
- ( \text{DMAX} ): Your starting point.
-
- User
this is in python
- Assistant
- User
this is how the x axis is calutade right now length = abs(DMAX) / abs(gradient) x_values = np.linspace(start_time, start_time + length, FREQ) G1S is a value such as DMAX. for example DMAX is -2.20 G1s can be between DMAX and 0 but alwasy be 1second on x axys before stop
- Assistant
- User
I think I will do this diffrently. I want to have an x_values, y_values based on gradient from DMAX to G1s def stop_approach_phase(start_time, gradient): length = abs(DMAX) / abs(gradient) x_values = np.linspace(start_time, start_time + length, FREQ) normalized_x = np.linspace(-1, 0, FREQ) scaled_atan = np.arctan(3 * normalized_x) atan_min, atan_max = scaled_atan.min(), scaled_atan.max() y_values = DMAX + (scaled_atan - atan_min) / (atan_max - atan_min) * (-DMAX)
- Assistant
- User
So I have this length_foo = abs(DMAX - G1s) / abs(gradient) x_values_foo = np.linspace(start_time, start_time + length_foo, FREQ) normalized_x = np.linspace(-1, 0, FREQ) scaled_atan = np.arctan(3 * normalized_x) atan_min, atan_max = scaled_atan.min(), scaled_atan.max() y_values_foo = DMAX + (scaled_atan - atan_min) / (atan_max - atan_min) * (-DMAX) but then to have the same from G1s to end but to be exactly 1 second apart, then concatanate this 2
- Assistant