Thursday, January 26, 2012

What is Gradient ? - 2, Primitive understanding

What is Gradient ? - Continuation

In the previous post on Gradient <What is Gradient ? Basic understanding>, I introduced as

Wiki (26-Jan-2012) introduces gradient as

"
In vector calculus, the gradient of a scalar field is a vector field that points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.

"

It is more like a definition, not an explanation to those who do not know gradient well. But this is not a definition. Many simple articles on gradient do not explain why so. Some articles explain why by using "directional derivative" but the explanations are roundabout and we must understand first what "directional derivative" is before understanding gradient.

Notes: 

1) the greatest rate of increase of the scalar field

 Please note that this is not  <the greatest increase of the scalar field>

As the definition-like statement above talks of scalar field and vector field then we must think every possible point (all possible points) and every tiny time (down to the limit) when we talk and think of a field. But here we can forget time and focus on only space and scalar values at all possible points which are regarded as a scalar field as a whole and change it to a vector field to see things differently.

The key word or concept is <points>, which exist in /on 1D and 2D and in 3D. Each point has zero dimension (0D) or is in zero dimension (0D) or a point itself is zero dimension (0D).

First, consider the distance between the two points.

    Point A    ---->   .                .  <--- point B

The distance is obvious.

Second, consider the distance between a point and straight line.


    Point A    ---->   .  

    _______________________    Line B

There are many distances but the shortest distance is 

Point A    ---->   .  
                           l
                           l
                           l____________    Line B

The length of the perpendicular straight line from the point Point A to the line B.

This is also obvious.

Third, we consider a curve

Point A   .  -----> c <--- curve C

Point A    ---->   .  
                           l
                           l
                           l
                            .     <---- Point B  and tangent line
                 -                 -                             
         -                                 -               <--- curve C   (please try to see these points as a curve.
   -                                             -                  

 
We can consider the shortest distance from Point A to curve C is the length of the perpendicular straight line from the point Point A to the curve C. We find point B on the tangent line

Forth, we can do the same thing - the shortest distance from a point to a surface, wither flat or curved space. I do not show it here but if we cut a surface properly we see the above figure.

The key word or concept is <the perpendicular straight line>. This (the shortest distance from a point to another point is  <the perpendicular straight line>) is considered to be obvious at this primitive stage of understanding gradient. Perpendicular straight lines are used in gradient calculation but largely hidden because they are obvious.

We may be able to consider this <the perpendicular straight line> as < the greatest (fastest) rate of increase of the scalar field> not because this is obvious but because

1) the the length of shortest straight line is regarded as the fastest space rate change of  the scalar values the two different points.

2) 1) is analogous to the fact the the shortest time to travel a certain distance or move  from one point to the other point is regarded as the fastest time rate change of the movement.


-------------

The introduction of wiki (11-Sept-2015) on "directional derivative" says

"
In mathematics, the directional derivative of a multivariate differentiable function along a given vector v at a given point x intuitively represents the instantaneous rate of change of the function, moving through x with a velocity specified by v. It therefore generalizes the notion of a partial derivative, in which the rate of change is taken along one of the coordinate curves, all other coordinates being constant.

"

The last part <a partial derivative, in which the rate of change is taken along one of the coordinate curves, all other coordinates being constant.> may give us a hint but again roundabout we must understand first what "coordinate curves" are.


Common explanation and equation of gradient

Also from wiki on gradient (11-Sept-2015)

"
In the three-dimensional Cartesian coordinate system, this is given by
\nabla f = \frac{\partial f}{\partial x} \mathbf{i} +
\frac{\partial f}{\partial y}  \mathbf{j} +
\frac{\partial f}{\partial z} \mathbf{k}
where i, j, k are the standard unit vectors.
"

When we use this we can re-write the above

"
<a partial derivative, in which the rate of change is taken along one of the Cartesian coordinate system, all other coordinates being constant.>

"

Tangent and tangent line

We must recall a tangent line (not a plane) of a 2D function of x, y,  f (x, y). The tangent line shows the slope (the result of differentiation) of the curve at the point P where the tangent line and the curve meets at one point (place). The place must be only one point otherwise the line does not touch the curve but departs from or crosses the curve. The slope (tangent) is usually measured as a ratio of 'b' to 'a' of a triangle. Tangent is a ratio,  taking 0 (zero) to infinite (∞, -∞), not a degree of angle. 


                          /l
                        /  l
                      /    l
                c  /      l   b
                  /        l
                /          l
              /            l
            /_______l 
                  a (1)     


                                 b
tangent (angle) =    ----
                                a

or more mathematically by using the unit length (one) of 'x' to 'y' length with  of a triangle the direction from the x-axis (horizontal) to the y-axis which is vertical to the x-axis or in another word differs by 90 deg or 1/2π from x-axis counter-clock wise, and sin (1/2π) is 1 and cos (1/2π) is 0 (zero). In this case (Cartesian coordinate system) we can show a direction with x-axis direction, y-axis direction and z-axis direction in 3D. The important thing is x-axis, y-axis and z-axis are mutually perpendicular and these axes are straight lines.

Multivariable equation

The other thing which we must have some concept about for understanding gradient is the multivariable equation.

Multivariable equation is usually expressed as

f (x, y)
f (x, y, z) 
f (x, y, z, ...) 

For instance,

f (x, y) = x + y or f  is a function of <x plus y>.  x and y are variable and can take any value.

x = 0, y = 0,  f (x, y) = 0
x = 1, y = 0,  f (x, y) = 1
x = 0, y = 1,  f (x, y) = 1
x = 1, y = 1,  f (x, y) = 2

Let's do some more.

y = 0

x = - 3, y= 0,  f (x, y) = -3
x = -2, y= 0,  f (x, y) = -2
x = -1, y= 0,  f (x, y) = -1
x = 0, y= 0,  f (x, y) = 0
x = 1, y= 0,  f (x, y) = 1
x = 2, y= 0,  f (x, y) = 2
x = 3, y= 0,  f (x, y) = 3

x = - 0.1, y= 0,  f (x, y) =  - 0.1
x = - 1/3, y= 0,  f (x, y) = - 1/3 (-0.33333....)
x = -0.5, y= 0,  f (x, y) = - 0.5
x = 0, y= 0,  f (x, y) = 0
x = 0.1, y= 0,  f (x, y) =  0.1
x = 1/3, y= 0,  f (x, y) =  1/3 (0.33333....)
x = 0.5, y= 0,  f (x, y) =  0.5

x = 0

x = 0, y= -3,  f (x, y) = -3
x = 0, y= -2,  f (x, y) = -2
x = 0, y= -1,  f (x, y) = -1
x = 0, y= 0,  f (x, y) = 0
x = 0, y= 1,  f (x, y) = 1
x = 0, y= 2,  f (x, y) = 2
x = 0, y= 3,  f (x, y) = 3

y = 1

x = -4, y = 1,  f (x, y) = -3
x = -3, y = 1,  f (x, y) = -2
x = -2, y = 1,  f (x, y) = -1
x = -1, y = 1,  f (x, y) = 0
x = 0, y = 1,  f (x, y) = 1
x = 1, y = 1,  f (x, y) = 2
x = 2, y = 1,  f (x, y) = 3


x = 1

