Monday, November 23, 2009

C Language


char strNames[256];

scanf("%d", &a);

//this 2 functions cannot be used after scanf because the scanf will post a newline character after execution and gets or fgets will regard it as an input and hence will not prompt for input.

gets(a);
fgets(a, strlen(a), stdin);

Tuesday, November 17, 2009

18.02 Electriciry and Magnetism L04


Electrostatic Potential
The amount of work that I need to do to move a single charge from very far away, to that particular point near the source of electric field, which gives the following
V = kq/r

or from another point of view, the work required to move a single charge from the 2 points
V1 - V2 = W/q
or from another point of view, the (distance moved x Force required to move a single charge)
V1 - V2 = (F / q) d


Electric Energy eV

from W = qV,

we get Energy = Coulombs x Work per Coulombs

for a single electron or proton, 1 coulomb = 1.6 x 10^-19 = e

so the Electric Energy of a accelerating electron can also be given by Ee = eV = 1/2 mev^2


Conservative Field

As long as the difference in altitude is the same, no matter what weird path taken, the energy obtained by moving from this altitude, to the other altitude is the same,.

Equipotential Surfaces

Why a conductor has equipotential everywhere on it? When initially, a charge is introduced to the conductor, of course, there will be an electric field that disrupts the equipotential as the charge will generate an electric field and cause all the electrons to move around, running from high potential to low potential, UNTIL the electrons reaches a state where it is in its lowest potential, ( for electrons this should be highest potential available), by that time, the potential within the conductor should be everywhere zero. thats when we get E = 0 V= Constant

Friday, November 13, 2009

E&M - Electric Flux - Gauss's Law - Examples

3 Types of symmetrical assumption for electric field.

1) Electric field inside a conducting sphere that is perfectly round is zero.
Proof : Using Gauss's Law, set a charge within the sphere, the electric flux coming out from the sphere is a constant, 
8.02.L03.14.00

2) Elecrric field outside a conducting sphere that is perfectly round is same as having a charge at the center of the sphere.
3) Electric field that is between 2 conducing plates that is infinitely large is constant, the electric field near the edges is not zero, or if the ratio of the distance between the 2 plates and the area of the plates is too small.

Tuesday, November 10, 2009

Semiconducting Elements

Transistors

MOSFET
Here we are investigating the VI relation of a transistor using the MOSFET, from the below statement from wikipedia, we get the idea of the current being constant and the resistance of the transistor increases treamendously when the voltage increases, this effect still follow ohm's law's equation V = IR but in a special way that R is changing.
Power MOSFETs are at risk of thermal runaway. As their on-state resistance rises with temperature, if the load is approximately a constant-current load then the power loss rises correspondingly, generating further heat. When the heatsink is not able to keep the temperature low enough, the junction temperature may rise quickly and uncontrollably, resulting in destruction of the device.
P Type and N Type Semiconducting Materials

Is P Type Material positively charged?
Neutral unless you put static electricity onto it. P refers to the fact that conductivity comes from moving holes, which are positive but the electrons have not been removed from the material, they are just being held in the doping material. Having a doped material that conducts does not mean there is charge within the material, the amount of electrons and protons are still the same, just there are valence electrons floating around or vice versa....
http://in.answers.yahoo.com/question/index?qid=20070208022909AAGkOdU


Depletion Region of PN Junction Diode
http://www.ece.utep.edu/courses/ee3329/ee3329/Studyguide/Shockwave/PNjunctions/Demos/PNJunctionDiode.html#

Sunday, November 8, 2009

Graphing Software

Geogebra - 2D graphing and analysis
http://www.geogebra.org/webstart/geogebra.html

Virtual Oscilloscope - Web Based mouse controlled virtual CRO
http://www.virtual-oscilloscope.com/help/x-y_button.html

Virtual CRO - Command Line virtual CRO, buggy
search at google

Lissajous Figure Simulation - Java Applet
http://lectureonline.cl.msu.edu/~mmp/kap23/Oscilloscope/app.htm

created my own Lissajour Figures in Geogebra












Website that has loads of lists of electrical component simulations

http://www.educypedia.be/electronics/javameasurement.htm

Saturday, November 7, 2009

Moment of Inertia

Rotational Kinetic Energy :

Derived from Linear Kinetic energy :

