2019-07-12 20:50:36 +00:00
|
|
|
from brown.interaction import UFuncWrapper
|
|
|
|
import numpy as np
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
from coefficients import c
|
|
|
|
|
2019-07-16 18:44:15 +00:00
|
|
|
# This is the quite unreadable way to create
|
|
|
|
# UFuncs with given parameters. FIXME: add this to another module.
|
2019-07-12 20:50:36 +00:00
|
|
|
force_function = UFuncWrapper(0, c)
|
2019-07-15 19:45:32 +00:00
|
|
|
potential_function = UFuncWrapper(2, c)
|
2019-07-12 20:50:36 +00:00
|
|
|
|
2019-07-16 18:44:15 +00:00
|
|
|
# Plot the force and potential.
|
2019-07-12 20:50:36 +00:00
|
|
|
r = np.arange(0, 100, 0.02, dtype=np.float16)
|
2019-07-15 19:45:32 +00:00
|
|
|
f, = plt.plot(r, force_function(r), label="force")
|
|
|
|
p, = plt.plot(r, potential_function(r), label="potential")
|
|
|
|
plt.legend(handles=[f, p])
|
2019-07-12 20:50:36 +00:00
|
|
|
plt.show()
|