x = 1, y= -4,  f (x, y) = -3
x = 1, y= -3,  f (x, y) = -2
x = 1, y= -2,  f (x, y) = -1
x = 1, y= -1,  f (x, y) = 0
x = 1, y= 0,  f (x, y) =  1
x = 1, y= 1,  f (x, y) = 2
x = 1, y= 2,  f (x, y) = 3

Very simple and primitive, monotonous and a lot of freedom. No special meaning, isn't it ?  

y = x

This is a very primitive function as well.  We can change this to a form of f (x, y).
 
f (x, y) = y - x = 0

But this is misleading as f (x, y) can be regarded as  f (x, y) = y - x or f (x, y) = y - x = 0 as above. The latter means  f (x, y) is <y - x = 0>. So there are two possibilities.

1) f (x, y) = y - x and 2) f (x, y): y - x = 0

1)  f (x, y) = y - x

This is quite general as x and y can take any number in the range of <-∞> through <0> to <+ ∞> and calculate it and get a result (number). This is also rather abstract or like playing with numbers.

y = 0

x = - 3, y= 0,  f (x, y) = 3
x = -2, y= 0,  f (x, y) = 2
x = -1, y= 0,  f (x, y) = 1
x = 0, y= 0,  f (x, y) = 0
x = 1, y= 0,  f (x, y) = - 1
x = 2, y= 0,  f (x, y) = - 2
x = 3, y= 0,  f (x, y) = - 3

Of course we can take +/-0.1, +/- 1/3, +/-0.5, etc up to +/- 1.

x = - 0.1, y= 0,  f (x, y) =  0.1
x = - 1/3, y= 0,  f (x, y) = 1/3 (0.33333....)
x = -0.5, y= 0,  f (x, y) = 0.5
x = 0, y= 0,  f (x, y) = 0
x = 0.1, y= 0,  f (x, y) = - 0.1
x = 1/3, y= 0,  f (x, y) = - 1/3 (0.33333....)
x = 0.5, y= 0,  f (x, y) = - 0.5

some more


x = 0

x = 0, y= -3,  f (x, y) = -3
x = 0, y= -2,  f (x, y) = -2
x = 0, y= -1,  f (x, y) = -1
x = 0, y= 0,  f (x, y) = 0
x = 0, y= 1,  f (x, y) = 1
x = 0, y= 2,  f (x, y) = 2
x = 0, y= 3,  f (x, y) = 3

y = 1

x = -3, y = 1,  f (x, y) = 4
x = -2, y = 1,  f (x, y) = 3
x = -1, y = 1,  f (x, y) = 2
x = 0, y = 1,  f (x, y) = 1
x = 1, y = 1,  f (x, y) = 0
x = 2, y = 1,  f (x, y) = -1
x = 3, y = 1,  f (x, y) = -2
x = 4, y = 1,  f (x, y) = -3
x = 5, y = 1,  f (x, y) = -4

x = 1

x = 1, y= -2,  f (x, y) = -3
x = 1, y= -1,  f (x, y) = -2
x = 1, y= 0,  f (x, y) = -1
x = 1, y= 1,  f (x, y) = 0
x = 1, y= 2,  f (x, y) = 1
x = 1, y= 3,  f (x, y) = 2
x = 1, y= 4,  f (x, y) = 3


Can we find anything particular in this fairly general equation?  Maybe some symmetries.
As up to here very numerical, mechanical, monotonous or abstract we visualize them by using a graphs, relatively simple in this case. How to visualize these ?

We can plot f (x, y) on a common x-y plane (Cartesian coordinate) as showing the location.

f (x, y) = x - y

y = 0

x = - 3, y= 0,  f (x, y) = 3
x = -2, y= 0,  f (x, y) = 2
x = -1, y= 0,  f (x, y) = 1
x = 0, y= 0,  f (x, y) = 0
x = 1, y= 0,  f (x, y) = - 1
x = 2, y= 0,  f (x, y) = - 2
x = 3, y= 0,  f (x, y) = - 3

<x-y locations>

                         y
                             l 
                             l
                             l
                             l
  -3     -2     -1       l 0      1      2       3

--*-----*-----*-----*-----*-----*-----*--------
                             l                                x
                             l   
                             l     
                             l
                      

But where to put the result of the equation: 3, 2, 1, 0, -1, -2, -3.

If we put these results on x-axis, it becomes very confusing and wrong as these number are not the value of x but the value of the calculation results of f (x, y) = x - y and when y = 0. Putting these results on y-axis is also wrong by the same reason.

We can draw a line showing the plot on another independent line from the line of  f (x, y) = x - y.

Result

   -3      -2     -1       0      1       2       3
---*-----*-----*-----*-----*-----*-----*---- 

One more

f (x, y) = x - y

x =1

x = 1, y= -2,  f (x, y) = -3
x = 1, y= -1,  f (x, y) = -2
x = 1, y= 0,  f (x, y) = -1
x = 1, y= 1,  f (x, y) = 0
x = 1, y= 2,  f (x, y) = 1
x = 1, y= 3,  f (x, y) = 2
x = 1, y= 4,  f (x, y) = 3

<x-y locations>

                         y
                   l          l    
                   l         *  4
                   l          l       
                   l         *  3
                   l          l    
                   l         *  2
                   l          l     
                   l         *  1
                   l          l   

--------------------- *-------------
                0 l    1    l                    x
                   l         *  -1
                   l          l  
                   l         *  -2
                   l          l         
                   

Result shown on another independent line


   -2      -1      0       1       2       3      4
---*-----*-----*-----*-----*-----*-----*---- 


Possible but difficult to co-relate the position (location) of (x, y) and the results of f (x, y) = x - y.

One of the many ways to visualize the co-relation between the location and the resulting value is to show the results as z-value of z-direction, which is perpendicular to the x-y plane as a rule.

The first one above f (x, y) = x - y, y = 0

The result can be shown as below.

^  z
l

  *(3)
       
           * (2)
              
                    * (1)
  -3     -2      -1      0       1       2       3

--*-----*-----*-----*-----*-----*-----*-------- 
                               (0)                                 x
                                      * (-1)
                   
                                             * (-2)
                                                  
 l                                                      * (-3)
V   z 


As y = 0 (constant) we can draw a graph in 2D (x-z plane). You can connect (3) - (2) - (1) - (0) - (-1) - (-2) - (-3) by a line.

Now we think of the slope (tangent) of this line on the x-z plane. It is simple and that is <-1>.

The second one

<f (x, y) = x - y line>, x = 1

The result can be shown as below.

^  z
l

  *(3)
       
           * (2)
              
                    * (1)
   4       3      2       l       0      -1      -2

--*-----*-----*-----*-----*-----*-----*-------- 
                               (0)                                 y
                                      * (-1)
                   
                                             * (-2)
                                                  
 l                                                      * (-3) 
V   z 

As x = 1 (constant) we can draw a graph in 2D (the y-z plane shifted by + 1x). You can connect (3) - (2) - (1) - (0) - (-1) - (-2) - (-3) by a line. Again we think of the slope (tangent) of this line on the y-z plane and again we get <-1>.

Then we think of <gradient> concept. The z values can be considered as some scalar values (height, temperature).

