Electric Fields and Potentials
In this MATLAB-based exercise, you will acquire some basic familiarity with MATLAB and examine a computer simulation of the experiment you just conducted.
MATLAB is a high-level language and interactive environment that enables
one to perform computationally intensive tasks faster than with traditional programming languages. It is especially useful when dealing with problems that are either exceedingly difficult or impossible to solve by conventional analytic means.
-----------------------------------
The program you will use to simulate your experiment uses an approach that is similar to using differential equations to solve “boundary-value problems.” Briefly, the method by which these problems are solved is as follows:
The region of interest is divided into several smaller regions. Then, every individual point is calculated by finding the average of the surrounding points. In the simulations you will use, several points have some characteristics which will not change (such as the voltage of the electrode plates or the conditions at the boundaries). However, you will notice that the majority of the points are unknown. In this case, the program assumes them to be initially zero. By taking the average of all the surrounding points while using the fixed boundary conditions, it is possible to obtain a better, but still fairly incorrect approximation of these unknown points. If the process is repeated for all the points many, many times, eventually the subsequent averages do not change significantly from their previous values. At this point, the program assumes that it has a good numerical approximation of the situation.
Obviously, this is a computationally intensive operation, and if attempted by hand, would take a very long time to complete. However, using a computer to do the calculations, along with some numerical analysis tricks, allows the simulation to run relatively quickly.
-----------------------------------
MATLAB is available on the computers in the Physics Tutorial Center, Phillips 245 (use the login and password provided by your lab instructor). The program is also available for students to run from a campus server or download to their own computers. More information is available at: http://help.unc.edu/?id=4204#d0e178
You will also need the files which contain the simulation. These can be downloaded from the physics lab website: www.physics.unc.edu/labs/matlab.php
Once you have access to a computer with MATLAB, run the program and allow it to initialize. Now, you must change the active directory from the default to the folder which contains the simulation. To do this, type “cd pathname” ( pathname is the location where simulation is now stored) and press Enter. Now, run the simulation by typing “voltgui” and pressing enter.
A simple interface should appear where you can choose the electrode type (plates or triangle), the boundary conditions (derivative or fixed) and, if the boundary is fixed, the boundary voltage (0V, 6V, or 12V). Select the desired options and press “Go!” to view the results of the simulation. You will be able to view two figures: a surface plot which indicates the voltage at every point and an equipotential line plot with the electrodes and equipotentials of 2V, 4V, 6V, 8V, and 10V indicated. You can pan, rotate and zoom using the controls at the top of each figure. If you wish to examine another set of conditions, simply change the relevant settings and click “Go!” again to view another set of simulation results.
Answer the following questions as part of your lab report for this experiment:
1) What differences did you observe between the “derivative” and “fixed” boundary conditions? Which configuration best matches the data that you obtained from your experimental measurements? Try to explain what is happening in the two different scenarios.
2) What happens when you change the voltage of the boundary in the simulation? Which voltage setting corresponds to the configuration that you investigated in lab?
3) What else did you learn from the simulations?