Hysteresis is a fundamental characteristic of magnetic materials. The Jiles-Atherton (J-A) hysteresis model, which is known for its few parameters and clear physical interpretations, has been widely employed in simulating hysteresis characteristics. To better analyze and compute hysteresis behavior, this study established a state space representation based on the primitive J-A model. First, based on the five fundamental equations of the J-A model, a state space representation was established through variable substitution and simplification. Furthermore, to address the singularity problem at zero crossings, local linearization was obtained through an approximation method based on the actual physical properties. Based on these, the state space model was implemented using the S-function. To validate the effectiveness of the state space model, the hysteresis loops were obtained through COMSOL finite element software and tested on a permalloy toroidal sample. The particle swarm optimization (PSO) method was used for parameter identification of the state space model, and the identification results show excellent agreement with the simulation and test results. Finally, a closed-loop control system was constructed based on the state space model, and trajectory tracking experiments were conducted. The results verify the feasibility of the state space representation of the J-A model, which holds significant practical implications in the development of magnetically shielded rooms, the suppression of magnetic interference in cold atom clocks, and various other applications.