Height is somewhat misleading as z value can be taken as height of the 3D. But this is true. So let's consider the z value shows the height at a certain specified location on the x-y location, specified by the values (numbers) of x and y of the function f (x, y). The slope simply means slope. Meanwhile y = 0 so on either x-y plane or y-z plane the slope of y to x or z is zero intuitively.

Now we use the gradient formula shown at the beginning.

\nabla f = \frac{\partial f}{\partial x} \mathbf{i} +
\frac{\partial f}{\partial y}  \mathbf{j} +
\frac{\partial f}{\partial z} \mathbf{k}

f (x, y) :  x - y = z  -->  x - y - z = 0

Grad f (x, y, z) = Grad  (x - y - z) 

When y = 0  (constant)

(dx/dx) i + (d(-y)/dy) j  - d(-z)/dz)) k =  1i - 0j - 1k

1i - 1k  ---> This shows

1) a vector showing a direction (i, j, k are unit vectors and mutually perpendicular as a rule)
2) the slope is <-1> on x-z plane (also as shown in the above graph)
3) the magnitude is √2 .


The other example shown above.

f (x, y) = x - y = z ---> f (x, y) = x - y - z = 0

Grad f (x, y, z) = Grad  (x - y - z)

When x =1 (constant)

0 i + (d(-y)/dy)) j  - d(-z)/dz)) k =  0i - 1j - 1k

1j - 1k    ---> This shows

1) a vector showing a direction
2) the slope is <-1> on y-z plane (also as shown in the graph below)
3) the magnitude is √2 .

The gradient formula seems to work though we are in a very simple or quasi 3-D space as y = 0 (constant) and x = 1 (constant). We can get more lines by changing the value of x other than <0>, the value of y other than  <1> though still these values of x and y are constant.
We can play with numbers and graphs and may get some meanings if we continue. But we change to 

2) f (x, y): y - x = 0

This is lot more restricted than f (x, y) = y - x. In this case the values (numbers) of x and y must satisfy this equation so we cannot take any value (number) we like. In other words <=0> has a significant role.

When y = -3, x must be -3
When y = -3, x must be -2
When y = -1, x must be -1
When y = 0, x must be 0
When y = 1, x must be 1
When y = 2, x must be 2
When y = 3, x must be 3

i.e. x must be equal to y or y must be equal to x as y and x are treated as independent and dependent mutually in case f (x, y): y - x = 0. This is a big restriction or constrain or rule which we cannot break or change. 

And we can think of  

f (x, y): y - x = z = 0

As z = 0,  f (x, y): y - x = 0 is on the x - y plane, i.e. 2D.

 

            y   l         /  <--   y - x = 0 or y = x at z = 0
                 l       /
                 l     /
                 l   /
                 l /
________ l ________
               / l                 x
             /   l       
           /     l         
         /       l            
       /         l            



We apply <gradient>

Grad (y - x - z)

z = 0

(dy/dy) j + (d(-x)/dx) i + 0k  = j - i

The slope of the gradient of y - x = 0 is <-1>

A very interesting thing is that the original equation y - x = 0 or y = x. The slope is <+1>. Simple thing but the slope of the gradient of y - x = 0  is <-1> which is perpendicular to the slope <+1>.


One more sample.

y= x2

We change this to a form of f (x, y),

f (x, y) = y - x2 = 0

But this is misleading as f (x, y) can be made as  f (x, y) = y - x2 or f (x, y) = y - x2 = 0 as above. The latter means - f (x, y) is y - x2 = 0. So again there are two possibilities.

1) f (x, y) = y - x2 and 
2) f (x, y) : y - x2 = 0

1) f (x, y) = y - x2

This is quite general as x and y can take any numbers in the range of <-∞> through <0> to <+ ∞> and calculate and get a result (number). This is also rather abstract or playing with number.

x = - 3, y= 0,  f (x, y) = -9
x = -2, y= 0,  f (x, y) = -4
x = -1, y= 0,  f (x, y) = -1
x = 0, y= 0,  f (x, y) = 0
x = 1, y= 0,  f (x, y) = -1
x = 2, y= 0,  f (x, y) = -4
x = 3, y= 0,  f (x, y) = -9

Of course we can take +/-0.1, +/- 1/3, +/-0.5, etc up to +/- 1.

x = - 0.1, y= 0,  f (x, y) = -0.01
x = - 1/3, y= 0,  f (x, y) = - 1/9 (0.011111....)
x = -0.5, y= 0,  f (x, y) = - 0.25
x = 0, y= 0,  f (x, y) = 0
x = 0.1, y= 0,  f (x, y) = - 0.01
x = 1/3, y= 0,  f (x, y) = - 1/9
x = 0.5, y= 0,  f (x, y) = - 0.25

some more

x = 0, y= -3,  f (x, y) = -3
x = 0, y= -2,  f (x, y) = -2
x = 0, y= -1,  f (x, y) = -1
x = 0, y= 0,  f (x, y) = 0
x = 0, y= 1,  f (x, y) = 1
x = 0, y= 2,  f (x, y) = 2
x = 0, y= 3,  f (x, y) = 3

x = -3, y = 1,  f (x, y) = -8
x = -2, y = 1,  f (x, y) = -3
x = -1, y = 1,  f (x, y) = 0
x = 0, y = 1,  f (x, y) = 1
x = 1, y = 1,  f (x, y) = 0
x = 2, y = 1,  f (x, y) = -3 
x = 3, y = 1,  f (x, y) = -8 

x = 1, y= -3,  f (x, y) = -4
x = 1, y= -2,  f (x, y) = -3
x = 1, y= -1,  f (x, y) = -2
x = 1, y= 0,  f (x, y) = -1
x = 1, y= 1,  f (x, y) = 0
x = 1, y= 2,  f (x, y) = 1
x = 1, y= 3,  f (x, y) = 2
x = 1, y= 4,  f (x, y) = 3
x = 1, y= 5,  f (x, y) = 4 

We can play with numbers and may get some meanings if we continue. But we change to 

 2) f (x, y) : y - x2 = 0

 
This is a lot more restricted than f (x, y) = y - x2. In this case the values (numbers) of x and y must satisfy this equation so we cannot take any value (number) we like. In other words <= 0> has a significant role.

When y = 0, x must be 0
When y = 1, x must be +/- 1
When y = 2, x must be +/- √2
When y= 3, x must be +/- √3
When y= 4, x must be +/- 2

To differentiate y= x2 with respect to 'x' we get

 y = 2x

which shows the slope or tangent (ratio of y to x or y/x) of y= x2 at any point of / on y= x2. 

When x = 0, y = 0
When x = 1, y = 2
When x = -1, y = -2 
When x = 2, y = 4
When x = -1, y = -4
When x = 3, y = 9
When x = -3, y = -9

which means

At (0, 0) of / on y= x2  the slope is 0. we cannot calculate y/x but can easily guess.
At (1, 1) the slope is 2.
At (-1, 1) the slope is -2
At (2, 4) the slope is 4
At (-2, 4) the slope is -4
At (3, 9) the slope is 9
At (-3, 9) the slope is -9

Now we partially differentiate f (x, y),    

f (x, y) = y- x2

First with respect "only" to 'x' 

f 'x(x, y) = y -2x

