Question: How do you set up this python code? With a while loop? solution. Matter & Interactions de VPEMO2 Dipole Electric Field of a Dipole Objectives
How do you set up this python code? With a while loop? solution.

Matter & Interactions de VPEMO2 Dipole Electric Field of a Dipole Objectives Dipoles, whether permanent or induced, play a key role in many electric interactions. In chapter 13 we found an analytical expression for the approximate electric field of a dipole at a restricted set of locations along its axis and perpendicular axis-but not at other locations. In this activity, you will calculate the exact electric field of a dipole numerically at many locations. Before doing this activity you should have completed activity VPEM01, Electric Field of a Point Charge, and you should have studied Section 13.9 of the Matter Interactions de text book. After completing this activity you should be able to: . Calculate and display the net electric field of several source charges, at many observation locations 1 A Dipole Study the code below, and answer the questions that follow. from future import division, print_function from visual import * scene.width = scene.height = 800 ## constants oofpez = 9e9 # stands for One Over Four Pi Epsilon-Zero qe = 1.6e-19 s = 4e-11 scalefactor = 1.0 # you may need to change this p1 = sphere (pos=vector(0,5/2,0), radius=1e-11, color=color.red) q1 = qe p2 = sphere(pos-vector(0, -s/2,0), radius=1e-11, color=color.blue) 42 = -qe What is the orientation of the dipole axis? What is the dipole separation? Which particle is negatively charged? 2 Calculating at One Observation Location Calculating and displaying the net electric field at locations where you know what the direction and approximate magnitude should be is a good way to get your code working properly. Starting with the code fragment above: Write code to calculate the net electric field of the two charges at location (0, -3 x 10-10,0) m, by calculating the field of each charge and adding the two together. Print the value of Emet you calculate. Create an orange arrow at the observation location to display Enet at that location. You will need to find a value for scalefactor that makes everything visible. Look at your results. Are the magnitude and direction of Enet physically reasonable? If your electric field points in the wrong direction, check your calculation of 7. Move the observation location to (-3 x 10-10.0.0). Look at your results. Are the magnitude and direction of Enet physically reasonable? How do the magnitudes and directions of Enet at the two observation locations compare? Check your work before continuing. Matter & Interactions de VPEMO2 Dipole 3 Calculating ] at Many Observation Locations To display the pattern of electric field surrounding a dipole, we will create many arrows whose tails lie on a circle surrounding the dipole. Modify your program so that instead of calculating Enet at one location, it calculates and displays the electric field of the dipole at 12 evenly spaced locations on a circle of radius 3 x 10-10 m, lying in the ry plane and centered on the dipole. Rotate the display appropriately to check the pattern of field you have calculated. Does it make sense? Add a second circle of observation locations in the yz plane. You may have noted how cumbersome it is to repeat the same calculation for two (or more) source charges. In a subsequent activity (VPEM04: Electric Field of a Uniformly Charged Rod) we will learn a cleaner and more compact way to deal with many source charges and many observation locations using a construct called a "list. Check your work before continuing. 4 Optional: A Quadrupole Two dipoles together make up a quadrupole. To explore the field of a quadrupole: Modify your program to include two dipoles, oriented as shown below. The center of the quadrupole should be at the origin: -9 +9 - +94 -9 H . Modify scalefactor if necessary to make the pattern of electric field easy to see. How does the quadrupole field compare to the field of a dipole? In what ways is it similar, and in what ways is it different? Why is the magnitude of the quadrupole field smaller than the magnitude of the dipole field, despite the fact that there are more charged particles in a quadrupole? Try commenting out the code for the observation locations in the yz plane. Do you see a symmetry in the field in the ry plane? 2015-07-20 Matter & Interactions de VPEMO2 Dipole Electric Field of a Dipole Objectives Dipoles, whether permanent or induced, play a key role in many electric interactions. In chapter 13 we found an analytical expression for the approximate electric field of a dipole at a restricted set of locations along its axis and perpendicular axis-but not at other locations. In this activity, you will calculate the exact electric field of a dipole numerically at many locations. Before doing this activity you should have completed activity VPEM01, Electric Field of a Point Charge, and you should have studied Section 13.9 of the Matter Interactions de text book. After completing this activity you should be able to: . Calculate and display the net electric field of several source charges, at many observation locations 1 A Dipole Study the code below, and answer the questions that follow. from future import division, print_function from visual import * scene.width = scene.height = 800 ## constants oofpez = 9e9 # stands for One Over Four Pi Epsilon-Zero qe = 1.6e-19 s = 4e-11 scalefactor = 1.0 # you may need to change this p1 = sphere (pos=vector(0,5/2,0), radius=1e-11, color=color.red) q1 = qe p2 = sphere(pos-vector(0, -s/2,0), radius=1e-11, color=color.blue) 42 = -qe What is the orientation of the dipole axis? What is the dipole separation? Which particle is negatively charged? 2 Calculating at One Observation Location Calculating and displaying the net electric field at locations where you know what the direction and approximate magnitude should be is a good way to get your code working properly. Starting with the code fragment above: Write code to calculate the net electric field of the two charges at location (0, -3 x 10-10,0) m, by calculating the field of each charge and adding the two together. Print the value of Emet you calculate. Create an orange arrow at the observation location to display Enet at that location. You will need to find a value for scalefactor that makes everything visible. Look at your results. Are the magnitude and direction of Enet physically reasonable? If your electric field points in the wrong direction, check your calculation of 7. Move the observation location to (-3 x 10-10.0.0). Look at your results. Are the magnitude and direction of Enet physically reasonable? How do the magnitudes and directions of Enet at the two observation locations compare? Check your work before continuing. Matter & Interactions de VPEMO2 Dipole 3 Calculating ] at Many Observation Locations To display the pattern of electric field surrounding a dipole, we will create many arrows whose tails lie on a circle surrounding the dipole. Modify your program so that instead of calculating Enet at one location, it calculates and displays the electric field of the dipole at 12 evenly spaced locations on a circle of radius 3 x 10-10 m, lying in the ry plane and centered on the dipole. Rotate the display appropriately to check the pattern of field you have calculated. Does it make sense? Add a second circle of observation locations in the yz plane. You may have noted how cumbersome it is to repeat the same calculation for two (or more) source charges. In a subsequent activity (VPEM04: Electric Field of a Uniformly Charged Rod) we will learn a cleaner and more compact way to deal with many source charges and many observation locations using a construct called a "list. Check your work before continuing. 4 Optional: A Quadrupole Two dipoles together make up a quadrupole. To explore the field of a quadrupole: Modify your program to include two dipoles, oriented as shown below. The center of the quadrupole should be at the origin: -9 +9 - +94 -9 H . Modify scalefactor if necessary to make the pattern of electric field easy to see. How does the quadrupole field compare to the field of a dipole? In what ways is it similar, and in what ways is it different? Why is the magnitude of the quadrupole field smaller than the magnitude of the dipole field, despite the fact that there are more charged particles in a quadrupole? Try commenting out the code for the observation locations in the yz plane. Do you see a symmetry in the field in the ry plane? 2015-07-20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
