ExcitationData

Excitation results generated by the Feko Solver.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

    -- Retrieve the 'ExcitationData' called 'VoltageSource'

excitationData = app.Models[1].Configurations[1].Excitations["VoltageSource"]

    -- Manipulate the excitation data. See 'DataSet' for faster and more comprehensive options
    
dataSet = excitationData:GetDataSet(51)
print(dataSet) -- Describes the structure of the data
inspect(dataSet) -- Gives a list of the data set contents

    -- Find the frequency start and end values

frequencyAxis = dataSet.Axes["Frequency"]
frequencyStartValue = frequencyAxis:ValueAt(1)
frequencyEndValue = frequencyAxis:ValueAt(#frequencyAxis)

    -- Scale the power values

scale = 2
for freqIndex = 1, #dataSet.Axes["Frequency"] do
    indexedValue = dataSet[freqIndex]
    indexedValue.Power = indexedValue.Power * scale
end

    -- Store the manipulated data 
    
scaledExcitation = dataSet:StoreData(pf.Enums.StoredDataTypeEnum.Source)

    -- Compare the original excitation to the manipulated excitation
    
graph = app.CartesianGraphs:Add()
excitationTrace1 = graph.Traces:Add(excitationData)
excitationTrace1.Quantity.Type = pf.Enums.ImpedanceQuantityTypeEnum.SourcePower
excitationTrace2 = graph.Traces:Add(scaledExcitation)
excitationTrace2.Quantity.Type = pf.Enums.ImpedanceQuantityTypeEnum.SourcePower

Inheritance

The ExcitationData object is derived from the ResultData object.

The following objects are derived (specialisations) from the ExcitationData object:

Usage locations

The ExcitationData object can be accessed from the following locations:

Property List

Configuration
The result data's solution configuration in the model. (Read only SolutionConfiguration)
Label
The object label. (Read/Write string)

Method List

ExportData (filename string, frequencyunit FrequencyUnitEnum, networkparametertype NetworkParameterTypeEnum, networkparameterformat NetworkParameterFormatEnum, referenceimpedance number, samples number)
Export the result S-parameter data to the specified Touchstone file.
ExportData (filename string, frequencyunit FrequencyUnitEnum, networkparametertype NetworkParameterTypeEnum, networkparameterformat NetworkParameterFormatEnum, samples number)
Export the result S-parameter data to the specified Touchstone file.
StoreData ()
Creates a local stored version of the result data. (Returns a ResultData object.)

Property Details

Configuration
The result data's solution configuration in the model.
Type
SolutionConfiguration
Access
Read only
Label
The object label.
Type
string
Access
Read/Write

Method Details

ExportData (filename string, frequencyunit FrequencyUnitEnum, networkparametertype NetworkParameterTypeEnum, networkparameterformat NetworkParameterFormatEnum, referenceimpedance number, samples number)
Export the result S-parameter data to the specified Touchstone file.
Input Parameters
filename(string)
The name of the exported data file without its extension.
frequencyunit(FrequencyUnitEnum)
The frequency unit specified by the FrequencyUnitEnum, e.g. Hz, kHz, GHz, etc.
networkparametertype(NetworkParameterTypeEnum)
The network parameter type specified by the NetworkParameterTypeEnum, e.g. Scattering, Admittance or Impedance.
networkparameterformat(NetworkParameterFormatEnum)
The network parameter format specified by the NetworkParameterFormatEnum, e.g. DB, MA or RI.
referenceimpedance(number)
Specify the reference impedance.
samples(number)
The number of samples for continuous data. This value will be ignored if the data is discrete.
Example
-- Retrieve the current application and store it in a member
app = pf.GetApplication()
-- Close the current project
app:NewProject()
-- Add the startup.fek model
app:OpenFile(FEKO_HOME..[[/shared/Resources/startup_model/startup.fek]])
-- Add two Cartesian graphs to compare the results
app.Views[1]:Close()
graph = app.CartesianGraphs:Add()
graph2 = app.CartesianGraphs:Add()

-- Get the excitation result from the collection of source results of
-- the solution configuration
excitation = app.Models[1].Configurations[1].Excitations[1]

local fileName = "temp_excitation"
-- Export the excitation data to the current working directory
excitation:ExportData(
    fileName,                          -- The name of the Touchstone file that will be generated
    pf.Enums.FrequencyUnitEnum.Hz,     -- The frequency unit the data will be exported in
    pf.Enums.NetworkParameterTypeEnum.Scattering , -- The network parameter type
    pf.Enums.NetworkParameterFormatEnum.MA,        -- The network format
    50,                                -- The reference impedance
    51)                                -- The number of samples for continuous data. 
                                       -- This value will be ignored if the data is discrete.
-- Import the excitation results from the specified Touchstone (*.s1p) file
importSet = app:ImportResults(fileName..".s1p",pf.Enums.ImportFileTypeEnum.Touchstone)

-- Compare the excitation on the Cartesian graphs, they should look the same
graph.Traces:Add(excitation)
graph2.Traces:Add(importSet.ImportedData[1])
app:TileWindows()
ExportData (filename string, frequencyunit FrequencyUnitEnum, networkparametertype NetworkParameterTypeEnum, networkparameterformat NetworkParameterFormatEnum, samples number)
Export the result S-parameter data to the specified Touchstone file.
Input Parameters
filename(string)
The name of the exported data file without its extension.
frequencyunit(FrequencyUnitEnum)
The frequency unit specified by the FrequencyUnitEnum, e.g. Hz, kHz, GHz, etc.
networkparametertype(NetworkParameterTypeEnum)
The network parameter type specified by the NetworkParameterTypeEnum, e.g. Scattering, Admittance or Impedance.
networkparameterformat(NetworkParameterFormatEnum)
The network parameter format specified by the NetworkParameterFormatEnum, e.g. DB, MA or RI.
samples(number)
The number of samples for continuous data. This value will be ignored if the data is discrete.
StoreData ()
Creates a local stored version of the result data.
Return
ResultData
The new stored data.