At the point (0, 0),  f ' x(0, 0) = 0 -2 x 0 = 0

At the point (1, 1),  f 'x(1, 1) = 1 -2 x 1 = -1

At the point (-1, 1),  f 'x(-1, 1) = 1 -2 x (-1) = 3 

At the point (2, 4),  f 'x(2, 4) = 4 - 2 x 2 = 0

At the point (-2, 4),  f 'x(-2, 4) = 4 -2 x (-2) = 8

At the point (3, 9),  f 'x(3, 9) = 9 - 2 x 3 = 3

At the point (-2, 4),  f 'x(-2, 4) = 9 - 2 x (-2) =13

Now with respect "only" to 'y'

f 'y(x, y) = 1 - x2

At the point (0, 0),  f ' x(0, 0) = 1 - 0 = 1

At the point (1, 1),  f 'x(1, 1) = 1 - 1 x 1 = 0

At the point (-1, 1),  f 'x(-1, 1) = 1 - (-1) x (-1) = 0

At the point (2, 4),  f 'x(2, 4) = 1 - 2 x 2 = -3

At the point (-2, 4),  f 'x(-2, 4) = 1 - (-2) x (-2) = -3

At the point (3,9),  f 'x(2, 4) = 1 - 3 x 3 = -8

At the point (-3, 9),  f 'x(-2, 4) = 1 - (-3) x (-3) = -8

Something wrong?

f (x, y) = y - x2

First with respect "only" to 'x' 

f 'x(x, y) = y - 2x

This is wrong as 'y' should be treated as a constant (no rate change) with respect to 'x'. so

f 'x(x, y) = 0 - 2x = - 2x

We can differentiate with respect to 'x' as follows:

f 'x(x, y) = d/dx (y- x2) = dy/dx - dx2/dx = dy/dx - 2x

if f (x, y) = y- x2 = 0

dy/dx - 2x = 0

dy/dx = 2x

this is correct.


while  with respect "only" to 'y'

f 'y(x, y) = 1 - x2

This is wrong as 'x' should be treated as a constant (no rate change) with respect to 'y'. so

f 'y(x, y) = 1 - 0 = 1


We can differentiate ) with respect to 'x' as follows:

f 'x(x, y) = d/dx (y- x2) = dy/dx - dx2/dx = dy/dx - 2x

if f (x, y) = y- x2 = 0

dy/dy - d x2/dy = 0

1 - dx2/dy = 0

 dx2/dy =1

(dx2/dx) (dx/dy) = 1  (Chane rule)

2x (dx/dy) = 1

dx/dy = 1/2x  (please recall dy/dx = 2x)

This is a reciprocal function of  'y = 2x'.

Meanwhile we can proceed as follows:

y =  x2

              __               1/2
x = +/- √ y   =  +/- y

                                 -1/2
x' (f'(x) = +/- (1/2) y 

                         1
             = +/-  ------_
                         2  √ y




Now we will be back to
 
\nabla f = \frac{\partial f}{\partial x} \mathbf{i} +
\frac{\partial f}{\partial y}  \mathbf{j} +
\frac{\partial f}{\partial z} \mathbf{k}

f 'x(x, y) + f 'y(x, y) = -2xi  + 1j = -2xi + j

This is the gradient of f (x, y) = y- x2 or this is the gradient f (x, y) = y- x2 = 0.  

The slope or tangent is <-2x / +1> or <-2x> and

 the magnitude is
   ______
 √4x2 + 1 .

The slope and the magnitude are a function of x.


y - x2 = 0

y- x2 = z = 0

