0

I am trying to plot a LG beam equation in python where Electric field depends on r (transverse distance from propagation axis), theta (rotation Parameter), and z (propagation distance) and then electric field is calculated

I have made r = np.linspace(0,10,100) theta = np.linspace(0,np.pi,100) z as np.linspace(0,80,100)

then E = function of (r,z,theta)

The issue is I am trying to plot E but not successfull in plotting values of E as scatter or surface but not getting it as expected.

What i want to do is to plot values of E with respect to three axis r , z and theta

Can anyone please guide me how to achieve this using python or any other software

7
  • It should work something like this where field rotates like in the attached link mathematica.stackexchange.com/questions/202641/… Commented Nov 5, 2022 at 8:34
  • 1
    Please provide enough code so others can better understand or reproduce the problem. Commented Nov 5, 2022 at 8:45
  • @DinkarMishra are you interested in the 3-D surface plots with spiral folding at the end of you link you mentioned, or in solid volume plots? For complex 3-D surface plots, I think you need something like this: matplotlib.org/stable/gallery/mplot3d/… . If you provide the code with the input arrays, we can help you to get the plot system working. Commented Nov 5, 2022 at 8:59
  • Aso by the way, r = np.linspace(0,10,100); theta = np.linspace(0,np.pi,100); z = np.linspace(0,80,100) are only 1-D arrays, so the resulting plot will be a flat 3-D line. You need to use np.meshgrid or array broadcasting to make grids: numpy.org/doc/stable/user/basics.broadcasting.html Commented Nov 5, 2022 at 9:02
  • Actually the function is something like E = xyz and all x y and z are variables of different values If i can show x y and z on all three axes then where should i plot E which depends upon all x y and z. this is the main issue. I tried all the above mentioned cases but my aim is to show variation of E with respect to x y and z Commented Nov 5, 2022 at 9:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.