Saturday, June 8, 2013

Decanting and Ferris Wheel


In chemical process, separation play a important part in order to get something pure from a jumble of components. One of the process for separation is decanting. Decanting is a process that separate a mixture by using gravitational force. The mixture can be solid-liquid mixture (e.g. mud) or even two immiscible liquid (e.g. water and oil). A static decanting process is similar with sedimentation process which is mostly used in waste water treatment . A example of static decanter process can be refer to figure below.


Based on figure, due to the gravitational force, the liquid and solid of a mixture is naturally being separated due to its difference in mass. However, for the component to be totally separated naturally, it would take a long time.Thus, a 'dynamic' decanter is introduced to minimize the separation time and at the same time maximizing the output capacity and efficiency. The 'dynamic' decanter use a centrifugal force to expedite the process. 

In a simple definition, centrifugal force is a force that draw a body away from the center of rotation.The 'pull' force is the result of the body attempt to move in a straight line due inertia. However, due to the restricted space, the body is seem to be 'attached' to the wall of the rotating system. In retrospect, the centrifugal force is similar like an artificial gravity but instead pulling the body towards it center, it push the body away from the axis of rotation. The artificial gravity that occurred on the body is simply a reaction force of the body towards the centrifugal force in the rotating system in accordance to the Newton Third Law. If you remember riding a Ferris wheel, you will notice that your body will feel the 'extra' gravitational force induce by the wheel rotation. A feeling that like you would be 'thrown' away during the wheel rotation. However, in order to crate a real centrifugal force, the rotation is need to be equivalent to the size of the system.

In practice, centrifugal force is used to separate the heavy component from the light component as the heavy ones would be push to the wall of the rotating container and be swept away by a inner conveyor. By manipulating the speed of the container rotation, we can achieve a better separation effect depending on the mixture. A video of a working horizontal centrifuge which is used in the industrial is shown below.



In the nutshell: A decanting process can be improved by using centrifugal force, a continuous circular motion that can induce a artificial gravitational force. A Ferris wheel ride, which is one of the application of centrifugal force, is technically safe as it rotate at a low speed.

Thursday, June 6, 2013

Optimization technique: A kangaroo analogy



#Author notes: This is a good analogy on how optimization technique is used in Neural network (NN) training. Nonetheless, a basic knowledge about optimization techniques in NN is recommended in order to understand the meaning behind the story.


Kangaroos and Training Neural Networks
By: Warren S. Sarle and Net Poohbahs
Revised: Oct 22, 1994

Training a NN is a form of numerical optimization, which can be likened to a kangaroo searching for the top of Mt. Everest. Everest is the _global optimum_, the highest mountain in the world, but the top of any other really tall mountain such as K2 (a good _local optimum_) would be satisfactory. On the other hand, the top of a small hill like Chapel Hill, NC, (a bad local optimum) would not be acceptable.

This analogy is framed in terms of maximization, while neural networks are usually discussed in terms of minimizing an error measure such as the least-squares criterion, but if you multiply the error measure by -1, it works out the same. So in this analogy, the higher the altitude, the smaller the error.

The compass directions represent the values of synaptic weights in the network. The north-south direction represents one weight, while the east-west direction represents another weight. Most networks have more than two weights, but representing additional weights would require a multidimensional landscape, which is difficult to visualize. Keep in mind that when you are training a network with more than two weights, everything gets more complicated.

Initial weights are usually chosen randomly, which means that the kangaroo is dropped by parachute somewhere over Asia by a pilot who has lost the map. If you know something about the scales of the inputs, you may be able to give the pilot adequate instructions to get the kangaroo to land near the Himalayas. However, if you make a really bad choice of distributions for the initial weights, the kangaroo may plummet into the Indian ocean and drown.

With Newton-type (second-order) algorithms, the Himalayas are covered with fog, and the kangaroo can only see a little way around her location. Judging from the local terrain, the kangaroo makes a guess about where the top of the mountain is, assuming that the mountain has a nice, smooth, quadratic shape. The kangaroo then tries to leap all the way to the top in one jump.

