## 2 Materials and Methods  
State-space representation is a technique used in the analysis and design of dynamic systems. This technique is based on the description of a system in terms of its status variables, inputs and outputs [31]. In general, a dynamic system can be represented in state space by the following matrices:  
State matrix (\(A\)): This matrix represents the dynamics of the system in terms of its state variables. Matrix \(A\) is a square array of order \(n\), where n is the number of system state variables. The elements in matrix \(A\) determine how state variables change over time. In other words, matrix \(A\) describes how state variables relate to each other over time. Input matrix (\(B\)): This matrix represents how inputs affect the system. Matrix \(B\) is an array of  
\[y=Cx \tag{3}\]  
The transfer matrix provides important information about system behavior, such as stability, transient response and steady-state response. In control theory, one of the most common difficulties is designing controllers for systems that can function effectively even when faced with different types of variables and irregularities. This allows you to analyze and design control systems, identify system poles and zeros, and perform simulations and predictions of system behavior under different conditions [35]. The transfer matrix with reference is defined as the Laplace transform of the relation between the output and the reference input, with the initial conditions null; see Equation (4). \[G(s)=C(sI-A)^{-1}B+D \tag{4}\]  
where \(\varnothing(A)\) is the desired characteristic equation of our system under study and, in this way, we can directly calculate the state feedback matrix under study, to carry out the control of the system, of different systems, or study cases, and serve as a relevant contribution in the area of SD [36]. Another of the important parameters for the search for control by means of Ackermann is the desired characteristic equation of the system, where it is analyzed how fast or slow the response of the state variables and of the system in general is desired; see Equation (5). \[\varnothing(A)=\lambda^{n}+\alpha_{1}\lambda^{n-1}+\alpha_{2}\lambda^{n-2}+ \ldots+\alpha_{n-1}\lambda+\alpha_{n} \tag{5}\]  
From the two matrix equations described, by means of the Ackermann formula is calculated the vector of gains, where is the matrix \(A\) or internal of the system and the matrix of controllability of the system \(C\); see Equation (6). \[k=(0\ 0\ldots\ldots\ldots 1)(C)^{-1}\varnothing(A) \tag{6}\]  
The proposed methodology consists of three fundamental stages for the design and implementation of the control system. In the first stage, the Forrester model is defined, which describes the dynamic behavior of the textile process and allows obtaining a mathematical representation of it. In the second stage, the differential equation of the model is identified and its transformation to state space is carried out, which allows obtaining a matrix representation of the system. In the third stage, the design and implementation of the control system is carried out, using the pole allocation technique through the Ackermann formula, to achieve optimal process performance. It should be mentioned that, in this methodology, three balancing loops, nine auxiliary variables and three flow variables are used, which are defined in the Forrester model and used in the transformation to the state space. The methodology can be seen in Figure 1.  
In the first stage, the Forrester diagram is designed, which symbolically represents the level, flow and auxiliary variables of the system. Forrester diagrams are specific system-dynamics (SD) modeling tools, which is a methodology for the study and analysis of complex continuous systems by seeking relationships between subsystems (especially feedback loops). It looks at the system as a \"whole\", usually using the computer for simulation. Vensim PLE Plus simulation software is used for this research.