potential_tests.py 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from charged_shells import charge_distributions, potentials
  2. from charged_shells.parameters import ModelParams
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. def main():
  6. params = ModelParams(R=150, kappaR=3)
  7. ex1 = charge_distributions.create_mapped_quad_expansion(0.44, params.kappaR, 0.001, l_max=30)
  8. # ex2 = expansion.SphericalCap(np.array([[0, 0], [np.pi, 0]]), 0.5, 0.003, l_max=70)
  9. theta = np.linspace(0, np.pi, 1000)
  10. phi = 0.
  11. dist = 1
  12. potential_ic = potentials.inverse_patchy_particle_potential(theta, dist, 0.44, -0.002, (0.001, 0.001), params)
  13. potential1 = potentials.charged_shell_potential(theta, phi, dist, ex1, params)
  14. # potential2 = charged_shell_potential(theta, phi, dist, ex2, params)
  15. # print(potential.shape)
  16. # print(potential)
  17. plt.plot(theta, potential_ic)
  18. plt.plot(theta, potential1.T)
  19. # plt.plot(theta, potential2.T)
  20. plt.show()
  21. if __name__ == '__main__':
  22. main()