Since most mountains do not have a perfect quadratic shape, the kangaroo will rarely reach the top in one jump. Hence the kangaroo must _iterate_, i.e., jump repeatedly as previously described until she finds the top of a mountain. Unfortunately, there is no assurance that this mountain will be Everest.

In a stabilized Newton algorithm, the kangaroo has an altimeter, and if the jump takes her to a lower point, she backs up to where she was and takes a shorter jump. If ridge stabilization is used, the kangaroo also adjusts the direction of her jump to go up a steeper slope. If the algorithm isn't stabilized, the kangaroo may mistakenly jump to Shanghai and get served for dinner in a Chinese restaurant.

In steepest ascent with line search, the fog is _very_ dense, and the kangaroo can only tell which direction leads up most steeply. The kangaroo hops in this direction until the terrain starts going down. Then the kangaroo looks around again for the new steepest ascent direction and iterates.

Using an ODE (ordinary differential equation) solver is similar to steepest ascent, except that the kangaroo crawls on all fives to the top of the nearest mountain, being sure to crawl in steepest direction at all times.

The following description of conjugate gradient methods is adapted from Tony Plate (1993):
The environment for conjugate gradient search is just like that for steepest ascent with line search\mdash the fog is dense and the kangaroo can only tell which direction leads up. The difference is that the kangaroo has some memory of the directions it has hopped in before, and the kangaroo assumes that the ridges are straight (i.e., the surface is quadratic). The kangaroo chooses a direction to hop in that is upwards, but that does not result in it going downwards in the previous directions it has hopped in. That is, it chooses an upwards direction, moving along which will not undo the work of previous steps. It hops upwards until the terrain starts going down again, then chooses another direction.

In standard backprop, the most common NN training method, the kangaroo is blind and has to feel around on the ground to make a guess aboutwhich way is up. A major problem with standard backprop is that the distance the kangaroo hops is related to the steepness of the terrain. If the kangaroo starts on a gently sloping plain instead of a mountain side, she will take very small hops and make very slow progress. When she finally starts to ascend a mountain, her hops get longer and more dangerous, and she may hop off the mountain altogether. If the kangaroo ever gets near the peak, she may jump back and forth across the peak without ever landing on it. If you use a decaying step size, the kangaroo gets tired and makes smaller and smaller hops, so if she ever gets near the peak she has a better chance of actually landing on it before the Himalayas erode away.

In backprop with momentum, the kangaroo has poor traction and can't make sharp turns. With on-line training, there are frequent earthquakes, and mountains constantly appear and disappear. This makes it difficult for the blind kangaroo to tell whether she has ever reached the top of a mountain, and she has to take small hops to avoid falling into the gaping chasms that can open up at any moment.

Notice that in all the methods discussed so far, the kangaroo can hope at best to find the top of a mountain close to where she starts. In other words, these are _local ascent_ methods. There's no guarantee that this mountain will be Everest, or even a very high mountain. Many methods exist to try to find the global optimum.

In simulated annealing, the kangaroo is drunk and hops around randomly for a long time. However, she gradually sobers up and the more sober she is, the more likely she is to hop up hill. In a random multistart method, lots of kangaroos are parachuted into the Himalayas at random places. You hope that at least one of them will find Everest.
A genetic algorithm begins like random multistart. However, these kangaroos do not know that they are supposed to be looking for the top of a mountain. Every few years, you shoot the kangaroos at low altitudes and hope the ones that are left will be fruitful, multiply, and ascend. Current research suggests that fleas may be more effective than kangaroos in genetic algorithms, since their faster rate of reproduction more than compensates for their shorter hops.

A tunneling algorithm can be applied in combination with any local ascent method but requires divine intervention and a jet ski. The kangaroo first finds the top of any nearby mountain. Then the kangaroo calls upon her deity to flood the earth to the point that the waters just reach the top of the current mountain. She then gets on her jet ski, goes off in search of a higher mountain, and repeats the process until no higher mountains can be found.

Reference
ftp://ftp.sas.com/pub/neural/kangaroos

Monday, June 3, 2013

Process Model 'Family Tree'




