In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Electromagnetic field simulation software CST original macro: modified version of Parameter Mesh (automatically update parameter values)
Author: aaron8967 homepage: http://aaron8967.blog.51cto.com
Description: in the process of learning and using CST software, I first set up a parameterized structural model, and then want to let CST automatically simulate different structures by changing the values of structural parameters. But CST's own macro program can not fully meet my requirements, so I simply learned the VBA language, and then modified the original VBA macro file, basically achieved some custom functions. Finally, whether it is CST software or VBA programming, I only have a superficial understanding, sharing is only for learning and communication, so please understand the shortcomings, welcome criticism and correction.
Original macro: Wizard / Parameter + Mesh Study
Source file: see Macros- > Edit/Move/Delete VBA Macro-> Global Macro in the CST software menu
Function: first select the number and name of parameters, and set the corresponding start value, step size and end value, and then the macro program will automatically scan all the parameter settings within the range of values and simulate.
Limitation: if the user only wants to simulate a few sets of all parameter settings or some combination of parameter settings will cause the simulation can not be carried out, the original macro obviously can not achieve all the simulation goals efficiently.
Modified version: ParSweepV05
Function: use the method of input parameter setting of TXT text file to scan only the combination of user-defined parameter settings for simulation analysis.
Source file: ParSweepV05.txt ParSweepV05 description .txt
Prerequisites for use:
1. In the process of building a physical model using CST software, users have established at least one variable
two。 Users need to write the parameter settings they want to simulate into the TXT file according to the format specified later.
3. Just in case, please back up the original simulation file before using this modified macro
How to use it:
First, import the contents of the ParSweepV05 source file into the CST software and generate macros
Second, put the format parameter file (TXT document) set by the user under the root directory of the simulation folder
Third, run ParSweepV05 for simulation
4. View the output results and log files
Detailed operation steps:
First, import macro files
1. Open the downloaded source file ParSweepV05.txt, select all of its contents and copy them using Ctrl+C
two。 Double-click the * .cst file to open the user's CST simulation project
3. Click the make Macro option in the menu: Macros- > Make VBA Macro
4. Set the macro program name ParSweepV05 in the pop-up dialog box:
Option description: the first two radio boxes can select Control Macro by default, and the last check box (Make globally avaliable), if selected, will make this macro available in all projects opened by the local CST software, otherwise it will only be available in this project.
5. Click OK, you will enter the macro editing interface, delete all the contents, and copy the previously copied content in Ctrl+V.
6. Click the save button, and you can now find the option of ParSweepV05 under the Maxros menu, but it cannot be used successfully yet.
Second, create a parameter file
1. Format description: the parameter file is named ParSets.txt and must contain all the parameters in the CST parameter list and be placed in the root directory of the project folder (the same directory as * .cst)
two。 According to the parameter list in the CST project, write the parameter name to the first line of the ParSets.txt file, separated by tabs
3. Write the values of the parameters in turn, separated by tabs, according to the order of the first line of parameter names. The parameter value of each row represents the parameter setting of one simulation, and the simulation will be carried out as many times as there are many parameter settings. Be sure to make sure that at least one parameter setting of each row is different from that of other rows.
4. Save the file and close
Third, simulation
1. When you open the Macros menu in the engineering interface of the CST software, you will see the options of ParSweepV05. The order of the Macros menu may be different.
two。 Make sure that all the project files have been backed up, click ParSweepV05, and a dialog box will pop up showing the total number of parameters. If confirmed, click the OK button.
3. A list of the initial values of all the current parameters will be displayed, which has no effect on the value during the simulation. Click the OK button.
4. The function of setting the parameter range has been blocked in the custom program. Click Start Parameter Study.
5. Select the solver to use and click the Start button to start the simulation
4. View the results
1. After the simulation is completed, you can view all the 1D simulation results in the CST interface. To view the electric field distribution, you need to go to the project root directory to view it.
two。 In the project root directory, there will be a folder named "project name _ sweep_ sequence number", which is the storage path of the simulation result. The project name is the name of the current project, and the value of the sequence number represents the result of how many times the user runs ParSweepv05.
3. Enter this folder, each file named "Set serial number" corresponds to a simulation project under a parameter setting, double-click to open it, and the value of the sequence number represents that the parameter setting used in this simulation is the parameter value of several lines except the first line in the ParSets.txt file.
4. Within this results folder, there are also several log files used to record the time and parameter settings for each simulation, such as ParSwLog.txt and ParSwPost.txt, which are briefly described in the ParSweepV05 specification .txt.
The content of this article is modified from the original VBA macro of CST software: Wizard / Parameter + Mesh Study, for learning and communication only.
Due to the limited personal level, we hope to forgive the inadequacies and welcome criticism and correction.
By aaron8967
Attachment: http://down.51cto.com/data/2362182
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.