EK = 1/2 mv^2 = 1/2 [m(r^2)](w^2) ------------> angular speed does not change within whole rigid body
Moment of Inertia is defined as
I = mr^2

MIT OCW Walter Lewin 8.01 L03 Fall 1999

Two Shortcuts to ease the finding of Moment of Inertia of an object
1) plugin another axis and I = Icenter + m d^2 where d is the distance between the center axis and the plugged axis
2)

Rotational Kinetic Energy can be stored in flying wheel for coverting into useful forms of energy when applicable. Eg : Toy cars, Neutron Star, earth, huge flying wheel in MIT magnetic labs





Friday, November 6, 2009

Vector, Forces

The Dot Product of a vector represents the scalar quantity of the combined vector, theoritically, only when 2 vectors of the same magnitude and opposite direction will cancel each other just like in forces, but according to the
A = ai + bj
B = ci + dj
a*b + c*d = |A||B|cosC

when angle C becomes 90 degrees, the Dot Product will become zero, what does this actually mean? the magnitude of the combined vector becomes zero? or the two vectors does not influence each other?
If the two vectors does not influence each other, why vectors without an angle of 90 degrees can be calculated to get a magnitude since they can be seperated into the x and y axis also.?

From my point of view, I think that the flaw of the vector rule lies at the interchanging of sides of the triangle when the angle becomes 90 degrees, cosine is no longer the case at this particular point, instead tangent should be used to obtain the actual angle and magnitude. Or maybe, tangent is the ultimate solution for the angle and the pathagoreom theorem is the ultimate solution for the magnitude by having to seperate everything into x,y,z axis beforehand.

After reviewed the material from MIT OCW, multivariable calculus lecture 1, The application of the vector is just to obtain the angle of 2 vectors and determine whether 2 vectors are perpendicular to each other, in that sense, the vector theorem has no flaws at all. There is still a struggle of the value obtained for |A||B|cosC, they said it is a scalar value, scalar value in the sense of what? two vectors of the same magnitude and direction cannot even add up with each other by using the dot product.

Answer :

So, that means geometrically, my two vectors are going more or less in the same direction. They make an acute angle. It's going to be zero if the angle is exactly 90°, OK, because that's when the cosine will be zero. And, it will be negative if the angle is more than 90°. So, that means they go, however, in opposite directions. So, that's basically one way to think about what dot product measures. It measures how much the two vectors are going along each other.
Quoted from MIT OCW 18.02 fall 2007

The meaning of DOT PRODUCT of 2 2D vectors, to determine how much a component A goes along component B, normally we compute this by setting component B as a unit vector so it does not causes any disturbance in the process.

Application of DOT PRODUCT
1) obtain angle between 2 vectors
2) Check whether 2 vectors are perpendicular to each other
3) determine the how much does component of Vector A goes along Vector B
4) Area of a parallelogram = |A| |B| sinC proven by base x height, | A || B | sinC = | A' || B | cos (90-C) = A ' . B = det (A, B)

Det(A,B,C) = + - Volume of parallelepipe

CROSS PRODUCT - L02 33.00
cross product of 2 vectors in 3D space
Definition : A x B = | i j k |
| a b c |
| d e f |
Definition : | A x B | which is the length of vector A and B = area of parallelogram formed by vector A and B

From 8.01 L03 fall 1999, Professor Lewin mention that the magnitude of The cross product is simply | A || B | sin C and the direction is just perpendicular to vector A and B, that clears the mystery of why length of A x B will equal to area of a parallelogram.


Application of CROSS PRODUCT
1) |A x B| = Area of parallelogram
2) dir (A x B) = Combined VectorAB that weirdly follows the right hand rule and goes along the third axis that is perpendicular to vector A and vector B.
Right Hand Rule => a) hand point along direction of A b) fingers point towards the direction of B c) the direction the thumb points is dir (A x B).

Geometrically, drawing A B C and using base x height, we get A . (B x C)
finally we check that,

Det(A,B,C) = A . (B x C)
for the full explaination refer to
18.02 L02 52.28

Extending the Applications
if the third vector C is parallel to the plane of AB we get,
C x (A . B) = 0
means that the volume obtained by taking the triple scalar product is zero.
N = A x B , which N is the vector perpendicular to the plane AB
C . ( N ) = 0, which C has no components, or is perpendicular along N

Matrix that turns the plane 90degrees clockwise or anticlockwise
| 0 -1 |
| 1 0 |