Automation of Nastran NX FEM analysis using Matlab code
40 次查看(过去 30 天)
显示 更早的评论
Hello,
I have to compute a large number of FEM analysis using NX-Nastran, modifying some parameters (geometry, stiffness), and than compute specific tasks (e.g. compute static deflection on a poin of the structure or compute an FRF in a specific DOF of strucute). Then I want to use such FEM results for perform some operations in MATLAB (for example a numerical optimization).
I think that it could be a good idea use Matlab code to automatize the optimization of the FEM model.
Basically this is the procedure that I want to get:
- I want to modify some parameters from MATLAB to my Nastran model (Maybe modify the input file *.dat file?).
- (eventual) re-mesh of the model.
- run the FEM analysis from MATLAB (i.e. run NASTRAN engine from MATLAB, passing the simulation input file and the mesh file)
- Save FEM results into a text file on the FEM folder.
- Read the results in Matlab and perform my analysis
- do it again until finish condition is met.
How can I do such "driven optimization"?
5 个评论
Boby Alexander
2024-3-18
Hi Katherinie, are you completed the integration of Nastran and Matlab?
Can you share your finding, results or code that use in Matlab here?
I am working on the coupling between Nastran and Matlab and figure out that it is very difficult. Maybe you can help me.
My email is : alexpnitb2000@gmail.com please share your achievement with me. Many thanks.
回答(2 个)
V San
2020-8-26
Nastran's Quick Referece Manual is the key! I am using a similar approach as in the link shared above by @Alberto Mora in an optimization framework. Some helpful points in addition to what is highlighted there:
- The important sections in the Nastran .bdf file can be broken into the following sections
- Case control
- mesh - elements and grid points (nodes)
- material and properties
- boundary condition related (SPC, etc)
- loads (forces, enforced displacements)
- methods (e.g. in eigenvalue analysis)
There maybe other sections depending on your analysis, but these are the most common. If you are going to repeat analysis on the same model, the mesh will be same. Case control defines the IDs of the loads, boundary conditions, methods, etc in the analysis for each subcase. This is generally predefined.
So, you can create a "base" .bdf file with these details. You can also add any other detail that you know will remain same throughout in your analysis.
2. Good practice to create a copy of this "base" file, before editing with updated parameters. This way, you can use it multiple times without running into bugs. Copy, read, write, etc in Matlab are readily available functions. Depending on where you base files are stored and where you want to run nastran, make sure folder paths are defined correctly.
3. In writing data, make sure you stick to the "8-bit" (or 16 - nastran's Quick Referece Manual has details on this) format or use commas. For beginners, using a text editor like Notepad++ will go a long way (rather than Notepad or Wordpad)!!
3. If you are going to run different types of anlysis, e.g SOL103, SOL105, etc on the same model, create .dat or .bdf files separately for mesh elements, nodes, material, etc. This way, in your main analysis .bdf files you would only have to use "INCLUDE" keyword to attach these details, rather than repeat everthing for each analysis file. Also, editing and debugging would be easier (Say, you want to change the material, you would only have to update in one place, not all the anlysis files). e.g.
INCLUDE node_list.dat
INCLUDE material_list.dat
4. If you need to include, for e.g. loads, from one anlysis as input to another anlysis, an option is to generate .pch output for that data in the first analysis and directly include it in the .bdf of second anlysis using "INCLUDE" keyword
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!