# Suboptimal Analysis of the Differential System of the Conceptual Trailer Air Brake Valve
## 2 Materials and Methods
### Mathematical Model
The force from the spring \(F_{s}\) located in chamber B was calculated from the sum of the preload force and the variable force due to piston displacement and spring stiffness:  
\[F_{s}=F_{0}+kh_{p}, \tag{7}\]  
where \(F_{0}\)--preload force; \(k\)--spring stiffness; \(h_{p}\)--piston displacement. The force resulting from the friction \(F_{s}\) of the piston seal against the valve housing is divided into two types, static \(F_{f\!s}\) and kinetic \(F_{f\!s}\), depending on the movement of the piston or lack thereof. \[F_{f}=\left\{ \begin{array}{ll}F_{fs}=\mu_{s}F_{N}&\mathrm{if}\quad h_{p}=0,\,h_{p}=h_{\mathrm{max}}\\ F_{f\!s}=\mu_{k}F_{N}\mathrm{sgn}\Big{(}\dot{h}_{p}\Big{)}&\mathrm{if}\quad h _{p}=\mathrm{var}\end{array} \right., \tag{8}\]  
where \(\mu_{s}\)--static friction coefficients; \(\mu_{k}\)--kinetic friction coefficients; and \(F_{n}\)--contact force. The mass inertia drag force \(F_{m}\) was calculated from the following:  
\[F_{m}=m\frac{\mathrm{d}^{2}h_{p}}{\mathrm{d}t^{2}}, \tag{9}\]  
where \(m\)--piston and piston rod mass Based on Equations (1)-(9), a system of differential equations was formed as follows:  
\[\left\{ \begin{array}{l}\frac{\mathrm{d}h_{p}}{\mathrm{d}t}=v\\ \frac{\mathrm{d}v}{\mathrm{d}t}=\frac{F_{p}-F_{s}-F_{f}}{m}\\ \frac{\mathrm{d}p_{A}}{\mathrm{d}t}=\frac{\kappa RT}{V_{A}}\left(\frac{ \mathrm{d}m_{p}}{\mathrm{d}t}-\frac{\mathrm{d}m_{noc}}{\mathrm{d}t}-\frac{P_{A }}{\mathrm{d}t}\right.\frac{\mathrm{d}V_{A}}{\mathrm{d}t}\right)\\ \frac{\mathrm{d}m_{p}}{\mathrm{d}t}=\frac{\kappa RT}{V_{B}}\left(\frac{ \mathrm{d}m_{out}}{\mathrm{d}t}-\frac{P_{B}}{\mathrm{d}t}\right.\frac{\mathrm{d }V_{B}}{\mathrm{d}t}\right)\\ \frac{\mathrm{d}m_{in}}{\mathrm{d}t}=\left(\mu A\right)_{in}v_{max}p_{in}\, \varphi_{max}(\sigma)\,f(\sigma)_{in}\\ \frac{\mathrm{d}m_{noc}}{\mathrm{d}t}=\left(\mu A\right)_{noz}v_{max}p_{noz}\, \varphi_{max}(\sigma)\,f(\sigma)_{noz}\end{array} \right.. \tag{10}\]  
Among the range of optimization methods, such as grey wolf [34], whale [35], Harris hawks [36], body shape [37], particle swarm [38], game theory [39], and many others, the genetic algorithm (GA) was chosen [40]. The GA algorithm was designed to simulate biological processes, so biological terminology is used in its description. Although genetic algorithms may differ in details, they almost always have common components, which include the follow [41]:  
* Fitness function necessary for optimization;
* Population of all chromosomes;
* Selection from the population of chromosomes that will reproduce;
* Crossing over chromosomes to produce the next generation of chromosomes;
* Random mutation in the new generation of chromosomes. The most important component of the algorithm is the fitness function, and from its notation the optimal solution is obtained. A chromosome is considered a numerical value that presents the solution to the problem. For a problem with N-pairs of dimensions, each chromosome is encoded as follows:  
\[\text{chromosome}=\left[p_{1},p_{2},\ldots,p_{Npar}\right], \tag{11}\]  
where \(p\)--particular value of the \(i\)-th parameter. Each chromosome is evaluated with a fitness function in terms of problem solving. With a non-negative fitness function, the probability of selecting chromosome \(A_{11}\) for further reproduction can be calculated as follows:  
\[P(A_{11})=\left|\frac{f(A_{11})}{\sum\limits_{i=1}^{N_{pop}}f(A_{11})}\right|, \tag{12}\]  
The selection of the chromosome to be exchanged can repeat from the position of the operator, and the crossover and recombination resemble the phenomena found in biology. Disposing of parental chromosomes:  
\[[1101011100\;1000]\text{ and }[0101110101\;0010], \tag{13}\]  
They can be crossed, for example, after the fourth bit, obtaining the following descendants:  
\[[0101011100\;1000]\text{ and }[1101110101\;0010]. \tag{14}\]  
Furthermore, the second generation is tested by the fitness function and the process repeats itself, where evaluation and selection take place. Mutation prevents the optimization process from getting stuck in a local minimum.