Run your program after everyone agrees on both predictions. Rotate the display to help understand where objects are located. Discuss how closely your prediction of what the program would do matches what you see in the visual output. Checkpoint: Discuss your answers to the questions above with your instructor. 2.1 Modify the program Complete or correct the program. It may be helpful to look at your program that calculated the electric of a single point charge, or a dipole. 2.1.1 Notes on the minimal working program In the calculation loop, the location of each of the point source charges is calculated as a vector sourcelocation = vector(xq,0,0) so that you can use the source location in vector calculations of the electric field dE contributed by that source charge. (Note that since is a vector and not a graphical object, it does not have a sourcelocation position. Just say don't use .) sourcelocation; .pos In the constants section are the values of the physical constants you will need. You will eventually need a factor for representing electric field vectors with arrows, and this has temporarily been given the value of 1.0 (you will need to change this later). You may wish to review the video ``VPython Instructional Videos: 5. Scalefactors'' at http://www.youtube.com/VPythonVideos to see how and why to scale arrows in your program to represent physical vector quantities. 3 Numerical experiments 1. Look at your display. Does it make sense? Do the magnitudes and directions of the orange arrows make sense? 2. Rotate the ``camera'' with the mouse to get a feeling for the nature of the pattern of electric field. 3. Change the sign of the charge to negative and run. Does the display make sense? Reset the charge to positive. 4. To check your program, set the coordinate of the observation location to zero and record the numerically computed electric field. Using your calculator, calculate the electric field at this location using the equation for field in the midplane derived in the textbook: Does the value calculated by your program have the same order of magnitude as the value you obtain using the analytical equation? If not, check both the program and your calculation. Vary the number of point charges used to model the rod. What is the minimum number of point charges used to model the rod that gives a result within 1% of the analytical value?
Run your program after everyone agrees on both predictions. Rotate the display to help understand where objects are located. Discuss how closely your prediction of what the program would do matches what you see in the visual output. Checkpoint: Discuss your answers to the questions above with your instructor. 2.1 Modify the program Complete or correct the program. It may be helpful to look at your program that calculated the electric of a single point charge, or a dipole. 2.1.1 Notes on the minimal working program In the calculation loop, the location of each of the point source charges is calculated as a vector sourcelocation = vector(xq,0,0) so that you can use the source location in vector calculations of the electric field dE contributed by that source charge. (Note that since sourcelocation is a vector and not a graphical object, it does not have a position. Just say sourcelocation; don't use .pos .) In the constants section are the values of the physical constants you will need. You will eventually need a factor for representing electric field vectors with arrows, and this has temporarily been given the value of 1.0 (you will need to change this later). You may wish to review the video ``VPython Instructional Videos: 5. Scalefactors'' at http://www.youtube.com/VPythonVideos to see how and why to scale arrows in your program to represent physical vector quantities. 3 Numerical experiments 1. Look at your display. Does it make sense? Do the magnitudes and directions of the orange arrows make sense? 2. Rotate the ``camera'' with the mouse to get a feeling for the nature of the pattern of electric field. 3. Change the sign of the charge to negative and run. Does the display make sense? Reset the charge to positive. 4. To check your program, set the coordinate of the observation location to zero and record the numerically computed electric field. Using your calculator, calculate the electric field at this location using the equation for field in the midplane derived in the textbook: Does the value calculated by your program have the same order of magnitude as the value you obtain using the analytical equation? If not, check both the program and your calculation. Vary the number of point charges used to model the rod. What is the minimum number of point charges used to model the rod that gives a result within 1% of the analytical value?
Computational%20Modeling%20in%20Introductory%20Physics%20Handout%20Update%20June2012.docx