Monday, April 20, 2015

Vpython Electric Potential

Spring 2015
Professor Mason
VPython Electric Potential

In class, we were asked to modify VPython's program from a regular and simple code to a more complicated loop code. This is how the new code looks like after we spent a lot of time coding it.
 First, we had to make a formula for r1 and V1 in order to calculate the electric potential in charge 1, followed by r2, V2 and r3, V3 shown in the picture attached below; r1, r2, r3 are the radius from each charge to the smaller sphere (observation point) that would show up later on after we finished the loop (the observation points would encircle around the 3 charges). Next, we created a while loop for each equation of charges, followed by the domain, such as how many observation points would encircle the 3 main charges; we decided to make loop for 20 times circling around the 3 main charges until it gets to 2pi in order to stop.
After we finished the first loop for each charges, we had to create the second loop in order to calculate the sum of the total electric potential circling around the 3 main charges. However, when we attempted to create loop for the sum, we failed, and the code did not work as planned, which is shown as #rednote in the picture attached above. Therefore, we created another loop, which define x, y , w equal to 1 and put a while loop in order to calculate it manually by putting all the numbers shown in the output as a list. After we made a list of those outputs, we had to calculate the sum, so we used sum(variable). Then, we had to use float in order to calculate the remaining decimals. We also had to put break at the end of the loop in order to prevent the infinite loop.
This is how it looks after we run the module with that code:
The picture attached above shows what the outputs are for the coding we created. The 20 numbers listed are the numbers for V1, V2, V3 after calculating the loop of electric potential for 20 times. Then we also provided the total sum of those electric potential in each charges. Then, we also calculated the total sum of all electric potential, which we put at the very end of the output. The diagram would look like this in the picture shown below. The cyan colored spheres are the observation points encircling around the red,  green, and blue colored spheres. 


Sunday, April 19, 2015

Electric Potential (14th Day)

 Spring 2015
Professor Mason
April 16 Class

Electric Potential in Microsoft Excel
The first thing we needed to do in class was to calculate the electric potential of 20 charges in excel by using an equation of [V = kq/(sqrt of a^2 +x^2)], given a is 0.3 and x is 0.2, while k is a constant of 9e9 and q is a charge that is 2e-5.After we got one charge by using the calculation, we could just copy the whole numbers for 20 times, and calculate the total as shown in the picture attached on the left. Potential difference happens due to continuous charge distributions. We did another experiment with excel in the middle of the class after the first one. However, this one is more complicated because it is based on a triangle shown on the picture attached below. There is a rod, and the rad has 20 charges attached in it .We had to calculate the electric potential in the 16th charge, but it started at in the middle of charge 0 and charge 1; therefore we measured it from 0.5 to 16th charge in excel.

 Electric Potential Calculations
After we did an experiment with Microsoft Excel, we did another calculation by hand, given the picture as shown below. The ring has 20 point charges acting on a single point x distance from ring. Ring has a radius of a. Given the charge for 20 charges is 20 micro C, therefore, we had to divide it by 20 and multiply it by 20 because it has 20 charges. We used the same equation as the one in Microsoft Excel, which is [V = kq / sqrt (a^2 + x^2)].

 On the next one, we were asked to calculate the electric potential in terms of theta as shown in the picture below. We knew that the diameter of that circle is 2a, and the distance from the edge of that diameter to P2 is defined by x. Therefore, we found out that [tan theta = 2a/x ], [sin theta = 2a / sqrt(4a^2 + x^2)], and [cos theta = x / sqrt (4a^2 + x^2)]. After we substitute and simplify the formula, we found out that the electric potential in terms of theta could be [V = kq cos theta / x] as shown in the picture below.
 After we finished with all the electric potential calculations, we were asked to draw an equal electric potential in a circle, and the result is shown below in the picture. Other than that, we were also asked to draw an equal electric potential between two rods, and we found out that there are several answers for it, and the result vector is shown in the picture attached below.

Electric Measurement Experiment
 In this experiment, we knew for sure that positive charges is always going towards negative charges. First, we set up the power supply to 15 V, then connect all the wires to the yellow wires shown in the picture above. We also needed to connect another wire to the red machine in the picture above. We used the tip of the wire that are connected to the red machine, and place it on the metal that is attached to the yellow wires. We had to measure the numbers shown in the red machine from a certain point to another certain point. Next, we had to make a table based on the numbers we got from the red machine in order to calculate the electric potential total of this experiment.

Tuesday, April 14, 2015

Work, Energy, and Electric Field (13th day).

Spring 2015
Professor Mason
April 14 Class

Battery and Bulb Experiment
The first thing we learned in class was about doing an experiment involving two batteries and two light bulbs attached with circuits. We were asked to figure out which one was the brightest and which one was the dimmest, and we had to make a sketch out of it. As we can see on the pictures attached, the batteries that were set up series had the brightest light; on the other hand, the one which was set up parallel had the dimmest light. Parallel set up batteries is more efficient because it gives higher current but lower voltage so it does not take much amount of energy from the batteries; on the other hand, series set up batteries has higher voltage but lower current, and it uses up energy from batteries faster than parallel, but it has brighter light. As for the sketch, we uses symbols as simple as possible as shown in the picture attached.


