|
@@ -6,6 +6,9 @@ from parameters import ModelParams
|
|
|
import functions as fn
|
|
|
import matplotlib.pyplot as plt
|
|
|
import scipy.special as sps
|
|
|
+from pathlib import Path
|
|
|
+import rotational_path
|
|
|
+import path_plot
|
|
|
|
|
|
|
|
|
def point_to_gauss_map(sigma_m, a_bar, lbd, params: ModelParams):
|
|
@@ -15,18 +18,13 @@ def point_to_gauss_map(sigma_m, a_bar, lbd, params: ModelParams):
|
|
|
|
|
|
def point_to_cap_map(sigma_m, a_bar, theta0, params: ModelParams):
|
|
|
return (sigma_m * 10 * fn.coefficient_Cim(2, params.kappaR) / fn.coefficient_Cpm(2, params.kappaR) *
|
|
|
- a_bar ** 2 / (sps.eval_legendre(1, theta0) - sps.eval_legendre(3, theta0))) / 1.7537
|
|
|
-
|
|
|
-
|
|
|
-def point_to_cap_map2(sigma_1, lbd, theta0):
|
|
|
- return (10 * sigma_1 * lbd * fn.sph_bessel_i(2, lbd) /
|
|
|
- (np.sinh(lbd) * (sps.eval_legendre(1, theta0) - sps.eval_legendre(3, theta0)))) / 1.7537
|
|
|
+ a_bar ** 2 / (sps.eval_legendre(1, np.cos(theta0)) - sps.eval_legendre(3, np.cos(theta0))))
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
target_patch_size = 0.9
|
|
|
- params = ModelParams(R=150, kappaR=3)
|
|
|
+ params = ModelParams(R=150, kappaR=1)
|
|
|
sigma_m = 0.001
|
|
|
|
|
|
def fn1(x):
|
|
@@ -48,23 +46,38 @@ if __name__ == '__main__':
|
|
|
ex_gauss = expansion.GaussianCharges(lambda_k=lbd, omega_k=np.array([[0, 0], [np.pi, 0]]), sigma1=gauss_sigma, l_max=30)
|
|
|
|
|
|
cap_sigma = point_to_cap_map(sigma_m, a_bar, theta0, params)
|
|
|
- # cap_sigma = point_to_cap_map2(gauss_sigma, lbd, theta0)
|
|
|
- ex_cap = expansion.SphericalCap(theta0_k=theta0, sigma1=cap_sigma, omega_k=np.array([[0, 0], [np.pi, 0]]), l_max=50)
|
|
|
+ ex_cap = expansion.SphericalCap(theta0_k=theta0, sigma1=cap_sigma, omega_k=np.array([[0, 0], [np.pi, 0]]), l_max=30)
|
|
|
|
|
|
theta = np.linspace(0, np.pi, 1000)
|
|
|
phi = 0.
|
|
|
dist = 1
|
|
|
|
|
|
- potential1 = potentials.charged_shell_potential(theta, phi, dist, ex_point, params, print_idx=3)
|
|
|
- potential2 = potentials.charged_shell_potential(theta, phi, dist, ex_gauss, params, print_idx=2)
|
|
|
- potential3 = potentials.charged_shell_potential(theta, phi, dist, ex_cap, params, print_idx=6)
|
|
|
+ potential1 = potentials.charged_shell_potential(theta, phi, dist, ex_point, params)
|
|
|
+ potential2 = potentials.charged_shell_potential(theta, phi, dist, ex_gauss, params)
|
|
|
+ potential3 = potentials.charged_shell_potential(theta, phi, dist, ex_cap, params)
|
|
|
# print(potential.shape)
|
|
|
# print(potential)
|
|
|
|
|
|
- plt.plot(theta, potential1.T)
|
|
|
- plt.plot(theta, potential2.T)
|
|
|
- plt.plot(theta, potential3.T)
|
|
|
- plt.show()
|
|
|
+ # expansion.plot_theta_profile_multiple([ex_point, ex_gauss, ex_cap], ['IC', 'Gauss', 'cap'], num=1000)
|
|
|
+
|
|
|
+ # fig, ax = plt.subplots()
|
|
|
+ # ax.plot(theta, potential1.T, label='IC')
|
|
|
+ # ax.plot(theta, potential2.T, label='Gauss')
|
|
|
+ # ax.plot(theta, potential3.T, label='cap')
|
|
|
+ # ax.tick_params(which='both', direction='in', top=True, right=True, labelsize=12)
|
|
|
+ # ax.set_xlabel(r'$\theta$', fontsize=13)
|
|
|
+ # ax.set_ylabel(r'$\phi$', fontsize=13)
|
|
|
+ # plt.legend(fontsize=12)
|
|
|
+ # plt.tight_layout()
|
|
|
+ # plt.savefig(Path("/home/andraz/ChargedShells/Figures/potential_shape_comparison.png"), dpi=600)
|
|
|
+ # plt.show()
|
|
|
+
|
|
|
+ path_comparison = rotational_path.PathExpansionComparison([ex_point, ex_gauss, ex_cap],
|
|
|
+ path_plot.QuadPath,
|
|
|
+ dist=2,
|
|
|
+ params=params)
|
|
|
+ path_comparison.plot(['IC', 'Gauss', 'cap'],
|
|
|
+ save_as=Path("/home/andraz/ChargedShells/Figures/energy_shape_comparison_kR1.png"))
|
|
|
|
|
|
|
|
|
|