and take 'z' as the vertical axis to the x-y horizontal plane, 'z' is regarded as height, which means that any place (point) on y= x2 is zero (no height, or sticking on the x-y plane). If we take a color (instead of height, the sane scalar value becomes a constant color, say 'red'. So the color of or on y= x2 is all 'red'. Color is regarded to represent another dimension, independent but related with y= x2. See below:

2-Dimensional Gradient v. 1.2

2-Dimensional Gradient (2DG) produces a new layer containing a gradient that changes in two dimensions. People using non-English-language GIMP installations are encouraged to upgrade to this version.
9 sample gradients follow (collected into a single image):
9 sample patterns produced by this Script-Fu

We will be back to z (vertical axis) idea.


            z   l         /
                 l       /
                 l     /
                 l   /
                 l /
________ l ___________
               /l                     x
             /  l       
           /    l         
         /      l            
y(+)/        l            


This is the 3D representation.

y- x2 = 0 is just in case of z = 0 while z can take any value but a constant (scalar) value.

Let's take some actual values of f (x,y) = y- x2 = 0

When x = 0, y = 0

When x = 1, y = 1. When x = -1, y = 1 as well

When x = 2, y = 4. When x = -2, y = 4.

Actually the above values are all on the y = x2 on the x-y plane (z = 0) or y- x2 = 0

Now we consider z is not 0. Say z = 1. that is y- x2 = 1. Please note that this is not y - x2 = 1 or y = x2 +1 on the x-y plane. 1 is the value of z axis. Then we take the same procedure as above.

y- x2 = 1

When x = 0, y = 1


When x = 1, y = 2. When x = -1, y = 2 as well.

When x = 2, y = 5. When x = -2, y = 5.

 When x = 3, y = 10. When x = -3, y = 10.

If we plot these values all the values are on the y = x2 + 1. The value 1 is the value of z
(constant height).


Back to simple x-y plane (2D),  y = x2 + 1 means the all the y values are shifted to up by 1 in the direction of the y axis. They do not simply go up by value a to z direction.

Let's try some other values. - z direction, for instance.

y- x2 = -1

When x = 0, y = -1

When x = 1, y = 0. When x = -1, y = 0 as well.

When x = 2, y = 3. When x = -1, y = 3

 When x = 3, y = 8. When x = -3, y = 8

If we plot these values all the values are on the y = x2 - 1. The value -1 is the value of z
(constant height).


Again back to simple x-y plane (2D), the all the y values are shifted by 1 in the minus direction or <-1> of the y axis. They do not simply go down by 1 value a to the z direction.

If we take all the possible values satisfying y- x2 = z (z is now any constant value) we can get a parabola like surface going up along z axis. And the level lines (by cutting this parabola like surface horizontally) are all parabola shape satisfying y- x2 = z. The value of z is the height as well as the shifting factor in the y-direction as y = x2 + z.

Now we consider a tangent line on this parabola like surface. Let's use the level curve at z = 0, that is on the x-y plane. Actually any z value is OK to find the meaning of a tangent line. The tangent line at the point (1, 1) or (1,1,0) on the x-y plane can be show as y = 2x or y - 2x = 0 or can be as (1, 2, 0). The last one (1, 2, 0) shows the direction of  y = x2 at the point (1, 1) or (1,1,0): to the x-direction is 1, y-direction 2, z-direction 0. Since this is not a gradient vector, no magnitude.

Tangent line means the slope or rate change of 'y' with respect to 'x' of y = x2 . So moving forward or backward from the point P is always with the same slope. For the vertical direction remains z = 0. The biggest difference from the direction of this slope at P is the perpendicular direction to the tangent line and on the parabola like surface, not straight up- or down- word parallel with z axis.

The direction is OK. How bout the rate change?

The partial derivative of the parabola surface f(x,y) = y - x2 = z at the point (1,1,0) is (-2, 1, 0) from (-2x, 1) which is a partial differentiation of f (x,y) = y - x2 with z = 0 calculated above (shown below again)

f 'x(x, y) + f 'y(x, y) = -2xi  + 1j = -2xi + j  

 So the rate change is -2 of x-direction and 1 of y direction. (the direction is y = -2x).


Ref: http://www.math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/grad/grad.html

This article is short and well explained.

"

The Gradient and Directional Derivative 

The gradient of a function w = f (x,y,z) is the vector function:

displaymath62

For a function of two variables z = f(x,y), the gradient is the two-dimensional vector. This definition generalizes in a natural way to functions of more than three variables. 

Examples
For the function z =f (x,y )= 4x2+y2. The gradient is

displaymath64

For the function w = g (x,y,z) = exp (xyz) + sin (xy), the gradient is

displaymath66

 
Geometric Description of the Gradient Vector
 
There is a nice way to describe the gradient geometrically. Consider z = f (x,y) = 4x2+y2. The surface defined by this function is an elliptical paraboloid. This is a bowl-shaped surface. The bottom of the bowl lies at the origin. The figure below shows the level curves, defined by f (x,y) = c, of the surface. The level curves are the ellipses 4x2+y2 = c.


The gradient vector <8x,2y> is plotted at the 3 points (sqrt(1.25),0), (1,1), (0,sqrt(5)). As the plot shows, the gradient vector at (x,y) is normal to the level curve through (x,y). As we will see below, the gradient vector points in the direction of greatest rate of increase of f (x,y)
In three dimensions the level curves are level surfaces. Again, the gradient vector at (x,y,z) is normal to level surface through (x,y,z).

Directional Derivatives
 
For a function z = f (x,y), the partial derivative with respect to x gives the rate of change of f in the x direction and the partial derivative with respect to y gives the rate of change of f in the y direction. How do we compute the rate of change of f in an arbitrary direction?
The rate of change of a function of several variables in the direction u is called the directional derivative in the direction u. Here u is assumed to be a unit vector. Assuming w = f (x,y,z) and u =, we have 

displaymath68

Hence, the directional derivative is the dot product of the gradient and the vector u. Note that if u is a unit vector in the x direction, u=<1,0,0>, then the directional derivative is simply the partial derivative with respect to x. For a general direction, the directional derivative is a combination of the all three partial derivatives.

Example
 
What is the directional derivative in the direction <1,2> of the function z = f (x,y) = 4x2+y2 at the point x=1 and y=1. The gradient is <8x,2y>, which is <8,2> at the point x=1 and y=1. The direction u is <2,1>. Converting this to a unit vector, we have <2,1>/sqrt(5). Hence,

displaymath70

Directions of Greatest Increase and Decrease
 
The directional derivative can also be written:

displaymath72

where theta is the angle between the gradient vector and u. The directional derivative takes on its greatest positive value if theta=0. Hence, the direction of greatest increase of f is the same direction as the gradient vector. The directional derivative takes on its greatest negative value if theta = pi (or 180 degrees). Hence, the direction of greatest decrease of f is the direction opposite to the gradient vector.


"


Level Curves

Like the above article, most articles on gradient introduce 'level curves' . The level curve shows the same level or value of <scalar value> in 3D like temperature in a room and hill's height. But we must consider well 'temperature' and 'height'.

Level curves of Temperature

Temperature distribution in a room is 3D. So if we check the location of a certain fix temperature and show the measurement result it may become a curved line in 3D or a curved surface of certain thickness in 3D. Then we measure a different fixed temperature and do the same thing. We can paint them with a certain color to visualize them. Then we get another curved line or curved surface. We can paint them with another color to visualize them. But how to calculate the degree of change of temperature spatially. Another way is to use <projection>.  But this is misleading in this case because we cannot show the heights which are supposed to be continually differ.

f (x, y, z) = c (constant)

Level curves of Heights

This is another story. We can use <projection> as the height is the same.

f (x, y), z = c


sptt

Wednesday, January 25, 2012

What is Gradient ? - Basic understanding

What is Gradient ?

Gradient is not just a slope of of a certain function. It is an operator to change a scalar field to a vector field. A scalar field has no direction like temperature, density, energy, and Electric Potential of Voltage. It seems simple as you do not have to analyze it (a scalar field) in terms of direction, just it exists there or anywhere around us. But it is sometime inconvenient when you want to analyze it or simply want to know more about it .

Wiki (26-Jan-2012) introduces gradient as

"
In vector calculus, the gradient of a scalar field is a vector field that points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.

"

It is more like a definition, not an explanation to those who do not know gradient well.

Wiki further introduces some well quoted examples as below:

"
Consider a room in which the temperature is given by a scalar field, T, so at each point (x, y, z) the temperature is T(x, y, z). (We will assume that the temperature does not change over time.) At each point in the room, the gradient of T at that point will show the direction the temperature rises most quickly. The magnitude of the gradient will determine how fast the temperature rises in that direction.

"

This is the same as the above brief explanation. No enough explanation to those who do not know gradient well. Please note that time is not involved and only in terms of location (x,y,z) in this explanation.

Wiki continues

"
Consider a surface whose height above sea level at a point (x, y) is H (x, y). The gradient of H at a point is a vector pointing in the direction of the steepest slope or grade at that point. The steepness of the slope at that point is given by the magnitude of the gradient vector.
"

Again, the same thing, but slightly different from the case of temperature of a room.

Temperature of a room - Temperature (scalar field) in 3D (room) --- (A)
Height (scalar) to or from the see level. The see level is regarded as constant --- (B)

(B) is confusing when we compare with the case of (A), in which a scalar quantity of the temperature can be measured at any point and may differ in 3D space (x, y, z). T (x, y, z). While in (B) the height is the quantity in z-direction.

(A) T (x, y, z) may have some or any value (say 20 deg C or 68 deg F, or simply 1, 2, 3 ...)
(B) H (x, y) has some value of height (say 100m or 328 feet, or simply 1, 2, 3 ...)

But the problem is, can we write in the following ways ?

(A) T (x, y, z) = 20 (68)
(B) H (x, y) = 100 (328)

Yes but this is one type. We can use any value as

(A) T (x, y, z) = c (constant)
(B) H (x, y) = c (constant)

(A) is a bit difficult to visualize to express 'c'. 

We can use a certain color in 3D space where 'c' occupies. When 'c' changes we use different colors or different tones of gray.

While (B) is easier to visualize as we can express it  H (x, y) = z or H (x, y, z) = z

Level line and Level surface

This is an important concept to capture the concept of gradient. 

(B) H (x, y) = z or H (x, y, z) = z   (z = constant)

We can plot the points which show a certain constant z value as height above the x-y plane in the 3D space. It will be a line or curve. We also can plot these on the 2D x-y plane though there is no height. It will be a line or curve called <Level line> showing the places in x-y plane having the selected same level (value) in the direction of z (height). z (height) can take any value but should remain constant in the function. This is the point.

(A) T (x, y, z) = c (constant)

We can apply a similar thing to this equation.  Now z in a variable of the function, not a constant. The result we will get will be a surface in x-y-z 3D space showing the selected same level (value) of <T> and mostly a curved surface in 3D. Now I think that you can visualize this.

How about the following cases ?

A (x, 0) = c or A (x, c) = c (constant)   This means x = c
A (0, y) = c or A (c, y) = c (constant)   This means y = c

We can plots <level points>, which produces a straight line on the x-y plane with x being constant for any y value, a vertical straight line, parallel with the y-axis; and the one with y being constant for any x value, a horizontal straight line, parallel with the x-axis. If c = 0, then the line is either y-axis or x-axis itself.

So we can find some relations between dimensions (Ds).

0D (point) --> 1D (line)   A (x, 0) = c or A (x, c) = c (constant)
We can plot Level points in 1D space (on a straight line).
Notes:
1) x can be either separate spots. But cannot be continuous (which is a line).
2) We can say that x depends on c, actually x = c.

