A liquid rocket engine simulation optimization method based on Python control

By using a Python-based simulation optimization method for liquid rocket engines, the problem of manually adjusting parameters in existing technologies has been solved, and the optimization of simulation parameters has been automated, improving design efficiency and performance optimization accuracy.

CN120278006BActive Publication Date: 2025-11-25NAT UNIV OF DEFENSE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510343517.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-11-25
Estimated Expiration
2045-03-21

AI Technical Summary

Technical Problem

Existing liquid rocket engine simulation platforms rely on manual adjustment of simulation parameters, which makes it difficult to cope with complex multivariate design problems, resulting in low optimization efficiency. Furthermore, Amesim's Python API function calls are complex and parameters cannot be modified.

Method used

A simulation optimization method for liquid rocket engines based on Python control is designed. By creating a Python script to communicate with the Amesim model, simulation parameters are modified in real time, and optimization is performed by combining intelligent algorithms to achieve automated control of the simulation process.

Benefits of technology

This improves the design efficiency and performance optimization accuracy of liquid rocket engines, and provides an efficient and intelligent simulation optimization method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278006B_ABST
    Figure CN120278006B_ABST
Patent Text Reader

Abstract

The application discloses a liquid rocket engine simulation optimization method based on Python control in the field of liquid rocket engines. The liquid rocket engine simulation optimization method based on Python control comprises the following steps: creating a Python script for controlling simulation; establishing master and slave communication elements in an Amesim model; creating a Python script for modifying parameters in the Amesim model; inputting parameters output by the Amesim into an intelligent algorithm, and then performing parameter optimization. The liquid rocket engine simulation optimization method based on Python control can greatly improve design efficiency and performance optimization accuracy, and provides an efficient and intelligent method for research and development and performance optimization of liquid rocket engines.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of liquid rocket engine, in particular, to a liquid rocket engine simulation optimization method based on Python control. BACKGROUND

[0002] Liquid rocket engine is a key component of space propulsion system, its performance directly affects the thrust, combustion efficiency and reliability of the rocket. In the traditional design process, simulation technology is widely used in the performance analysis and optimization of liquid rocket engine. However, the existing simulation platform mostly depends on manual adjustment of simulation parameters, which is difficult to deal with complex multivariate design problems, and the optimization efficiency is low. At present, there are many modeling and simulation platforms for liquid rocket engine, and the calling methods of various simulation platforms are different. Amesim is a common liquid rocket engine simulation platform, its Python API function calling is complex, and the parameters cannot be modified, therefore, it is urgent to design a liquid rocket engine simulation optimization method based on Python control which can simply and clearly call simulation software, and can modify the simulation model parameters in real time during the simulation process. SUMMARY

[0003] In order to solve the above problems, the purpose of the present application is to provide a liquid rocket engine simulation optimization method based on Python control, which solves the technical problems that the existing technology mostly depends on manual adjustment of simulation parameters, is difficult to deal with complex multivariate design problems, and has low optimization efficiency, and designs a liquid rocket engine simulation optimization method based on Python control which can simply and clearly call simulation software, and can modify the simulation model parameters in real time during the simulation process.

[0004] In order to achieve the above purpose, the technical scheme of the present application is as follows:

[0005] The present application provides a liquid rocket engine simulation optimization method based on Python control, comprising the following steps:

[0006] S1. Create a Python script for controlling the simulation process;

[0007] S2. Establish master and slave communication elements in the Amesim model;

[0008] S3. Create a Python script for modifying the parameters in the Amesim model;

[0009] S4. Input the parameters output by Amesim into the intelligent algorithm, and then perform parameter optimization.

[0010] As a liquid rocket engine simulation optimization method based on Python control, S1 comprises the following steps:

[0011] S11. The liquid rocket engine model rocket_simulation.ame file name that has been created is written into the Python script by using the Python API library in Amesim, and the model is called by the "AMELoad" function;

[0012] S12. The model parameters are obtained using the "amegetvarnamefromui" function, and the simulation time and simulation step are set by the "amegetsimopt" function;

[0013] S13. The "amerunsingle" function is used to control the start of the simulation.

[0014] As a liquid rocket engine simulation optimization method based on Python control, the "amegetsimopt" function in S12 sets the total simulation time and simulation step through "finalTime" and "printInterval", respectively.

[0015] As a liquid rocket engine simulation optimization method based on Python control, S2 includes the following steps:

[0016] S21. In Amesim, select the element "DYNCOSIMSHM01" as the interface for information transmission between the simulation model and the Python script, and set it to "master" and "slave", respectively;

[0017] S22. Replace "master" and "slave" with Python code, but ensure that the output parameter dimension of master is consistent with the input parameter dimension of slave, and the output parameter dimension of slave is consistent with the input parameter dimension of master.

