A new optimization algorithm is proposed, since a huge problem that many algorithms faced was not being able to effectively balance the global and local search ability. Matter exists in three states: solid, liquid, and gas, which presents different motion characteristics. Inspired by multi-states of matter, individuals of optimization algorithm have different motion characteristics of matter, which could present different search ability. The Finite Element Analysis (FEA) approach can simulate multi-states of matter, which can be adopted to effectively balance the global search ability and local search ability in new optimization algorithm. The new algorithm is creative application of Finite Element Analysis at optimization algorithm field. Artificial Physics Optimization (APO) and Gravitational Search Algorithm (GSA) belongs to the algorithm types defined by force and mass. According to FEA approach, node displacement caused by force and stiffness could be equivalent to motion caused by force and mass of APO and GSA. In the new algorithm framework, stiffness replaces mass of APO and GSA algorithm. This paper performs research on two different algorithms based on APO and GSA respectively. The individuals of new optimization algorithm are divided into solid state, liquid state, and gas state. The effects of main parameters on the performance were studied through experiments of 6 static test functions. The performance is compared with PSO, basic APO, or GSA for four complex models which made up of solid individual, liquid individual, and gas individual in iterative process. The reasonable complex model can be confirmed experimentally. Based on the reasonable complex model, the article conducted complete experiments against Enhancing artificial bee colony algorithm with multi-elite guidance (MGABC), Artificial bee colony algorithm with an adaptive greedy position update strategy (AABC), Multi-strategy ensemble artificial bee colony (MEABC), Self-adaptive heterogeneous PSO (fk-PSO), and APO with 28 CEC2013 test problem. Experimental results show that the proposed method achieves a good performance in comparison to its counterparts as a consequence of its better exploration-exploitation balance. The algorithm supplies a new method to improve physics optimization algorithm.