Over the last decades, a great deal of research has been focused on power quality issues in electrical energy transportation. We present a statespace representation to model dynamical power systems like electrical distribution systems. The proposed model is able to take into account all the dynamic behavior of a multiphase power system. It has been applied to model a typical three-phase power system and its unbalance, i.e., an electrical grid which can be perturbed by nonlinear loads and distributed renewable energy generation which is a typical changing system. Associated with an extended Kalman filter, the state-space model is used to iteratively estimate power quality parameters. Indeed, the symmetrical components of the power system, i.e., their amplitude and phase angle values, and the fundamental frequency can be calculated at each iteration without any prior knowledge. The proposed estimation technique is an evolving and adaptive method able to handle the changing power system. Its effectiveness has been evaluated by several tests. Results have been compared to other methods. They show the efficiency and better performance of the proposed method. The fundamental frequency and the symmetrical components are precisely estimated even under disturbed and time-varying conditions. This state-space representation can therefore be used in active power filtering schemes and in load frequency control strategies.