1D --> 2D   H (x, y) = c or H (x, y, c) = c  (z = constant)
We can plot Level lines (usually curves) in 2D space (on a plane).
Notes: 
1) H generally indicates a function of x and y here with a constant c.
2) We can say that x and y values depend on c, actually H(x,y) = c. But c is constant (can be changed but not a variable element of the function). So c restricts the freedom of variables x and y.

Example

xy = 1 or H(x,y) - 1 = 0

x =1, then y =1
x= 2, then y= 1/2
x= 3, then y= 1/3  

These are on the line of y = 1/x.

x+y = 0 or F(x,y) = 0

x =1, then y =-1
x= 2, then y= -2
x= 3, then y= -3

These are on the line of y = -x

Seems stupidly simple but important relations as you can see later.

2D --> 3D   T (x, y, z) = c (constant)
We can plot Level surfaces (usually a curved surface) in 3D space.

Notes

1) Like above c is constant (can be changed but not a variable element of the function). So c restricts the freedom of variables x, y and z.

Derivative


Wiki shows the calculation formulas of gradient.

Expression in 3-dimensional rectangular coordinates

The form of the gradient depends on the coordinate system used. In Cartesian coordinates, the above expression expands to
\nabla f(x, y, z) =  \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right)   --- (1)
which is often written using the standard unit vectors \hat{\mathbf{i}}, \hat{\mathbf{j}}, \hat{\mathbf{k}} as
\frac{\partial f}{\partial x} {\mathbf{\hat i}} + \frac{\partial f}{\partial y} \hat{\mathbf{j}} + \frac{\partial f}{\partial z} \hat{\mathbf{k}}  ---- (2)


(1) is a partial differentiation of a function f in the three mutually perpendicular directions, x, y and z - ∂f/∂x, ∂f/∂y and ∂f/∂y. Is this a vector function showing a related vector field? It does not seem so as no vector shown. It can be a vector (function) as it shows a derivative of f (scalar function) in each direction of x, y, z. Meanwhile (2) seems more like a vector as three unit vectors are shown and please note <+> sign, which means Grad f is a addition of each partial differentiation of a function f with respect to x, y, and z and multiplied by a i, j, and k unit vector respectively. Grad f (x, y, z) is a addition of of ∂f/∂x, ∂f/∂y and ∂f/∂y.

However, even if you already know the partial differentiation it is difficult to get the idea of the following underlined italic part intuitively.

"
the gradient of a scalar field is a vector field that points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.

"

Simply why the greatest ?

Some more explanations are needed.

1. What is differentiation? or What is derivative?

Spatially, the derivative is a rate change of a function with respect to a certain direction.

y = 1, the derivative is 0. Though 'x' is not shown in this equation but it is usually regarded as the rate change of y of this function with respect to 'unit x'  is 0.
where 'unit x' is the direction in the x-axis and the value is one (1).

Besides 1, any other constant like 1/2, 2,10, the derivative of

y = 1/2, 2, 10 etc 

all 0 (zeer). This should be noticed in that derivative of a function having a independent constant the constant portion disappeared. So a constant of the scalar field function does not affect the derivative.
y = x, the derivative is 1. The rate change of y of this function with respect to 'unit x' is 1, constant, no change at any x and the y values on the line of y = x (straight line).

y= x2, the derivative is 2x. This time the rate change of 'y' value to 'unit x' of this function is not a number (constant) but a function "y = 2x" with respect to 'unit x'. So

when x = 0,  y = 0   -->  the derivative at (0, 0) is 0. (y' = 2 x 0 = 0)
when x = 1,  y = 1   -->  the derivative at (1, 1) is 2. (y' = 2 x 1 = 2)
when x = 2,  y = 4   -->  the derivative at (2, 4) is 4. (y = 2 x 2 = 4)
when x = 10,  y = 100   -->  the derivative at (10, 100) is 20. (y' = 2 x 10 = 20)

The above numbers 0, 2, 4, 20 are the tangent value of the tangent line at each point.

How about the first part - direction - the direction of the greatest rate of increase of the scalar field ? How to get this direction? By differentiation (or getting derivative) as well. This is the point of understanding gradient.

The 2nd part of the definition of gradient " (the) magnitude is that rate of increase (or decrease as well or more generally, just change)" is referring to this. So differentiation (partial differentiation in case of gradient) of a scalar function makes sense to get this value.

We have seen the two types of equations above.

y = x
y= x2

y is dependent on x. But we can change them to

x = y
x = +/- √ y

Now x depends on y. But these are actually the same as far as the x-y relation is concerned.

H (x, y) = c (constant) 
T (x, y, z) = c (constant)

These two are different. x, y, z are independent and controlled by the function of H or T to make the equation correct.

1) y = x
2) y= x2

We already had derivative rate change of y with respect to x.

1)-a)  y' = 1
2)-a)  y' = 2x

Another way, we change 1) and 2)

1)-b)  y - x = 0
2)-b)  y - x2 = 0

Then differentiate with respect to x