[0018] As a liquid rocket engine simulation optimization method based on Python control, the sampling time of "master" and "slave" in S21 is less than the simulation step set by the "amegetsimopt" function in step S12.

[0019] As a liquid rocket engine simulation optimization method based on Python control, S3 includes the following steps:

[0020] S31. Based on the VSCode platform, create a new Python script that can modify the parameters in the Amesim simulation model;

[0021] S32. The variable in the simulation model is obtained by the function "amegetvarnamefromui" function of the Python API in Amesim, and the model parameter is modified by the function "aneputp";

[0022] S33. The function "ameloadvarst" obtains the output result.

[0023] As a liquid rocket engine simulation optimization method based on Python control, wherein S4 comprises the following steps:

[0024] S41. A Python script containing an intelligent algorithm is created, and the parameters output by Amesim are input into the intelligent algorithm;

[0025] S42. The optimized model parameters are obtained through the calculation of the intelligent algorithm, and the optimized model parameters are input back into the new Python script in S31 to realize parameter optimization.

[0026] The above technical solutions have the following advantages:

[0027] The present application provides a liquid rocket engine simulation optimization method based on Python control, which solves the problem of manual adjustment of parameters in the existing liquid rocket engine simulation parameter optimization process. The simulation is controlled by creating a script to control the Python API function in Amesim, then the communication between the model and Python is realized through the memory, the parameters of the model and the simulation results are output to the intelligent algorithm in real time, and finally the optimized parameters are obtained through the calculation of the intelligent algorithm and input back to the simulation model to realize parameter optimization. The method of the present application combines Python script with Amesim software to automatically control the simulation process and can embed intelligent algorithm to realize real-time optimization of simulation parameters. The liquid rocket engine simulation optimization method based on Python control can greatly improve the design efficiency and performance optimization accuracy, and provides an efficient and intelligent method for the research and performance optimization of liquid rocket engines. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 The overall flowchart of the liquid rocket engine simulation optimization method based on Python control of the present application;

[0029] Figure 2 The relationship transmission diagram of different python scripts and Amesim files of the present application;

[0030] Figure 3 The Amesim model diagram of the present application;

[0031] Figure 4 A simulation model optimization result graph of the present application. DETAILED DESCRIPTION

[0032] The technical solutions of the present application are described in detail below in conjunction with the accompanying drawings of the specification. It should be noted that in this document, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device.

[0033] A liquid rocket engine simulation optimization method based on Python control, comprising the following steps specifically as shown in Figure 1

[0034] S1. Create a Python script for controlling the simulation to proceed;

[0035] Wherein, S1 comprises the following specific steps:

[0036] S11. By using the Python API library in Amesim, write the liquid rocket engine model rocket_simulation.ame file name created to the Python script, and realize the calling of the model through the "AMELoad" function;

[0037] S12. Obtain the model parameters using the "amegetvarnamefromui" function, set the simulation time and simulation step using the "amegetsimopt" function, and set the simulation total time and simulation step through "finalTime" and "printInterval" respectively using the "amegetsimopt" function.

[0038] S13. Control the simulation to start using the "amerunsingle" function.

[0039] ​In one specific embodiment, based on the VSCode platform, Python code is created for controlling the simulation of a liquid rocket engine model in the Amesim platform. By using the Python API library in Amesim, the already created model rocket_simulation.ame file name is written into the Python script, the model is called through the "AMELoad" function, then the model parameters are obtained using the "amegetvarnamefromui" function, and the "amegetsimopt" function is used to set "finalTime" and "printInterval" to 5.0 and 0.04, respectively, indicating that the total simulation time is 5s and the simulation step is 0.04s. Then, the "amerunsingle" function is used to start the simulation. The information transmission between different Python scripts and.ame files is shown in FIG. 8, which are two.ame files with master and slave, respectively. Then, two python scripts are used to control the two.ame files, respectively. Then, another python script is used to transmit the real-time output results of the.ame files to the intelligent control algorithm, and then the parameter modification instructions are returned to the.ame files. Figure 2

[0040] S2. Establishing a master and slave communication element in the Amesim model;

[0041] S2 includes the following specific steps:

[0042] S21. Selecting the element "DYNCOSIMSHM01" in Amesim as the interface for information transmission between the simulation model and the Python script, and setting it as "master" and "slave", respectively;

[0043] S22. Replacing "master" and "slave" with Python code, but ensuring that the output parameter dimension of master is consistent with the input parameter dimension of slave, and the output parameter dimension of slave is consistent with the input parameter dimension of master. In addition, the sampling time of "master" and "slave" should be less than the simulation step length set by the "amegetsimopt" function in step S12.

