# Physics-Guided Neural Network-Based Feedforward Control for Seamless Pipe Manufacturing Process
## 2 Materials and Methods
### Physics-Guided Neural Network-Based Feedforward Control  
The core concept of the physics-guided neural network (PGNN) approach is to integrate the physical knowledge of the hydraulic actuator into a neural network-based feedforward control scheme. Rather than relying solely on data-driven methods or on purely model-based inversion, the PGNN combines both a reduced-order, physics-based model and a data-driven correction term. This synergy leverages physical laws for interpretability and robustness while using neural networks to compensate for nonlinearities and unmodeled effects. In order to implement this PGNN-based feedforward controller effectively, it is essential to first formalize the control objective and describe the system dynamics. The objective of feedforward control is to compute the control input \(u(k)\) such that the system output \(y(k)\) follows a desired reference \(r(k)\) with minimal error. Typically, the system dynamics can be represented using a nonlinear input-output model of the form  
\[y(k)=h\Big{(}[y(k-1),\ldots,y(k-n_{a}),\,u(k-n_{k}-1),\ldots,u(k-n_{k}-n_{b})]^ {T}\Big{)}, \tag{36}\]  
where \(n_{a}\) and \(n_{b}\) are the system order parameters, \(n_{k}\) is the input delay, and \(h(\cdot)\) is an unknown nonlinear function. For ideal feedforward control, we assume the existence of an inverse model \(h^{-1}(\cdot)\), enabling the computation of the required input:  
\[u_{\text{ff}}(k)=h^{-1}(\phi_{\text{ff}}(k)), \tag{37}\]  
where the regressor vector \(\phi_{\text{ff}}(k)\) includes future values of \(r(\cdot)\) and past inputs,  
\[\phi_{\text{ff}}(k)=\big{[}r(k+n_{k}+1),\ldots,r(k+n_{k}-n_{a}+1),u_{\text{ff} }(k-1),\ldots,u_{\text{ff}}(k-n_{b}+1)\big{]}^{T}. \tag{38}\]  
Due to the complexity of real-world systems, the inverse model \(h^{-1}(\cdot)\) is typically unknown or only partially known. To address this, the feedforward input \(u_{\text{ff}}(k)\) is decomposed into two components,  
\[u_{\text{ff}}(k)=f_{\text{phy}}(\theta_{\text{phy}},\phi(k))+g(\phi(k)), \tag{39}\]  
where \(f_{\text{phy}}(\theta_{\text{phy}},\phi(k))\) is a reduced-order physics-based model that approximates the inverse dynamics, and \(g(\phi(k))\) is the structural model error, accounting for the discrepancy between the true inverse model and the physics-based approximation. The structural model error \(g(\phi(k))\) can be defined as  
\[g(\phi(k))=h^{-1}(\phi(k))-f_{\text{phy}}(\theta_{\text{phy}},\phi(k)). \tag{40}\]  
This decomposition highlights the limitations of purely physics-based models in capturing system nonlinearities and motivates the introduction of data-driven methods to learn \(g(\phi(k))\). To capture these unmodeled dynamics, we introduce a physics-guided neural network (PGNN). Instead of relying solely on a data-driven network or a purely model-based approach, the PGNN combines both:  
\[u_{\text{ff}}(k)=f_{\text{phy}}(\theta_{\text{phy}},\phi(k))+f_{\text{NN}}( \theta_{\text{NN}},T(\phi(k))), \tag{41}\]  
where the term \(f_{\text{phy}}(\theta_{\text{phy}},\phi(k))\) represents the physics-based model and captures the known dynamics of the system. The neural network component, \(f_{\text{NN}}(\theta_{\text{NN}},T(\phi(k)))\), is trained to learn the residual dynamics or structural errors not captured by the physics-based model. The architecture of this hybrid approach is schematically illustrated in Figure 6.  
We combine the unknown parameters into  
\[\theta = \left[ \begin{array}{cc}\theta_{\text{NN}}^{T},\ \theta_{\text{phy}}^{T} \end{array} \right]^{T}, \tag{42}\]  
which includes the neural network weights \(\theta_{\text{NN}}\) and the physics-based model parameters \(\theta_{\text{phy}}\). The input transformation \(T(\phi(k)):\mathbb{R}^{n_{x}+n_{b}}\rightarrow\mathbb{R}^{n_{0}}\) is optional and maps the input vector \(\phi(k)\) to a transformed space that improves the numerical properties and generates physically relevant features for the neural network.