This repository gathers a set of VBA macros for the common microwave simulation software CST Studio. Using these macros you can create a defined set of electrical field probes on a plane/cylinder/sphere and export the resulting simulated near-field measurement data.
The macros are useable but not thoroughly tested. The current version works for CST Studio Version 2017, but the code can easily be adapted.
To use the macros, they have to be imported. Under Macros/Import Macros you can select the files to import. Be aware that the file ending .mcr is used.
Through the build-in macro editor the macros can be executed but also adapted. Check the CST documentation for a VBA reference.
To create a set of probes on a plane use the CreatePlanarScanner macro.
The plane can be aligned with either x-,y- or z-axis of the model WCS. Parameters are:
- Number of probes in first direction
- Number of probes in second direction
- Spacing of probes in first direction
- Spacing of probes in second direction
- Distance of plane to origin
All distances have to be provided in mm. At the same time make sure that the CST unit for distance is set to mm as well.
After creation of the probes, you will see something like this:
Before simulation, make sure to correctly build a mesh so that the probes are included (This is usually done automatically but can lead to problems in some templates).
Since the probed E-field components are unhandy to work with, the getProbeData macro was written. It combines the E-field values of all probes with their position at a specific frequency and writes it into a single file that can easily be post-processed with mMATLAB. For this to work, at least one Far-Field Monitor has to be set up with a frequency that lies inside the simulation frequency boundaries. The macro will create a dedicated file for each Far-Field Monitor that has been created. This enables easy comparison of Near- and Far-Field "measurements".