Optimization of Gantry Beam Structure Based on BP Neural Network and Improved NSGA-II Algorithm in MATLAB

Optimization of Gantry Beam Structure Based on BP Neural Network and Improved NSGA-II Algorithm in MATLABOptimization of Gantry Beam Structure Based on BP Neural Network and Improved NSGA-II Algorithm in MATLAB

1. Core Idea

The core of this solution is to utilize the nonlinear mapping capability of the BP neural network as a high-precision, low-cost surrogate model to replace the computationally expensive finite element analysis (FEA), and then combine it with the powerful search capability of the improved NSGA-II algorithm to find the optimal beam structure scheme in a complex multi-objective design space.

  • BP Neural Network (Surrogate Model): Learning the complex nonlinear relationships between the design variables (such as dimensions, shape parameters) and the response variables (such as mass, maximum deformation, maximum stress) of the beam. Once trained successfully, its prediction speed is several orders of magnitude faster than FEA.

  • Improved NSGA-II (Optimizer): Based on the neural network model, it simultaneously optimizes multiple objectives (such as lightweight, high stiffness, low stress) and identifies a series of optimal trade-off solutions. The improvements aim to enhance the convergence speed and diversity of the original NSGA-II when solving such problems.

2. Overall Process

The entire optimization process follows a clear logical chain, from parametric modeling to final decision-making, with the core step being the replacement of simulation analysis with a surrogate model to achieve rapid optimization iterations. The specific process is shown in the figure below:

Optimization of Gantry Beam Structure Based on BP Neural Network and Improved NSGA-II Algorithm in MATLAB

Phase One: Parametric Modeling and Sample Generation
  1. Determine Design Variables:

  • Dimension Variables: Beam wall thickness, rib plate thickness, cross-section height/width, etc.

  • Shape Variables: Layout, number, and position and size of openings in the rib plates (usually requires parametric modeling).

  • Each variable has its feasible upper and lower limits.

  • Determine Optimization Objectives and Constraints:

    • Objective 1: Minimize Mass -> Achieve lightweight design and reduce costs.

    • Objective 2: Minimize Maximum Deformation -> Ensure static stiffness and improve processing accuracy.

    • Objective 3: Minimize Maximum Equivalent Stress -> Ensure structural strength and improve safety.

    • Constraints: Maximum deformation < allowable value, maximum stress < allowable stress, first-order natural frequency > a certain threshold (to avoid resonance).

  • Experimental Design and FEA Sampling:

    • Use Latin Hypercube Sampling or Optimal Latin Hypercube Sampling to generate a batch of representative sample points within the design variable space.

    • For each sample point (i.e., a specific set of design variables), perform static and modal analysis using the parametric finite element model to calculate its mass, maximum deformation, maximum stress, and other response values.

    • This results in a dataset for training the BP neural network:<span>{Input: Design Variables -> Output: Mass, Maximum Deformation, Maximum Stress}</span>.

    Phase Two: Construction of Surrogate Model Based on BP Neural Network
    1. Data Preprocessing: Normalize input and output data to accelerate convergence and improve accuracy.

    2. Network Construction and Training:

    • Construct a 3-layer or 4-layer BP neural network (input layer, 1-2 hidden layers, output layer).

    • Difference from ELM: The BP network uses the error backpropagation algorithm to iteratively adjust all weights and biases using gradient descent methods (such as the Levenberg-Marquardt algorithm) until the error between the network output and FEA results is minimized.

    • Although the training speed is slower than ELM, the BP network is generally considered to have stronger nonlinear fitting capability and higher prediction accuracy, which is crucial for complex structural response problems.

  • Model Validation: Use a test dataset that was not involved in training to evaluate the model’s prediction accuracy (R², RMSE), ensuring it can reliably replace FEA.

  • Phase Three: Multi-Objective Optimization Based on Improved NSGA-II

    The improved NSGA-II is the highlight of this solution, with common improvement strategies including:

    1. Improvement 1: Hybrid Initialization Strategy

    • Not just randomly generating the initial population, but combining it with Latin Hypercube Sampling to ensure a more uniform distribution of the initial population within the design space, improving the quality of the search starting point.

  • Improvement 2: Adaptive Crossover and Mutation Operators

    • Design the distribution index of simulated binary crossover and polynomial mutation to adaptively change with the number of iterations. In the early stages of evolution, the distribution index is small, producing offspring far from the parents, enhancing global exploration capability; in the later stages, the distribution index is larger, producing offspring close to the parents, enhancing local exploitation capability.

  • Improvement 3: Enhanced Elite Selection Strategy

    • Based on crowding distance calculation, introduce the concept of reference point method (similar to NSGA-III), which can better maintain the diversity and distribution of the solution set, especially when the number of objectives is large.

    • Alternatively, introduce dynamic crowding distance, giving greater weight to areas with sparse solution distribution to avoid the “crowding distance black hole” problem.

  • Improvement 4: Introduction of Local Search Operators

    • At the end of each generation of the standard NSGA-II, perform gradient descent or pattern search on some excellent individuals on the Pareto front, utilizing the differentiable characteristics of the BP neural network to quickly guide the population towards better regions.

    Optimization Process:

    • Use the trained BP neural network as the fitness function evaluator.

    • Each individual of the improved NSGA-II (a set of design variables) is input into the BP network to quickly obtain its predicted multiple objective values.

    • The algorithm selects, crosses, and mutates based on non-dominated sorting and improved crowding/reference point association, continuously evolving.

    • Finally, output the Pareto optimal solution set, which is a series of excellent design schemes achieving different balances between “lightweight – high stiffness – high strength”.

    Phase Four: Decision Making and FEA Validation
    1. Multi-Attribute Decision Making: From the Pareto solution set, select a final scheme based on design requirements (for example, prioritize ensuring stiffness, then consider weight reduction) using methods such as TOPSIS or fuzzy decision-making.

    2. FEA Validation: Substitute the parameters of the final selected design scheme into the original finite element model for precise FEA calculation, verifying whether the predictions of the BP neural network are accurate and ultimately confirming the reliability of the optimization results.

    3. Advantages and Summary of the Scheme

    1. Extremely High Computational Efficiency: Neural network predictions completed in milliseconds replace FEA calculations that take minutes or even hours, making it feasible to call the fitness function thousands of times in evolutionary algorithms.

    2. High Quality of Optimization:

    • The BP neural network can fit complex structural responses with high precision.

    • The improved NSGA-II algorithm has better convergence and diversity, capable of finding a globally better and more uniformly distributed Pareto solution set.

  • Strong Engineering Practicality: Provides multiple feasible design schemes, supporting decision-makers in making selections based on preferences, perfectly solving the problem of conflicting multi-objectives in engineering.

  • Summary: The optimization method for gantry beam structures based on BP neural networks and improved NSGA-II is an advanced and effective approach to achieving lightweight and high-performance designs. It seamlessly integrates numerical simulation with optimization design through intelligent algorithms, greatly enhancing design efficiency and product quality, with broad application prospects in heavy machinery, aerospace, and other fields.

    Code Access (non-public, please do not misuse)Optimization of Gantry Beam Structure Based on BP Neural Network and Improved NSGA-II Algorithm in MATLAB

    Leave a Comment