PESTAÑAS

miércoles, 7 de diciembre de 2011

Basic details of Divergence and Curl (II)


Hi everybody

This time I will give some explanations about these two operators, very important in engineering and science world. This comes when I faced several exercices focused on understanding the divergence concept. Personally I considered that these concepts would be nice for those working on them.

I commented in the previous post that divergence has a direct relation with a flux balance through a surface. Maybe a rigurous way to proceed is to chech the mathematical definition:

$$\nabla \cdot F = \frac{1}{\bigtriangleup V}\int_S \vec{F} \cdot \vec{n} \cdot dS $$

As it can be seen, divergence is defined as a net flux of a field that pass through a surface of a certain volume.  Let's give an example. We will use spherical coordinates:

 $\vec{F}=r^2 \vec{r}$

Applying the divergence definition for a reference system in spherical coordinates:

$\nabla \cdot \vec{F}=\frac{1}{r^2}\frac{\partial}{\partial r} \left( r^2 \vec{F} \right) = 4r $

This result shows that divergence is always positive in all the field, except in (0,0), that must be 0. As we approach more to the origin, vector field lines decrease.




We can analyze zones where divergence is positive, negative or zero. Recall that divergence is related with a balance in a certain volume. As it can be seen, divergence is always positive in all the field. As we move away from the coordinate system, flux passing through different surfaces surrounding spherical volumes (as we have chosen spherical coordinates, in 2D would be circumferences) is larger.

When we plot a detail of this field and we paint field lines at positions r and r+dr, we can see that field lines are larger when we go away from (0,0). Divergence applied to a diferential of volume between these two surfaces (situated at r and r+dr) must be greater than zero.


But this balance may lead to a have some errors when calculating divergence. We will ilustrate an example of this fact:

$\vec{F}=\frac{1}{r^2} \vec{r}$

Vector field is:


As it can be appreciated, field lines decrease when radius increases. If we make a visual analysis following the other example, it may be deduced that divergence in this field is always smaller than zero for every r, giving a zero value in the infinite. If we make an zoom in a certain zone of the vector field:


It seems that field lines are smaller in S+dS than those placed in S, so balance would be in a first step smaller than zero. However, this is not like that. If we calculate divergence analytically:

$\nabla \cdot \vec{F}=\frac{1}{r^2}\frac{\partial}{\partial r} \left( r^2 \vec{F} \right) = 0 $

Result of the calculations give a value equal to zero for every point in the field. What's wrong here?

The answer is not trivial at all. If we observe again the definition of divergence, it can be appreciated that the answer is on the surface flow integral. When we choose a volume as the picture, it can be seen that field value is greater than in surface S than in surface S+dS (it can be seen that field value decreases with increasing r). But it must be mentioned that surface through which field flow passes is also greater in S+dS than in S.

Globally we have that a DECREASE OF THE FIELD VALUE WHEN RADIUS IS INCREASED IS BALANCED WITH SURFACE INCREMENT WHEN WE INCREASE THE RADIUS. It can be concluded that, although F has more intensity in S than in S+dS, the surface through which field passes is smaller than in S+dS, balancing the integrals in both points. In this example, this balance is exactly equal, and then flux passing through both surfaces is exactly the same.

So, resuming:

- Divergence of a vectorial field is a scalar
- The divergence implies a net flux balance in a certain volume through a surface
- When calculating the divergence in a given volume by visual analysis, be aware about value of the field and considered surfaces.


In following posts I will do a similar example, but with curl operator.

domingo, 4 de diciembre de 2011

LATEX server change


Hi

Due to changes in LATEX server that I publish here, I have found another alternative link to help you with this inconvenient . This new script have to be introduced as I explained in the previous post. Just erase the older one and write the following command:


<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
MathJax.Hub.Config({
 extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"],
 jax: ["input/TeX", "output/HTML-CSS"],
 tex2jax: {
     inlineMath: [ ['$','$'], ["\\(","\\)"] ],
     displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 },
 "HTML-CSS": { availableFonts: ["TeX"] }
});
</script>


That's it !! You can write LATEX again !!

Note:

Script is designed to make inline writting when use single dolar expression ($), and separated centered expression when using double dolar expression ($$).

Example

This is an inline example $f=\sqrt{x^2+y^2}$ of Latex writting

