Example 4: Command-Line Interface

The multiport application macro supports calculation from the command-line by calling the application macro via POSTFEKO.

The first example shows how to use a Feko model with the interface. The second example uses a Touchstone file as input.

A pre-configured Lua settings file is used from Example 1: Feko Model as Input. The settings file contains a processingOptions table which is used to set up the settings required for a multiport run from the command-line. Both examples use the same Lua settings file. The Lua settings file is configured to export the scaling coefficients to file which can be used in other post-processing applications.
Note: The settings file can be automatically generated by using the Save settings to file (*.lua) check box on the Processing options dialog from the GUI.
local processingOptions={
  ["deembedToAntenna"] = "false",
  ["referenceImpedance"] = "50",
  ["storeDataSets"] = "true",
  ["includeSourceReferenceImpedance"] = "false",
  ["mergeWithExistingStoredData"] = "false",
  ["calculateScaledRequests"] = "false",
  ["containsCurrentSource"] = "false",
  ["exportDataSets"] = "false",
  ["prefix"] = "",
  ["storeAdditionalData"] = "false",
  ["exportScallingCoefficients"] = "true",
  ["idealSource"] = "true",
  ["printSummary"] = "true",
  ["validateModel"] = "false"
}
local sourceConfiguration={
  [1] = {
    ["Value"] = "1 + 0i",
    ["Index"] = 1,
    ["Label"] = "Port_1"
  },
  [2] = {
    ["Value"] = "2 + 0i",
    ["Index"] = 2,
    ["Label"] = "Port_2"
  },
  ["Load"] = {
    ["Data"] = {
      [1] = {
        ["Label"] = "Port_1",
        ["Type"] = 1
      },
      [2] = {
        ["Label"] = "Port_2",
        ["Type"] = 1
      }
    }
  }
}
local loadConfiguration={
  ["Data"] = {
    [1] = {
      ["Value"] = "25 + 30i",
      ["Type"] = "Complex",
      ["Index"] = 3,
      ["Label"] = "Port_3"
    },
    [2] = {
      ["Value"] = "75 + 0i",
      ["Type"] = "Complex",
      ["Index"] = 4,
      ["Label"] = "Port_4"
    }
  },
  ["Type"] = "Individual"
}
return{sourceConfiguration,loadConfiguration,{},processingOptions}