Is it ethical to do phd thesis about topic someone else did it before? I have a big problem and I need your opinions and your advices.

Someone did his PHD 4 years ago using data collected over 10 years to develop some equations and simulate them. I re-measured the same data 2 years ago (i.e. spanning over 12 years; the methods of collecting the data are different) and I want to develop equations with simulating them in different program (I will do the programming of it). One of the equations was developed by him, and the two others are different. Is it ethical to continue my thesis or not? Is it considered as plagiarism? I have cited his results in the Scientific Background section, and in the Discussion I will compare it with my results.
It doesn't sound like there's an ethical problem here -- as long as you appropriately credit the earlier work. (That is, prominently cite the prior work and clearly explain the relationship.)

However, you should note that re-doing someone else's work with minor changes will generally be viewed as less significant and novel than the original work. In particular, doing almost the same analysis as someone else's PhD thesis is likely not sufficient for another PhD. 

That said, it is valuable (and often publishable) to re-do prior work. This is helpful to you and the community, and could form part of your PhD.