Modeling and control of deep sign-defined dynamics for hybrid train

Learn how sign constraints in neural networks enable convex predictive control for hybrid trains, improving extrapolation and smoothness.

sábado, 18 de julio de 2026 • 5 min read • Q2BSTUDIO Team

Improved extrapolation and smoothness in hybrid train control

Today, the rail industry is challenged to decarbonize its operations without sacrificing efficiency or reliability. Hybrid trains, which combine internal combustion engines with electric propulsion systems and energy storage, represent an ideal intermediate solution. However, controlling in real time the complex interaction between the diesel engine, batteries and power converters requires advanced predictive models that are accurate, fast and, above all, safe. This is where the combination of deep learning with structural constraints—sign-defined dynamics—opens up a new avenue of optimization.

Modeling physical systems with deep neural networks has shown great potential to capture nonlinear behaviors without the need for explicit differential equations. However, its application in critical control has been limited by a lack of guarantees: predictions can violate fundamental physical principles (such as the positivity of energy levels or the monotonicity of certain variables) and the resulting optimization problems are often non-convex, leading to multiple local minima and erratic control laws. To overcome these limitations, it has been proposed to impose sign restrictions on the Jacobins of the neural model. This means demanding that certain partial derivatives are always non-negative (or non-positive), which forces properties of monotonicity, positivity or sign-definiteness in the learned dynamics.

From an implementation standpoint, these constraints can be achieved by specific network architectures: non-negative weights in fully connected layers, monotonous activation functions such as ReLU or Leaky ReLU, and linear combinations with bounded coefficients. In this way, the neural network becomes a 'physically informed' model by construction, without the need for additional penalties in the loss function. Once the model respects the sign-defined structure, the model-based predictive control (MPC) problem can be reformulated as a convex quadratic program, or at least as a convex relaxation. This ensures the existence of a single global optimizer, a continuous Lipschitz control law, and much greater numerical stability than in traditional non-convex approaches.

The application of this methodology to a hybrid train is particularly promising. Consider a power system made up of a diesel engine, a synchronous generator, a lithium-ion battery bank, and a regenerative braking system. Status variables include battery state of charge (SoC), engine temperature, train speed, and power demand. A sign-defined neural model can ensure, for example, that an increase in traction demand translates into a monotonic increase in fuel consumption, or that the battery is never discharged below a physical limit. By incorporating these constraints, the convex MPC can calculate in milliseconds the optimal combination of electric and diesel power to minimize total consumption, keeping the battery within its safe operating window. Simulated experiments show that this approach offers significantly better extrapolation to unseen scenarios (e.g., steep slope route profiles) and a smoothness in control signals that reduces mechanical wear and emissions.

Beyond the technical benefits, the practical implementation of these systems requires a robust and scalable software infrastructure. In this context, companies such as Q2BSTUDIO offer key services to industrialize these solutions. On the one hand, custom application development makes it possible to design embedded control platforms that run the neural model and convex optimizer on on-board hardware (e.g., on an industrial Raspberry Pi or a PLC). On the other hand, integration with AWS and Azure cloud services makes it easy to train models in the cloud, remotely update parameters, and continuously monitor performance. In addition, the increasing connectivity of hybrid trains makes them potential vectors of cyberattacks; therefore, cybersecurity must be part of the design from the beginning. Q2BSTUDIO incorporates pentesting and vulnerability analysis services into its projects, ensuring that communication between the train and the control center is secure.

Business intelligence also plays a critical role. The data generated by the train fleet – fuel consumption, temperature, battery usage, driving profiles – can be exploited through business intelligence tools such as power BI, providing interactive dashboards that help operators optimise routes, schedule predictive maintenance and reduce costs. Q2BSTUDIO offers business intelligence services that allow data to be transformed into decisions, integrating real-time sources with advanced analytical models.

The natural next step in this evolution is the incorporation of autonomous AI agents that can manage train control without direct human intervention. These agents, trained with sign-defined models and equipped with reinforcement learning capabilities, could dynamically adapt the energy management strategy according to traffic conditions, weather or fuel prices. Q2BSTUDIO works on the development of AI agents for companies seeking to automate critical processes, always with guarantees of stability and security.

From a training point of view, sign-defined models have an additional advantage: by reducing the parameter space to a convex region of permissible solutions, the optimization process is more stable and converges faster than in unconstrained networks. This is especially relevant when training data is limited or noisy, a common situation in railway applications where operating conditions vary widely. In addition, the sign-defined structure acts as a natural regularizer, preventing overfitting and improving generalization. In comparative tests against standard LSTM networks, the proposed models showed a mean square error up to 30% lower in multi-step predictions, and a maximum deviation in the control signal of only 2% compared to 15% for non-convex approaches.

In summary, the modeling and control of deep sign-defined dynamics represents a significant advance in the management of complex hybrid systems such as trains. By imposing physical constraints on deep learning models, a unique balance is achieved between accuracy, convexity, and robustness. The successful implementation of these solutions requires a technology partner that combines expertise in artificial intelligence, custom software development, cloud infrastructure, and cybersecurity. With companies like Q2BSTUDIO, rail operators can accelerate their transition to cleaner, more efficient, and more reliable transportation.

If your organization is exploring how to apply artificial intelligence for companies in the control of energy systems, we invite you to learn about our artificial intelligence solutions and development of custom applications. The combination of deep models with physical constraints and a robust technology platform is the key to the future of hybrid transportation.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.