1)-c)  dy/dx - dx/dx = d0/dx
          dy/dx - 1= 0
          dy/dx = 1 (same result as y' = 1)

2)-c)  dy/dx - dx2/dx = d0/dx
          dy/dx - 2x = 0
          dy/dx = 2x (same result as y' = 2x)

The above two are just another presentation of differentiating with respect to x. But we can apply this method to

H (x, y) = c (constant) 
T (x, y, z) = c (constant)

H' (dx/dx, dy/dx) = dc/dx = 0 with respect to x
H' (dx/dy, dy/dy) = dc/d = 0 with respect to y
  
T ' (dx/dx, dy/dx, dz/dx) = dc/dx = 0 with respect to x
T ' (dx/dy, dy/dy, dz/dy) = dc/dy= 0 with respect to y
T ' (dx/dz, dy/dz, dz/dz) = dc/dz= 0 with respect to z

This procedure is wrong. We do not have functions of H and T and x, y and z are values, not equations.

H (x, y) = c (constant) 

We applied this to the following very simple equation.

y = x

Then change this to

H (x, y) = y - x = 0

Which means

The function H of x and y is

y - x = 0

We can write

H (x, y) =  0

Then let's apply the gradient operation (scalar to vector)

grad H (x, y) =  (- dx/dx) i + (dy/dy) j  = -1i + 1j  (=0)

What does this mean? We seem to be getting closer to <the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase>, at least the direction and some magnitude, the greatest is another issue.

< -1i + 1j> is a vector with the direction and we can calculate its magnitude.

Direction:  j / -i or - (j / i)

       \      l
         \    l
           \  l   ^
<--  i     \l   l  j
----------------------
              l \
              l  \
              l    \
              l      \


Magnitude: √2

The direction is normal to the line of y = x or <x - y = 0>. Let' try one more.

H (x, y) = y -  x2 (=0)

which means

The function H of x and y is

y -  x2 = 0


We can write

H (x, y) =  0

Applying the gradient operation (scalar to vector)

grad H (x, y) =  - (dx2/dx) i + (dy/dy) j  = -2xi + 1j (=0) 

This is a function of x. The value of x can change. 

At (0 ,0) : -2 x 0i + 1j = 0i + 1j  = + 1j      Magnitude 1    -- (a)

At (1, 1) : -2i + 1j     Magnitude √ 5    -- (b)

At (-1, 1) : -2 x (-1)i + 1j  = 2i + 1j      Magnitude √ 5    -- (c)

At (2, 4): -2 x 2i + 1j = -4i + 1j      Magnitude √ 17       -- (d)

 At (-2, 4) : -2 x (-2) j = 4i + 1j        Magnitude √ 17      -- (e)

At each point (0, 0), (1, 1), (2, 4), (-2, 4) of <y -  x2 = 0> we can get the direction and calculate the magnitude of of the vector <grad H(x, y)>. Let's check them if they are correct or not.

Now we refer to the concept of tangent and the tangent line. Tangent line at any point of y= x2 shows the slope of y= x2 at this point (the value of y with respect to x = 1 (unit)) of y= x2).  For instance,

