Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Friday, September 12, 2014

calculus introduction

This site seems to be best site introducing calculus.

http://www.wyzant.com/resources/lessons/math/calculus/integration/ftoc 


math word

algebra : 代数 is  the study of operations
calculus :  积分 is the mathematical study of change : the branch of mathematics that
         deals with the finding and properties of derivatives and integrals of
         functions, by methods originally based on the summation of infinitesimal
         differences. The two main types are differential calculus(微分) and
         integral calculus (积分).
geometry : 几何 is the study of shape : the branch of mathematics concerned
        with the properties and relations of points, lines, surfaces, solids, and
        higher dimensional analogs.
dividend : number to be divided 

Friday, September 5, 2014

nabla ∇

Del, or nabla, is an operator used in mathematics, in particular, in vector calculus, as a vector differential operator, usually represented by the nabla symbol .


In the Cartesian coordinate system Rn with coordinates (x_1, \dots, x_n) and standard basis \{ \mathbf{\hat e}_1, \dots, \mathbf{\hat e}_n \}, del is defined in terms of partial derivative operators as
 \nabla = \left( {\partial \over \partial x_1}, \cdots, {\partial \over \partial x_n} \right) = \sum_{i=1}^n \mathbf{\hat e}_i {\partial \over \partial x_i}
In three-dimensional Cartesian coordinate system R3 with coordinates (x, y, z) and standard basis \{ \mathbf{\hat{x}}, \mathbf{\hat{y}}, \mathbf{\hat{z}} \}, del is written as
\nabla = \left( {\partial \over \partial x}, {\partial \over \partial y}, {\partial \over \partial z} \right) = \mathbf{\hat{x}} {\partial \over \partial x} + \mathbf{\hat{y}} {\partial \over \partial y} + \mathbf{\hat{z}} {\partial \over \partial z}

Notational uses

Gradient

The vector derivative of a scalar field f is called the gradient, and it can be represented as:
\nabla f = {\partial f \over \partial x} \mathbf{\hat{x}} + {\partial f \over \partial y} \mathbf{\hat{y}} + {\partial f \over \partial z} \mathbf{\hat{z}}

 

In particular, this notation is powerful because the gradient product rule looks very similar to the 1d-derivative case:
\nabla(f g) = f \nabla g + g \nabla f
However, the rules for dot products do not turn out to be simple, as illustrated by:
\nabla (\vec u \cdot \vec v) = (\vec u \cdot \nabla) \vec v + (\vec v \cdot \nabla) \vec u + \vec u \times (\nabla \times \vec v) + \vec v \times (\nabla \times \vec u)

 Divergence

The divergence of a vector field  \vec{v}(x, y, z) = v_x \mathbf{\hat{x}}  + v_y \mathbf{\hat{y}} + v_z \mathbf{\hat{z}} is a scalar function that can be represented as:
\mbox{div}\,\vec v = {\partial v_x \over \partial x} + {\partial v_y \over \partial y} + {\partial v_z \over \partial z} = \nabla \cdot \vec v  
 
 
The power of the del notation is shown by the following product rule:
\nabla \cdot (f \vec v) = f (\nabla \cdot \vec v) + \vec v \cdot (\nabla f)
The formula for the vector product is slightly less intuitive, because this product is not commutative:
\nabla \cdot (\vec u \times \vec v) = \vec v \cdot (\nabla \times \vec u) - \vec u \cdot (\nabla \times \vec v)

Curl

The curl of a vector field \vec{v}(x, y, z) = v_x\mathbf{\hat{x}}  + v_y\mathbf{\hat{y}} + v_z\mathbf{\hat{z}} is a vector function that can be represented as:
\mbox{curl}\;\vec v = \left( {\partial v_z \over \partial y} - {\partial v_y \over \partial z} \right) \mathbf{\hat{x}} + \left( {\partial v_x \over \partial z} - {\partial v_z \over \partial x} \right) \mathbf{\hat{y}} + \left( {\partial v_y \over \partial x} - {\partial v_x \over \partial y} \right) \mathbf{\hat{z}} = \nabla \times \vec v

Directional derivative

The directional derivative of a scalar field f(x,y,z) in the direction \vec{a}(x,y,z) = a_x \mathbf{\hat{x}} + a_y \mathbf{\hat{y}} + a_z \mathbf{\hat{z}} is defined as:

Laplacian

The Laplace operator is a scalar operator that can be applied to either vector or scalar fields; for cartesian coordinate systems it is defined as:

Tensor derivative

