Действительная часть exp - косинус, но если у вас есть более сложное уравнение, где вам нужно извлечь действительную часть, вы можете использовать v.real
import numpy as np
import matplotlib.pyplot as plt
# use the built-in 'complex' function in Python, extract the real part
# complex(0,1) = 0 + 1.0i
def my_func(t):
v = 0.78125 - np.exp(-5.05*t)*np.exp(complex(0,-6773.05)*t) + 0.22514*np.exp(complex(0,-509.988)*t)
return v.real
# set whatever granularity you need
x_values = np.linspace(0, 2, 10000)
plt.figure(figsize=(8,6))
plt.plot(x_values, my_func(x_values))
plt.xlabel('Time (seconds)')
plt.ylabel('Potential')
plt.show()