In general, process model or model is a representation of the real system/process. By using a process model, the user can explore the behavior and performance of the real system at a reduced cost, time and risk. In most process models, only the parameters that relevant and related to the problem are made available. Thus, the process model is somehow a simplified and compact version of a real system. The performance of the process model is measured by how much it can actually copied the real one. This criterion is often measured by coefficient of determination (or R2). The closer the R2 value to 1, the more likely the performance of the process model is similar to the original system/process.

The figure above shows what I would call the ‘family tree’ of process model (Note: all the information in the figure does not resemble the entire models that are available in the literature. I just put what I know although I wish I can put all in there. The diagram just serves as a general idea of the process model development). Based on the figure, the there are two nature of process models that are available which are steady state and dynamic. The difference between these two will be cover in the future post. For the time being it is important to know that the dynamic model is the one that are usually used in control system design. Where else, the steady state model is often used in process design and optimization. From the dynamic model, we have three types of dynamic process model which are statistical, mathematical and qualitative.

Statistical Model

Statistical modeling is about relating the variables to one and another based on mathematical equation using statistical tools. This analysis would give a general equation that can ‘fit’ the system behavior and thus represent the real system. The correlation model is developed by quantifying the similarity between the real system and a predicted system. In order to get the predicted system equal to the real system, the adjustment is done based on the regression analysis. The most basic correlation model is the linear line equation y = mx + c. The probabilistic model is based on the probability density function which can determine the ‘density’ of the probability in a bounded region. The most common probabilistic model is the normal distribution which can tell us the probability of a variable taking on a certain value.

Mathematical Model

Actually, most of the modeling development is related to math. The term ‘mathematical model’ is used to highlight the usage of the mathematical concept and language in its development. There are two branch of mathematical modeling which are empirical and mechanistic model. The issue of empirical and mechanistic modeling always draws many attentions. Hence, the advantages and disadvantages of both of the modeling technique will be cover in the future post as it is worth to be discussed.

  • Mechanistic Model: The mechanistic model is developed based on the fundamental knowledge and principal of the system/process. Thus, all the theory (e.g. physic, chemistry, transport process, thermodynamic, reaction, mass balance etc) that govern the system will be developed and used in the modeling development. The final model is described as ordinary differential equation (ODE) and partial differential equation (PDE). For easy understanding, ODE and PDE is a set of mathematical equation that can represent the dynamic and behavior of a real system/process. ODE is just considering one dimension of variable whereas PDE is more complex as its includes spatial calculation. The other name for mechanistic model is first principle model.
  • Empirical Modeling: Empirical modeling is simply to find a generic relationship between input and output of the system. Thus, the system/process knowledge and operation is not needed in the modeling development. Based on a set of data from the real system, a certain correlation between the input and output is explored. In the final stage, the developed model is presumed to have generalized the real system/process behavior and dynamic. The other name for empirical modeling is black box modeling. The linear or nonlinear application is depend on the order and behavior of the system. If the system is known to have nonlinearities in its response, then a nonlinear modeling is more suitable. In the Figure 1, some examples of linear and nonlinear empirical modeling techniques are shown.
Qualitative Model

Qualitative modeling utilizes a more humane approach as the model is developed according to its ‘true nature’. The ‘true nature’ is something than can preclude the mathematical description such as constrains, physical limitation, saturation, safety etc that happen in the real system/process. A simple qualitative model is the IF-THEN-ELSE model which is developed from the knowledge of experienced operator. Apart from this qualitative process description model, genetic algorithm and qualitative physic theory are developed to further improve the model performance and accuracy. Qualitative transfer function uses a dynamic linkage between the transfer functions to include the system ‘true nature’. The linkage characteristic is influence by the real system behavior. Fuzzy logic model uses algebra and a set of linguistic rule to develop the ill-behave and complex system. The fuzzy logic modeling technique combine a rule based model, probabilistic theory and sets of symbols with interpretation to generate a model.

In the nutshell: There are many type of model that is available with different properties, application and development route. Before using any of these models, it is wise to identify your system/process dynamic and behavior first.