Using VPython program to calculate the E-field

Click For Summary

Discussion Overview

The discussion revolves around using a VPython program to calculate the electric field (E-field) generated by a charged ring. Participants explore the applicability of a given formula for the E-field and consider different modeling approaches for the charge distribution.

Discussion Character

  • Homework-related
  • Exploratory
  • Technical explanation

Main Points Raised

  • One participant presents a formula for the E-field due to a charged ring and attempts to implement it in VPython.
  • Another participant questions whether the formula is valid everywhere or only along the axis of the ring.
  • Some participants suggest modeling the ring of charge as a set of equally spaced point charges to calculate the E-field as a vector sum of contributions from each point charge.
  • There is a request for clarification on how to model the ring of charge using point charges.
  • Several participants inquire about drawing the vertices of a regular polygon on a circle, indicating a need for geometric understanding related to the problem.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the applicability of the E-field formula beyond the axis of the ring. There are multiple approaches suggested for modeling the charge distribution, and no consensus is reached on the best method.

Contextual Notes

Participants have not settled on the assumptions regarding the validity of the E-field formula in different spatial locations, nor have they resolved the mathematical steps necessary for modeling the charge distribution accurately.

Who May Find This Useful

Students and educators interested in computational physics, electric fields, and programming with VPython may find this discussion relevant.

HaLAA
Messages
85
Reaction score
0

Homework Statement


Charge a ring of radius R=5.0cm laying in the x-y plane to 50nC.

Create a VPython program that will allow you to calculate the E-field due to the ring anywhere in space.

Homework Equations



E_ring=kQz/(R^2+z^2)^(3/2), point P above the xy-plane

The Attempt at a Solution

from visual import *

C = pi*.10 # meters
Q = 50.0*10**-9 #Coulombs
k = 8.99*10**9 # Nm^2/C^2
E = vector(0.0,0.0,0.0) # N/C

Lambda = Q/C # linear charge density
s=vector(0.025,0.0,0.025)

# we are looking for the E-field due to the ring at anywhere, I think we would have dD,
# but I don't know how to define it.

ds = vector(D/10000,D/10000,D/10000)
dq = mag(Lambda*ds)

while s.x < L+D:

rate=(10000)
dE = k*dq/(mag(s)**2)*norm(s)
E = E + dE
s = s + ds

print 'sx=',s.x,'dE=',dE,'E=',E
print 'E=',E,'N/C'[/B]
 
Technology news on Phys.org
Does your formula for the ring work everywhere? Or just on the axis?

It might better to model ring of charge as a set of equally spaced point charges on the ring.
Then at the point of interest, find the electric-field vector there as a vector sum of electric-field contributions from each point charge.

You can use your formula to check at a point where it is valid.
 
robphy said:
Does your formula for the ring work everywhere? Or just on the axis?

It might better to model ring of charge as a set of equally spaced point charges on the ring.
Then at the point of interest, find the electric-field vector there as a vector sum of electric-field contributions from each point charge.

You can use your formula to check at a point where it is valid.
The formula only model on the z-axis.

I don't know how to model ring of charge as a set of equally spaced point charges on the ring?

Can you give me a hit?
 
Can you draw the vertices of a regular polygon on a circle?
 
robphy said:
Can you draw the vertices of a regular polygon on a circle?
I don't know how to draw it.
 
If you had to draw a regular octagon, what angles would use?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
978
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
2K