Joule's Law
In class, we did an experiment about water heater. We needed to know three important things about the water while heating the water, and those are mass, power, and time. The steps are observe change of temperature in water for two minutes, double the voltage, and finally observe the change of temperature for two more minutes. The graph looks like the pictures attached below. 
The red colored graph is a graph showing water at room temperature being stirred, while the blue colored graph shows how crucial the difference is when the water is heated. We found out the equation for Joule's Law is [P = I^2 R], which was broken down from [P = VI] and [P = V^2/R]. We also found out that the definition of Colomb is how charge falls towards other charge in an atom.  


Work done
In class, we discussed things about work done in many functions. We found out that the equation for work done is [W = integral from a to b of F ds]. We were also given a question to calculate by hand about work given a picture of triangle and an object that we were supposed to sketch a diagram first. It turned out to be like the pictures attached above. 
First, we had to figure out what we calculate, which was Wabc equals to the sum of Wab and Wac. We found out that [Wac = F (h/sin 30) *cos60], however, sin 30 and cos 60 cancels out each other, so it becomes F*h; therefore, Wabc = Fh. 
Work as a function of electric field has an equation of [W = integral from a to b of qe E ds]. We also needed to define which one has the biggest work done and the lowest work done based on the picture above; the result was B has the least amount of work done, followed by C and A, which A has the biggest work done. Based on the calculation before, we found out that the work done on each particle [A = q E d], [B = 0 (because line B is perpendicular, thus work is equal to zero], and [C = q E d cos (theta)], which d is distance.  Work is also equals to change of energy (delta U). Potential energy of point charge has an equation of [ q h (Q/r) + C] and potential energy of electrical has an equation of [q k (Q/r)] or [integral from a to b of q E ds]. We also needed to write an equation of voltage based on the potential energy equation above. The result is [V = (k Q)/r] or [V = integral from a to b of E ds], which [V = PE elec/q] were given first; therefore, we just needed to cancel out the q. Work is also equal to [q (V2 - V1)]. Work and Voltage equation as an electric potential energy and electric field has a form of [W = integral from a to b of - q E ds] and [V = integral from a to b of - E ds + C] or [E = dV/ds].

VPython
The last thing we needed to do in class was about VPython. We were given a set of codes for VPython, and we first needed to predict the outcome of that code by sketching a graph. The picture attached shows how it looks like after we predicted the outcome. We also needed to calculate the Voltage by hand by using [V = k q /r], which k is a constant (9x10^9), q is the charge given in the code, r is the distance from the observation location to charge 1 and charge 2. We needed to find V1 and V2 based on the given code.
Next, we needed to create our own code and sketch a graph based on our own code, however, this time we needed to create three charges instead of two. The picture attached below basically shows the foundation of the code in order to create three charges and three observation locations. Then, we needed to calculate the Voltage by hand, therefore, we spend a lot of time calculating from V1 to V3 based on the given code. 

Thursday, April 9, 2015

Electricity, current, and resistivity (12th day).

Spring 2015
Professor Mason
April 9th class

Light Bulb and Energy
First thing in class, we needed to make a sketch of the set up between battery, light bulb, and wire. We first needed to sketch two ways of how the light bulb would light by using the battery and wire. Then, we also needed to make two sketches of how the bulb would not light up and also the reasons. It would light up because the electricity is going through positive and negative charges through the wire. It would not light up because there is no flow going through the positive and negative charges. We could also double the light by putting two batteries together. We also did an experiment with electroscope machine, and we were asked to predict what would happen if we put two batteries on the tip of that machine, and the result was nothing happened.
We learned that the fundamental definition of energy is the capacity to do work using energy. For example, the battery is giving energy and the bulb is using it up.

Another experiment with battery, wire, and light bulb is making a circuit, so the bulb would light up. We need the second wire for this experiment to go back from the bulb to have positive and negative charges working together in order for the force to go in one direction. We need it to have equilibrium of the charges. 

Voltage, Current, and Power
In class, we had an imaginary experiment dealing with waterfall and hydro electric generator. We need the flow of water in order to run the generator; however, there are two things that we should know about the waterfall, and those are the potential energy and the flow rate. We need a faster and heavier waterfall, which we could get from rising the height of the water fall; then, we need to have a bigger rate of flow of the waterfall in order to run the generator. We come up with an equation of voltage, flow rate (current) and power [V = J/C] or energy per unit charge, [I = C/s] or Ampere = Charges per second, and [P = J/s] or energy per unit time. The relationship between Voltage, Flow Rate, and Power is [P = I V] or Voltage times Current, which will become J/s in the end. Then we need to do a calculation to find the P, which I and V are already given. For example, the I is 12 mA (mili Ampere) and V is 1.5V (Volt), so that P is [0.12 * 1.5 = 0.18 J/s]. 


Next, in class, we were given a question, which asked us to pick the correct one from model A to model D. We chose model D as in the lab manual showed us because the direction of the current will be shown and it will be the same in both wires, which means the current going in and out are the same. 
Current in the wire [I = dq/dt] (C/s) = Ampere. 
We did an experiment in class, which required us to deal with ampere meter. The picture on the right is how the tools are set up. We set up the wire from the negative charge of the battery to the positive charge of the ampere meter; then, we put two wires from the battery (+ and -) and attach them to the light bulb circuit. After that, we attach one of the circuit to the ampere meter.  



Drift Velocity and Current and Ohm's Law
Today, we found out the equation of Current with the function of drift velocity is [I = RHOn q Vd A], which RHOn is the density (charges per unit volume), q is the charge of electron, Vd is the drift velocity, and A is the cross-sectional area perpendicular to the flow (the thicker the wire, the easier the flow is). In class, we also needed to draw graph  I vs V and V vs I; it looks like the picture attached. The equation of the slope is [m = dV/dI] or the derivative of V/I.

Resistance
We also learned resistance in class, which we come up with an equation of [V = I R], which R is the resistivity. The longer the wire, the bigger the resistance is. It also depends on the Area of the wire. For example, wire 1's length is 200cm and has a diameter of 0.25cm; wire 2 has a length of 200cm as well and has a diameter of 0.32cm. The smaller the area is, the bigger the resistance is; therefore, in this case, the wire with the diameter of 0.25cm has a bigger resistance, whilst R is proportional to Length. 
Resistance is proportional to the material as well (copper is good conductor, so the bigger the conductivity is, the smaller the resistance is). It also depends on the length and the area, which leads to an equation of [R = Rho L/A], which Rho is the resistivity, L is the length, and A is the area of the wire. 
Resistance as a function of temperature has a formula of {R = Ro[1+alpha(T-To)]}, which alpha is the temperature coefficient, and it depends on the type of metal. The colder the temperature is, the easier for the electron to go through; as the temperature increases, the resistance increases because there is more collision happening in the wire, thus resistivity is proportional to temperature. 

Monday, April 6, 2015

Flux and Gauss' Law (11th Day)

Spring 2015
Professor Mason
March 31 class

Flux
The first thing we needed to do in class was to type "Caltech E field" on Google, and the link is shown in the picture attached. On the website, it showed us how flux would work and what it would like in Java.
Relationship between Net flux and Net charge is they are proportional to the charge enclosed, [flux = charge/ epsilon] or [flux = integral of E dA cos (theta)].

Gauss' Law
After we were done playing with flux, we did an experiment, which included a cylinder with a piece of paper attached, and we plugged it in to the electrical field machine. When we turned on the machine, the outside part of the paper attached to the cylinder moved, while the inside part of the paper did not.
Next, we needed to think about the maximum possibilities when we have eight positive charges to be attached to a ring, and it would look like this.
It has to be no charges at all in the inner radius of the ring in order to have its maximum distance from each other. 
Then, the professor asked us what we were going to do if there was a lightning storm in the middle of nowhere, and we picked an option, which was to stay under the car because electricity is inductive to the ground. One of ideal conductors is metal object, which has excess charges that are free to move around inside or outside of the conductor, which is one example is car. 


The Gauss' Law conductor is [E = omega / epsilon], which will lead to [flux = polar integral of E da = q in / epsilon]. The charge density is defined as [rho = dq/dv] and [q = integral from 0 to r of rho dv]. If it is sphere, it becomes [q = integral of 4 pi rho r^2 dr from 0 to r] or [rho = 3Q/4pi R^3], and the electric field calculation is [E = q/4pi ^2 epsilon] or the short form of that calculation is [kq/r^2].

Microwave experiment
In class, we did an experiment which includes disc, steel wool and a light bulb. First, we started off with the steel wool. We put the steel wool in the microwave, and then we turned it on; it would light up and show a spark inside the microwave. Next was the compact disc, we also put it in the microwave and turned it on, and it showed us a spark as well. The next one was light bulb, it showed us different color, and it lights up in the microwave.

The picture attached above is a compact disc after it was put in the microwave, it has some scratch or crack mark on the disc. 

The two pictures attached above are the equations for electrical field for cylinder. We know that the surface area of the cylinder is [2 pi r L + 2 pi r^2] (the surface area of the rectangle and 2 circles when we break it apart). Therefore, the equation becomes [E = lambda/ 2 pi r epsilon] as shown above. 

Gravitational Field
We learned gravitational field in class, which has an equation of [F/m = Y] thus, it would become [integral of Y dA = m/G]. Then, we can break the equation down again to [y = mG/ (Re + h)^2] and finally to [Gm/r^2].