Del can also be applied to a vector field with the result being a tensor. The tensor derivative of a vector field \vec{v} is a 9-term second-rank tensor, but can be denoted simply as \nabla \otimes \vec{v}, where \otimes represents the dyadic product. This quantity is equivalent to the transpose of the Jacobian matrix of the vector field with respect to space.
For a small displacement \delta \vec{r}, the change in the vector field is given by:

Product rules

\nabla (fg) = f\nabla g + g\nabla f
\nabla(\vec u \cdot \vec v) = \vec u \times (\nabla \times \vec v) + \vec v \times (\nabla \times \vec u) + ( \vec u \cdot \nabla) \vec v + (\vec v \cdot \nabla )\vec u
\nabla \cdot (f \vec v) = f (\nabla \cdot \vec v) + \vec v \cdot (\nabla f)
\nabla \cdot (\vec u \times \vec v) = \vec v \cdot (\nabla \times \vec u) - \vec u \cdot (\nabla \times \vec v )
\nabla \times (f \vec v) = (\nabla f) \times \vec v + f (\nabla \times \vec v)
\nabla \times (\vec u \times \vec v) = \vec u \, (\nabla \cdot \vec v) - \vec v \, (\nabla \cdot \vec u) + (\vec v \cdot \nabla) \, \vec u - (\vec u \cdot \nabla) \, \vec v
 \delta \vec{v} = (\nabla \otimes \vec{v}) \sdot \delta \vec{r}
\Delta = {\partial^2 \over \partial x^2} + {\partial^2 \over \partial y^2} + {\partial^2 \over \partial z^2} = \nabla \cdot \nabla = \nabla^2
\vec{a}\cdot\mbox{grad}\,f = a_x {\partial f \over \partial x} + a_y {\partial f \over \partial y} + a_z {\partial f \over \partial z} = (\vec a \cdot \nabla) f
\mbox{div}\,\vec v = {\partial v_x \over \partial x} + {\partial v_y \over \partial y} + {\partial v_z \over \partial z} = \nabla \cdot \vec v

math symbol pronunciation






Tuesday, July 29, 2014

bilinear interpolation

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables (e.g., x and y) on a regular 2D grid.
The key idea is to perform linear interpolation first in one direction, and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather quadratic in the sample location (details below).

Suppose that we want to find the value of the unknown function f at the point P = (x, y). It is assumed that we know the value of f at the four points Q11 = (x1y1), Q12 = (x1y2), Q21 = (x2y1), and Q22 = (x2y2).
1) We first do linear interpolation in the x-direction. This yields
 f(R_1) \approx \frac{x_2-x}{x_2-x_1} f(Q_{11}) + \frac{x-x_1}{x_2-x_1} f(Q_{21})
where point R_1 = (x,y_1),

 f(R_2) \approx \frac{x_2-x}{x_2-x_1} f(Q_{12}) + \frac{x-x_1}{x_2-x_1} f(Q_{22})
where point R_2 = (x,y_2).

where
f(Q11) is the function value at point (x1,y1)
f(Q12) is the function value at point (x1,y2)
f(Q21) is the function value at point (x2,y1)
f(Q22) is the function value at point (x2,y2)



2) We proceed by interpolating in the y-direction.
 f(P) \approx \frac{y_2-y}{y_2-y_1} f(R_1) + \frac{y-y_1}{y_2-y_1} f(R_2).
This gives us the desired estimate of f(x, y).
 
\begin{array}{ l l}
f(x,y) \approx & \, \frac{f(Q_{11})}{(x_2-x_1)(y_2-y_1)} (x_2-x)(y_2-y) \, + \\
               & \, \frac{f(Q_{21})}{(x_2-x_1)(y_2-y_1)} (x-x_1)(y_2-y) \, + \\
               & \, \frac{f(Q_{12})}{(x_2-x_1)(y_2-y_1)} (x_2-x)(y-y_1) \, + \\
               & \, \frac{f(Q_{22})}{(x_2-x_1)(y_2-y_1)} (x-x_1)(y-y_1) \\
   \qquad          = & \, \frac{1}{(x_2-x_1)(y_2-y_1)} \Big(   f(Q_{11})(x_2-x)(y_2-y) \, + \\
               & \, \qquad \qquad \qquad \qquad \; \;    f(Q_{21})(x-x_1)(y_2-y) \, + \\
               & \, \qquad \qquad \qquad \qquad \; \;    f(Q_{12})(x_2-x)(y-y_1) \, + \\
               & \, \qquad \qquad \qquad \qquad \; \;    f(Q_{22})(x-x_1)(y-y_1) \quad \Big)
\end{array}
 
 
DXU: This bi-linear interpolation could be extended to N-linear interpolation.