Jump to content

How to do custom exporting of selected results to a file every time the FEKO solver is run?

Recommended Posts

I am using an external program to process my FEKO results and would like to find a way to export the results to a custom format every time the model is solved. Is this possible?


I'm not processing the results in POSTFEKO directly since the scripts to process the results were developed a long time ago and written in Octave.

Share this post

Link to post
Share on other sites

Users should consider using Compose instead of Octave - it is very quick and easy to convert Octave *.m files to run in Compose.

Users working with external programs such as Octave in the past parsed the FEKO *.out file for results data. This parsing is no longer necessary. Any data displayed in POSTFEKO can be exported in a user defined format to a file using Lua scripting in POSTFEKO. The export can automatically be repeated after each successful execution of running FEKO. This how-to, by means of a small example and script, shows how to do this. This is not the only (or maybe even the best) way to export the data, but it shows one possible option for exporting results from FEKO.


In the past, to obtain the data in an external file users had to first plot the data in POSTFEKO and then use the export data function. This procedure had to be repeated after each successful FEKO run.

Alternatively, the OUT file was parsed using an external script or program such as Matlab.

Using Lua, it will be shown here that a script can be written in POSTFEKO that automatically writes the data chosen by the user to a file in a format chosen by the user.

Some of the images in this how-to were taken from Suite 6.1. The Lua script provided in the attachment is forwards compatible with Suite 6.2.

Example overview

Consider two dipoles excited with a plane wave. The first dipole has a load attached to its port. The second dipole has a non-radiating network attached to its port and the network is terminated in a load. The plane wave is looped over five angles. The geometry and tree view in CADFEKO is shown below.


The schematic view is shown below. Note that a load is attached to the Network Port2 (not shown in the schematic).



We will show how to export the currents in the loads to a file.

Making and using the script in POSTFEKO

After solving the model, run POSTFEKO. Plot the data that must be exported to a file. The currents in the loads are plotted and shown below.


In POSTFEKO click on the "New Script" icon and select "Load". After writing the script, the script can be accessed again by clicking on "Modify script".


The script text and execution window is shown below. For more details on the scripting syntax, please see the FEKO User Manual.


In this example a filename, "loads.dat" was chosen and is written automatically after each execution of RUNFEKO. To stop automatic execution of the script, uncheck the box, "Automatically run the script with bof file reloading".

A section of the data file is shown below.



Pearl likes this

Share this post

Link to post
Share on other sites
On 10/12/2018 at 10:40 AM, Torben Voigt said:

@JIF, where is that magic "Automatically run the script with bof file reloading" checkbox? 

It is on by default, but the setting is located on the Preferences dialog (see below). It is the checkbox that has been checked and has the description "Reload scripts with bof file reloading".

Screenshot 2018-10-14 10.01.05.png

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...