This is an example 
$$ g=\frac{\partial}{\partial x}\left( z^2+6x \right) $$
of separated centered writting.

Finite elements introduction


Hi

Today I will give a small introduction about one of the most used numerical methods in science and engineering world: finite elements method.

Finite element method consist on purpose a discrete function as an approximated solution to an equation or set of equations describing a physic or mathematical system.

I wil ilustrate an unidimensional example very intuitive to see which is the basics:

Assume we watn to solve an equation like that

$$ \partial_x (p \partial_x y)+ (q+\lambda \sigma) \partial_x y= 0$$

This equation is a general expression for Sturm-Liouville problem, but this is irrelevant in this post. It can be observed that is a second order differential equation with variable coefficients.

Finite element method purpose the division of "y" function in n geometric elements. Extremes where two or more elements join are called nodes. We also assume that we know exactly the value of y funcion in each node. As we only know the value on the nodes, we need to interpolate the value of y in every part of the domain, that is, in each part of each element. For that purpose, we propose a "nodal function", which will take a 0 value for all points of the domain and 1 exactly in the node where is defined.

The next step is quite interesting. As we have divided the y function (the solution of the system) in n elements, we have n+1 nodes that they are connected because they are defined in our domain of study. We can assume then that the global solution will be a linear combination of each nodal function defined for each element that forms our domain. Constants of linear combination will be the n+1 values of the funcion exactly known in each node.

$$y=\Sigma_{n=0}^{n+1} \phi_n y_n$$

Notice that the approximated discrete solution, if solution, must satisfy the differential equation. So:

$$ \partial_x (p \partial_x (\Sigma_{n=0}^{n+1} \phi_n y_n))+ (q+\lambda \sigma) \partial_x (\Sigma_{n=0}^{n+1} \phi_n y_n)= E $$

It can be appreciated that the equation is not equal to zero: this is true, as we have approached a continuous  solution with a discrete funcion. There must be an error E by doing this. And it can be seen that we have just obtained the expression of the error of our method. The next step consist of choosing a good criteria to make converge this error funcion  E to zero. If we success in our task, we will have a good solution for our equation.

The method we are going to use is called "average weight method. This method try to find a serie of functions such us its scalar product with error function must be zero.

$$\int w(x) E dx = 0$$

We just want to find a set of functions orthogonal  to error function. If we chose weight functions as the same type as nodal functions, we can just see that by doing integrals converge to zero, we are also doing our error funcion converge to zero.

This method is quite simple in its basic structure, but its computing is quite hard to compile. We know that the more nodes we consider, the more exact our solution will be, but we have to compute more calculations. The problem is not so trivial as we are limited by our computation capacity.


In following posts I will explain in deep some examples and other detailed observations about this method.

A very brief introduction to perturbation methods

Hi everybody


Today I'm going to talk about a topic which in my opinion it's fascinating and very imporant to be known for all those who want to practice cutting edge science. I'm refering to perturbation methods.


These mathematical techniques were developed approximately one century ago by scientist focussed on dynamic systems mathematics or working on engineering and physics where several non analytical solvable systems of equations are the base of development to their respective areas (for example, fluid mechanics).


Perturbation methods, also called asymptotic, deal with different ways to get very valuable information of a system without solving their equations. These techniques introduce which is called "perturbed solutions": a solution is assumed depending of a very small variable (usually is called $\epsilon$) and other desired parameters. The structure of these solutions depends of which type of expansion we are planning to introduce. Typical expansions are for example power series. If U is a solution of the equation, then we could assume that:


$$U=U_0+\epsilon^m U_1 + \epsilon^n U_2 + ...$$

where $U_1$,$U_2$, etc. are solutions that appear when we assume order $\epsilon^m$, $\epsilon^n$, etc.

As this solution satisfy the equation, we can just substitute on it and we can obtain a system of equations at different $|epsilon$ orders that we can solve them to get the asymptotic approximation. We can also perform a nonlinear dynamic study to get stability values, nodes, etc.

As it can be seen, perturbative methods are extremely useful, but its application is not so immediate. Use this method with differential equations is a very hard task, even impossible for those not accostumed to work with this type of methods. That's the reason for which only few people in the world are really experts in this field.

In the following posts I will explain a little bit more these kind of methods, and some examples of application.