when x = 0 (then y = 0) the tangent or the slope of the tangent line at (0, 0) = 0 and
the tangent line is y = 0.   --- (a')

When x = 1 (then y = 1), the tangent at (1, 1) is 2 and the tangent line is y = 2x - 1.     --- (b')

When x = -1 (then y = 1), the tangent at (-1, 1) is -2 and the tangent line is y = -2x - 1.     --- (c')

When x = 2 (then y = 4), the tangent at (2, 4) is 4  and the tangent line is y = 4x - 4.    --- (d')

When x = -2 (then y = 4), the tangent at (-2, 4) is -4  and the tangent line is y = -4x - 4.    --- (e')


(a) and (a'), (b) and (b'), (c) and (c'), (d) and (d'), and (e) and (e') are apparently closely related.

(a) and (a')

At (0, 0)

The tangent line is y = 0 while the direction of the gradient vector is + 1j .

             l
             l  ^
             l  l   j
-------------------  y= 0


(b) and (b')

At (1, 1)
The tangent line is y = 2x - 1 while the direction of the gradient vector -2i + 1j is perpendicular to
y = 2x - 1.

At (-1, 1)
The tangent line is y = -2x - 1 while the direction of the gradient vector 2i + 1j is perpendicular to
y = -2x - 1.
 
At (2, 4)
The tangent line is y = 4x - 4 while the direction of the gradient vector -4i + 1j is perpendicular to
y =  4x - 4.

At (-2, 4)
The tangent line is y = -4x - 4 while the direction of the gradient vector 4i + 1j is perpendicular to
y = -4x - 4.

What does this (perpendicular) relation mean ? Also <Simply why the greatest ?>

Continue to the next post.

sptt



Friday, January 20, 2012

What is Electric Current? -2


What is Electric Current? - Continued

Wiki (20-Jan-2012) explains Electric Current as

"
For a steady flow of charge through a surface, the current I (in amperes) can be calculated with the following equation:
I = {Q \over t} \, ,
where Q is the electric charge transferred through the surface over a time t. If Q and t are measured in coulombs and seconds respectively, I is in amperes.
More generally, electric current can be represented as the rate at which charge flows through a given surface as:
I = \frac{\mathrm{d}Q}{\mathrm{d}t} \, .
"

This is very common explanation. But how many people understand the meaning of this? It seems that we must memorize these equations without understanding what these mean or even without being able to visualize it.

Without understanding the first equation
I = {Q \over t} \, ,
it is further more difficult to understand its generalization.
I = \frac{\mathrm{d}Q}{\mathrm{d}t} \, .

This explanation is like one for those who already know well the meaning of Electric Current.

One more

Hyperphiscs' (20-Jan-2012) explanation

"

Electric Current

Electric current is the rate of charge flow past a given point in an electric circuit, measured in Coulombs/second which is named Amperes.

"

Again how many people understand the meaning of "the rate of charge of flow past a given point in an electric circuit" ? This time "past a given point" not "through a surface".

Wiki explains Electric Current in another way (aspect) in Drift Speed (the same site as the above).

"  
Drift speed 

The mobile charged particles within a conductor move constantly in random directions, like the particles of a gas. In order for there to be a net flow of charge, the particles must also move together with an average drift rate. Electrons are the charge carriers in metals and they follow an erratic path, bouncing from atom to atom, but generally drifting in the opposite direction of the electric field. The speed at which they drift can be calculated from the equation:
I=nAvQ \, , or v = I/nAQ
where
I is the electric current
n is number of charged particles per unit volume (or charge carrier density)
A is the cross-sectional area of the conductor
v is the drift velocity, and
Q is the charge on each particle.
"

In this, I is the total quantity of charges have gone through the cross-sectional area of the conductor during the time (t) with a velocity of v (m/t), which means the total quantity of charges in a volume created by the the cross-sectional area (A) and the distance v x t ((m/t) x t). This is easier to understand because this is a fact or an observation of a fact - generalization is not require.

Generalization processes
1) First generalization

Hyperphisics says
" the rate of charge of flow past a given point in an electric circuit". To get this we must divide the both side by / m3
I=nAvQ \, ,
I / m3 = nAvQ / m3 = nQAv / m3
As A in <m2> and v in <m/t> in unit
nQAv / m3 = nQA <m2>v <m/t> / m3 = nQ/t
nQ is the total Q (Charges) and change it Qtotal. Then we can get I /m3 = Qtotal/t
But what does the right hand side I /m3 means? Not I but I /m3.
This is the first generalization. I /m3 is the density of I (total current passed), or we can say an average of I ( the flow of charges past a given point). We also call it the rate of charge of flow past a given point or the density of current in terms of time (the time dimension in stead of the spatial dimensions as a point is zero dimension at least mathematically).

Similarly we can think of the average I through a surface by dividing the both sides of the equation by m2.
I / m2 = nAvQ /m2 = nQAv / m2
nQAv / m2 = nQA<m2>v <m/t> / m2 = nQm/t =  (also = nQv)
This time the right hand side is not nQ/t but nQm/t or nQv (where v is velocity). We do not elaborate this here.
nQAv / m2 = nQm/t
As far as the rate or the average are concerned (average over area versus (nQ/t) x distance)
nQAv = nQ/t ---- Generalized I = nQ/t = Qtotal/t

Again similarly we can think of the average I through a line (or maybe more precisely on or in a line) by dividing the both side of the equation by m.
I / m = nAvQ /m = nQAv / m
nQAv / m = nQA<m2>v <m/t> / m = nQm2/t
This time the right hand side is nQm2/t. What does m2/t means? We do not elaborate it here. 
nQAv / m = nQm2/t
As far as the rate or the average are concerned (average over line versus (nQ/t) x area)
nQAv = nQm2/t ---- Generalized I = nQ/t = Qtotal/t

The above calculations seem redundant. " I = Q/t " is a definition.

2) Second generalization

As we quoted above, Wiki says

More generally, electric current can be represented as the rate at which charge flows through a given surface as:
I = \frac{\mathrm{d}Q}{\mathrm{d}t} \, .

As
I = {Q \over t} \, , a steady flow of charge through a surface

we must generalize this under a more generalized a changing flow. Steady state is included in changing state. Steady state is a special case of changing state when the rate of change is zero. So

I = \frac{\mathrm{d}Q}{\mathrm{d}t} \, .
and in a more general way, not "charge flows through a given surface" (Wiki) but " the rate of charge of flow past a given point" (Hyperphysics). Quantity at an absolute point could be averaged by spatial dimensions but could be averaged by the time dimension (t).

This reminds me of Divergence (Theory) but Divergence does treat a flow not involve time - so a kind of static flow, then leads to the density of something in a flow or rather flux form.



sptt

Thursday, January 19, 2012

What is Electric Current?

What is Electric Current actually ?

The name "current" indicates that Electric Current is a flow of something. Not a flow of current. A flow of electrons, ions or some other very tiny things or liquid like water? In Electronics it is a flow of electric charges. Charge is not a thing, but a property measurable and related with force (electrical force). Charges are said to be "carried" by electrons, ions or some other tiny things. In Electronics, however, current is more precisely defined as the quantity of charges passed through an area, or more generally through a point (any point in a volume, or area or line) per time. Or more generally by including of the changing quantity with time, it is a rate change of the quantity of charges which go through a point with time.

The following article (form physicsclassroom.com) explains Electric Current in a similar way.

http://www.physicsclassroom.com/class/circuits/u9l2c.cfm

Electric Current

If the two requirements of an electric circuit are met, then charge will flow through the external circuit. It is said that there is a current - a flow of charge. Using the word current in this context is to simply use it to say that something is happening in the wires - charge is moving. Yet current is a physical quantity that can be measured and expressed numerically. As a physical quantity, current is the rate at which charge flows past a point on a circuit. As depicted in the diagram below, the current in a circuit can be determined if the quantity of charge Q passing through a cross section of a wire in a time t can be measured. The current is simply the ratio of the quantity of charge and time.



http://www.physicsclassroom.com/class/circuits/u9l2c.cfm


The article says

As a physical quantity, current is the rate at which charge flows past a point on a circuit.

But it does not elaborate charge flows past a point and changes to the quantity of charge Q passing through a cross section of a wire in a time t by using a diagram. In terms of the rate, this seems the same thing, either past a point or through a cross section.

A small cross section can be regarded as a point? - Yes and No.

Yes - A limit of an area (volume and line as well) is a point.

No - A point is zero dimension while an area is two (2) dimensions.

Yes and No

When the quantity of charge Q passing through a cross section in a time t divided by the area, we can get an average of the quantity of charge Q passing through a cross section. And this average can be regarded as the charge Q passing through a point.
sptt



Sunday, January 15, 2012

Mystery of "V x I" - 2 or What Electric Energy is?

This is a continuation of the previous post titled Mystery of "Power = V x I" with some additional information and thinking.

Mystery of "Power = V x I" was posted before as

"
V (Joule/Coulomb) x I (Coulomb/second) = Power (Joule/sec = Energy/sec). So after multiplication of V by I, Coulomb (unit of electric charge) disappears like a magic and only Energy and time remain. This explains well that Current is not consumed in a load such as a resistor and a light bulb - Kirchhoff's Current law but Energy is consumed, changed to some other form of Energy - conservation of Energy.

"

Question - Why Charges disappear after I x V (= Power) and Energy

remains ?

Assumption 1 - Charge only carries Energy.

One example


Electronics Club

Electricity and the Electron

Next Page: Series and Parallel Connections
Also see: Circuit Symbols and Circuit Diagrams

What is electricity?

Lamp switching on and off Electricity is the flow of charge around a circuit carrying energy from the battery (or power supply) to components such as lamps and motors.

Electricity can flow only if there is a complete circuit from the battery through wires to components and back to the battery again.

The diagram shows a simple circuit of a battery, wires, a switch and a lamp. The switch works by breaking the circuit.

With the switch open the circuit is broken - so electricity cannot flow and the lamp is off.

With the switch closed the circuit is complete - allowing electricity to flow and the lamp is on. The electricity is carrying energy from the battery to the lamp.

We can see, hear or feel the effects of electricity flowing such as a lamp lighting, a bell ringing, or a motor turning - but we cannot see the electricity itself, so which way is it flowing?

-----

This (Electricity is the flow of charge around a circuit carrying energy) explains "Current is not consumed in a load such as a resistor and a light bulb - Kirchhoff's Current law" but does not explain how current (charges) carry energy. No equation shows the relation between electricity and energy. Charges seem to be carriers of energy. No definitions on what electricity is, what electric energy is.



Assumption 2 - Charge creates Energy by moving (mechanical Energy).

Current is a flow (motion) of charges.

E_{kinetic} = \tfrac 1 2 m v^2 \,\!

To move charges potential energy from some energy source like a battery (chemical energy) , capacitor (stored energy (1/2) C V2 ) and inductor (stored energy (1/2) L I2 ) is required and used.

An electron has a charge (−1.602176565(35)×10−19 C) as well as a mass (9.10938291(40)×10−31 kg). It flows so have velocity. How fast? changing direction?

1) DC current in a conductor or somewhere in a conductive material in a circuit is not very fast and may not necessarily move straight (not 1D but 3D)

2) AC current moves back and forth in a circuit and changes direction slowly or fast with different frequencies.

3) More generally electron move dynamically according to the electromagnetic field conditions.

4) Electron spins which requires mechanical energy.

5) Electron is not a rigid body. E_{kinetic}       = \tfrac 1 2 m v^2 \,\! cannot be applied to electron.

6) Electron motion or behavior or status in terms of energy is believed be more precisely described by quantum properties.


sptt

Friday, January 6, 2012

One very easy way to understand Solar Cell key function

I have found a very good way to understand the basic key function (or phenomenon) of a Solar Cell. I have read some documents on the function (or phenomenon) of a Solar Cell in some books and some websites (some are good, some are not good or even wrong at least confusing). But I did not encounter my method so far.

To check Diode Voltage by a multimeter (my digital multimeter has this function) with the opposite direction of the +/- shown on the back side of the panel at not very bright place. My multimeter shows "----", which means more than the max checkable (about 2VDC). Then gradually give more light to the panel. The multimeter shows "2.1- 1.9V", which shows . And then further increase the light. It shows less and less values 1.8V -- 1.5V -- 1.2V -- and finally 0.00. This indicates the increasing light creates an increasing voltage at the PN junction opposite to the original PN junction voltage (under a little light condition). This is it. Very easy and you can easily guess what light does to the panel (Solar Cell). After I found this fact it was much easier for me to understand what the text books say like "the current in Solar cell is the reverse current." or "Internal Voltage Difference Creation", etc.


sptt