Monthly Archives: April 2013

Parallel computation with Matlab, SPMD. Explanation with simple example code

Today I’d like to introduce a parallel computation skill in Matlab.

I also heard that the use of parallel computation in Matlab is very easy. But it was better than my expectation. Wonderful!! Smile

You need to know the usage of SPMD. It is pretty easy.

First let’s the code, you can also download this file in the attachment, click <here>.
parallel_computation_spmd

 

The result is the below

Starting matlabpool using the ‘local’ configuration … connected to 4 labs.
Elapsed time is 120.482356 seconds.
Sending a stop signal to all the labs … stopped.
Elapsed time is 167.796932 seconds.

Because, I did many other works in the calculation time, Its result is not very fast, The slowest CPU core determined the final computation time. But its performance is really good if you have more than 4 multi cpu cores.

I wish this post can help your understanding about the use of SPMD in Matlab.

if you have any question, please leave me a comment below.

—————————————————————————————————

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————

 

 

 

Phase plane analysis and Matlab code toolbox

Phase plain analysis is a useful visualization tool to understand the characteristics of systems including not only linear system but also nonlinear system. For example, we can determine stability of the system from this phase plane analysis.

The attachment file <here> is Matlab toolbox to draw phase plain. The attached file includes a simple demo and the below is the result. You can draw phase plane, magnify where you are interest recursively. You can see how to use the Matlab code in the following Youtube video.

demo_phase_plane

    

How to draw?

Given,

\dot{x}_1=f_1(x_1,x_2)

\dot{x}_2=f_2(x_1,x_2)

we can find the below equation

\frac{dx_2}{dx_1}=\frac{f_2(x_1,x_2)}{f_1(x_1,x_2)}

From \frac{dx_2}{dx_1}, we can find the direction of the phase change at the point of (x_1, x_2).

 

Advantage:

  1. It is an exact method. We can see the change of system’s state including transient response.
  2. Simple graphical method. It is very intuitive and easy to understand its characteristics.

Limit:

  1. Limited to the 2nd order system. It is expandable, but hard to visualize. 

Reference

1. Lecture of Prof. Fernadez in Mech. Eng, The Univ. of Texas at Austin.

Extended Luenberger Observer for nonlinear system control

——————————————————————————————————————————–

Herman (who commented for this posting) told me that there are two different versions of ELO. One is just to linearize a nonlinear function (this posting will handle it), and the other is using Lie-algebraic approach (refer to M. Zeitz 1987 “The extended Luenberger Observer”).

Thank you Herman.

——————————————————————————————————————————–

This article is to explain the use of Luenberger observer for nonlinear system control. In other words, it is Extended Luenberger Observer, (ELO, just like Kalman Filter (KF), and Extended KF).

The basic idea is to linearize nonlinear system around the interesting point. The below is the description of ELO and how to select gain values for Extended Luenberger Observer. The below description assumes that you already know about Luenberger Observer for linear system. If you don’t know visit here.

ELO_1

ELO_2

I wish this can help your understanding about Luenberger observer, if you have any question, please leave me a comment below.

—————————————————————————————————————————–

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————

Luenberger observer for linear system control

This article explains the design of Luenberger observer for linear system control. If you are interested in the design of nonlinear system observer, read the next article. Observer in control systems is very important because we cannot directly “observe” the system state. One very popular observer is Kalman Filter and another is this Luenberger observer. Kalman Filter is built based on Bayesian rule (probabilistic) so that it is robust for measurement error, but slow. In contrast, Luenberger observer is based on deterministic sense so that fast. Of course, robustness is very important but robust measurement algorithm makes the algorithm slow, and actually Luenberger observer can observe most of systems successfully. The below is the proof and the selection of gain values for Luenberger observer, If you are interested in nonlinear version of Luenberger observer, read here.

Luenberger_observer_1 Luenberger_observer_2

 

 

I wish this can help your understanding about Luenberger observer, if you have any question, please leave me a comment below.

—————————————————————————————————————————–

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————————————–

Feedback linearization control (FBL) for nonlinear system control proof, practical implementation, and easy example part 2

This article explains about Feedback linearization control (FBL) method for control of a nonlinear system. By demonstrating a control strategy of the inverted pendulum problem, I am going to explain how to implement its algorithm into a real system. The basic idea is that we can cancel control input by manipulating control input. The below is its practical implementation method and example.

If you want to know the proof of feedback linearization control method. refer this.

 

fbl_ex1

fbl_ex2

 

 

fbl_ex3 fbl_ex4

As we can see from the inverted pendulum example. nonlinear part can be canceled by control input. I wish it can help your understanding. If you have any question or need any help, leave a reply.

 

—————————————————————————————————————————–

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————————————–

 

 

Feedback linearization control (FBL) for nonlinear system control proof, practical implementation, and easy example part1

This article explains about Feedback linearization control (FBL) method for control of a nonlinear system. This is one of the easiest strategy to control nonlinear systems, but pretty powerful. The basic idea is that we can cancel control input by manipulating control input. The below is its proof. fbl_1 fbl_2

 

This is the most basic concept to explain easily. If the nonlinear system is not fully controllable, we should use another strategy which finds reduced order manifold (ROM). About the more advanced technique and examples will be explained in the next articles.

 

—————————————————————————————————————————–

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————————————–

Loading Speed Comparison of Free Web Hosting Companies. 000webhost.com vs biz.nf vs freehostingeu.com

This posting is to compare the loading speeds of the following three free web hosting companies.

000webhost.com vs biz.nf vs freehostingeu.com

The above sites are the most popular free web hosting sites, and the hosting conditions are all decent. But the biggest problem for me was slow speed of website loading.

Thus, I made same blogs on different hosting companies, and compared loading speeds. I wish this post can give you valuable information.

The speed test was conducted in http://www.webpagetest.org/

The below is the result of loading speed.

000webhost.com : 1.188sec

biz.nf : 8.389sec

freehostingeu.com : 15.431 sec

You can see the screenshots.

loading_speed_free_web_hosting_000webhost

Loading speed test result of 000webhost.com, because I finally selected this site as my hosting company, the domain is my current domain.

loading_speed_free_web_hosting_biz.nf

Loading speed test result of biz.nf

loading_speed_free_web_hosting_freehostingeu

Loading speed result of freehostingeu

Conclusion: I strongly recommend 000webhost.com.

 

Before going 000webhost.com, I also tried ipage.com, but it’s speed is also very very slow. I don’t recommend it.

I wish this post can save your time. Have a nice day.

 

—————————————————————————————————————————–

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————————————–