Monday, April 20, 2015

VPython Project

VPython Project

For this assignment, we were tasked to code for a model that would  place 3 point charges in a 3D space, and it is supposed to be encircled with observation points. Our model turned out something like this:




The Red, Green, Blue spheres represented the 3 point charges. The encircling Cyan spheres are observation points. We gave each of the point charges simple coordinates, and made a loop defined by a circle using Trigonometrical functions to create the encircling observation points. The coding would look like this:


First, we defined the constant k and the coordinates and charge of each spheres. Then coding the loop using n, that describes the changing theta as the observation points are distributed equidistantly from the origin of (0, 0, 0). Using a combination of Triginometrical function and Pythagoras Theorem, we derivate a formula to define the x and y coordinate of each respective point charges.

Once that is done, we coded the formula for electric potential, and requested the program to aid us in the calculation of electric potential for each point charges. Finally we sum them up to get the total electric potential from this system, which resulted in this:


Our model's total electric potential turns out to be [3.40 * 10^12 V]

No comments:

Post a Comment