import matplotlib.
pyplot as plt
# Profile points (x-axis)
profile_points = list(range(200, -1, -10))
# Corresponding potential values (y-axis)
potential_values = [
3.14, 4.12, 4.56, 5.01, 5.66, 6.36, 7.20, 8.20, 9.42, 10.9,
12.73, 15.01, 17.88, 21.51, 26.09, 31.83, 38.82, 46.81, 54.88, 61.21, 63.66
]
symmetric_profile_points = [-x for x in profile_points[::-1]] + profile_points
symmetric_potential_values = potential_values[::-1] + potential_values
plt.figure(figsize=(8, 5))
plt.scatter(symmetric_profile_points, symmetric_potential_values, color='b')
plt.xlabel("Distance (m)--->")
plt.ylabel("Potential (mV)---> ")
plt.title("Potential at point")
plt.grid(True)
plt.show()
import numpy as np
# Compute V_max and V_max/2
V_max = max(potential_values)
V_half = V_max / 2
# Find the profile point where V is closest to V_half
closest_index = np.abs(np.array(potential_values) - V_half).argmin()
x_at_V_half = profile_points[closest_index]
# Since the curve is symmetric, we have both +x and -x values
x_at_V_half1 = (-x_at_V_half, x_at_V_half)
print(V_half, x_at_V_half1)
(31.83, (-50, 50))