Drawing field lines with MATLAB

Click For Summary
SUMMARY

The discussion focuses on calculating the electric field of a uniformly charged half spherical shell with total charge Q and radius R, specifically for the range -5R < z < 5R. The user successfully computed the electric fields for regions z > R and z < R. They seek guidance on plotting these fields and equipotential lines in MATLAB, particularly using the 'quiver3' function, while questioning its compatibility with coordinate systems beyond Cartesian.

PREREQUISITES
  • Understanding of electric fields and equipotential surfaces
  • Familiarity with MATLAB, specifically plotting functions
  • Knowledge of spherical coordinates and their relation to Cartesian coordinates
  • Basic principles of electrostatics and charge distributions
NEXT STEPS
  • Learn MATLAB's 'quiver3' function for 3D vector field plotting
  • Explore MATLAB's capabilities for plotting equipotential surfaces
  • Study the conversion between spherical and Cartesian coordinates in MATLAB
  • Investigate MATLAB's documentation on plotting electric fields and equipotential lines
USEFUL FOR

Students in physics or engineering, MATLAB users interested in electrostatics, and anyone looking to visualize electric fields and equipotential surfaces in computational simulations.

Minakami
Messages
4
Reaction score
0

Homework Statement


Consider a uniformly charged half spherical shell. The total charge is Q and the radius is R.

a) Calculate the electric field as a function of z for – 5R < z < 5R.
b) Draw equipotential curves in the xz-plane for – 5R < x, z < 5R with at least 8 equallyspaced
curves.



Homework Equations





The Attempt at a Solution


I solved for the electric fields in the region z>R and z<R so part a) is done.
I'm trying to plot this field and the equipotential lines in MATLAB but I couldn't figure out how. I haven't really used MATLAB before but I think MATLAB can definitely do this.
I understand that the equipotential lines are perpendicular to the electric field lines. So maybe I can use this fact to draw the equipotential lines...
 

Attachments

  • 12.jpg
    12.jpg
    9.1 KB · Views: 675
Physics news on Phys.org
Investigate the function 'quiver3'. However, I am not sure if it accepts any other coordinate system other than cartesian.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K