[0044] ​In a specific embodiment, in the rocker_simulation.ame file, a DYNCOSIMSHM01 element is added, set as "master", the sampling time is set as 0.04s, the shared memory is named as shm_0, the input parameter is 3-dimensional, and the output parameter is 11-dimensional. Then in the Python file responsible for the exchange, the "slave" class is set, the input parameter is 11-dimensional, the output parameter is 3-dimensional, and the established Amesim model is as shown in Figure 3 .

[0045] S3. Creating a Python script for modifying parameters in the Amesim model;

[0046] S3. Creating a Python script for modifying parameters in the Amesim model;

[0047] S31. Based on the VSCode platform, a new Python script for modifying parameters in the Amesim simulation model is created;

[0048] S32. The "amegetvarnamefromui" function in the Python API of Amesim is used to obtain the variables in the simulation model, and the "aneputp" function is used to modify the model parameters;

[0049] S33. The "ameloadvarst" function is used to obtain the output results.

[0050] In a specific embodiment, based on the VSCode platform, a Python script for modifying parameters in the Amesim simulation model is created. The parameters from the intelligent algorithm program are received, and the "ameputp" function in the Python API is used to modify the parameters in the Amesim model in real time. In this embodiment, the main modified parameter is the three-dimensional input parameter in the "master".

[0051] S4. Inputting the parameters output by Amesim into the intelligent algorithm, and then performing parameter optimization.

[0052] S4. Inputting the parameters output by Amesim into the intelligent algorithm, and then performing parameter optimization.

[0053] S41. A Python script containing an intelligent algorithm is created, and the parameters output by Amesim are input into the intelligent algorithm;

[0054] S42. Through the calculation of the intelligent algorithm, the optimized model parameters are obtained, and the optimized model parameters are input back into the new Python script in S31 to realize parameter optimization.

[0055] In a specific embodiment, optimization of the parameters of the liquid rocket engine valve is achieved by using a particle swarm algorithm, the parameters output by Amesim are input into the particle swarm algorithm, the optimized model parameters are obtained through calculation of the particle swarm algorithm, the optimized model parameters are input again into a new Python script that can modify the parameters of the Amesim simulation model, parameter optimization is achieved, the thrust of the liquid rocket engine is kept stable as soon as possible after starting, and a simulation model optimization result graph is obtained, as shown in Figure 4

[0056] Finally, it should be pointed out that although the present application has been described with reference to the current specific embodiments, those skilled in the art should realize that the above embodiments are only used to illustrate the present application and are not used as a limitation on the present application, various equivalent changes or replacements can be made without departing from the concept of the present application, therefore, changes and modifications of the above embodiments within the scope of the spirit of the present application will fall within the scope of the claims of the present application.​

Claims

1. A simulation optimization method for a liquid rocket engine based on Python control, characterized in that, Includes the following steps: S1. Create a Python script to control the simulation. S1 includes the following steps: S11. Using the Python API library in Amesim, the already created liquid rocket engine model, rocket_simulation.ame, is written into a Python script, and the model is called through the "AMELoad" function; S12. Use the "amegetvarnamefromui" function to obtain model parameters, and the "amegetsimopt" function to set the simulation time and simulation step size; S13. Use the "amerunsingle" function to control the start of the simulation; S2. Establish communication elements between master and slave in the Amesim model; S2 includes the following steps: S21. In Amesim, select the component "DYNCOSIMSHM01" as the interface for information transfer between the simulation model and the Python script, and set it to "master" and "slave" respectively; The sampling time of "master" and "slave" in S21 is less than the simulation step size set by the "amegetsimopt" function in step S12; S22. Replace "master" and "slave" with Python code, but you need to ensure that the output parameter dimension of master is consistent with the input parameter dimension of slave, and the output parameter dimension of slave is consistent with the input parameter dimension of master. S3. Create a Python script to modify the parameters in the Amesim model; S3 includes the following steps: S31. Based on the VSCode platform, create a new Python script that can modify the parameters in the Amesim simulation model; S32. Use the Python API functions in Amesim, the "amegetvarnamefromui" function to obtain variables in the simulation model, and the "aneputp" function to modify the model parameters; The S33.ameloadvarst function outputs the result. S4. Input the parameters output by Amesim into the intelligent algorithm, and then optimize the parameters; S4 includes the following steps: S41. Create a Python script containing an intelligent algorithm and input the parameters output by Amesim into the intelligent algorithm; S42. The optimized model parameters are obtained through the calculation of the intelligent algorithm, and the optimized model parameters are then input back into the new Python script in S31 to achieve parameter optimization.

2. The simulation optimization method for a liquid rocket engine based on Python control according to claim 1, characterized in that, In S12, the "amegetsimopt" function sets the total simulation time and simulation step size through "finalTime" and "printInterval" respectively.

Citation Information

Patent Citations

  • Method for optimizing dynamic performance of armored vehicle by adopting multi-language hybrid programming

    CN115688445A