Skip to content
Snippets Groups Projects
Commit faf41fb0 authored by Vadim Gubaidulin's avatar Vadim Gubaidulin
Browse files

use numpy.expm1 instead of np.exp for calculation of EM field of a round beam.

parent eda61eaf
No related branches found
No related tags found
2 merge requests!280.8.0,!18Ions
...@@ -104,8 +104,8 @@ def efieldn_gauss_round(x, y, sig_x, sig_y): ...@@ -104,8 +104,8 @@ def efieldn_gauss_round(x, y, sig_x, sig_y):
""" """
r_squared = x*x + y*y r_squared = x*x + y*y
sig_r = sig_x sig_r = sig_x
amplitude = (1 - np.exp(-r_squared / amplitude = -np.expm1(-r_squared /
(2*sig_r*sig_r))) / (2*pi*epsilon_0*r_squared) (2*sig_r*sig_r)) / (2*pi*epsilon_0*r_squared)
return x * amplitude, y * amplitude return x * amplitude, y * amplitude
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment