# GENESYS equation capability can interpolate among data files

Question asked by JERRY_MARKETOS on Jun 29, 2004
Latest reply on Jun 29, 2004 by JERRY_MARKETOS
GENESYS built in equation capability can interpolate among data files

(This post is long and may be cut off;  remainder will be posted in reply)

You can set up a Genesys simulation that will interpolate the value for a chosen
parameter from among a group of data files.  For example, let's consider the
hypothetical situation where we have a Voltage controlled attenuator.  We could
set the attenuator up on a test bench and capture S-parameter data for the
unit while it was set to 1dB loss, 2dB loss, 3dB loss, 4dB loss etc.  We could
then set up a Genesys model which asked for Voltage in, then produced resulting
S-parameters by interpolating among the appropriate pairs of data files.  We're not
limited to using two data files; many more can be used, and the example shown
here utilizes 3 data files.

For simplicity, the example file shown here uses a V/dB function of one Volt = 1dB loss.
This is arbitrary and any transfer function desired... can be written into the equations.

Below, I will paste the equations section from the wsp and also the notes section.
Be sure to read the notes section for cautions on interpolation of insufficient data density
and / or data formats that do / don't lend themselves well to linear interpolation.

=================================================================
Equations section
=================================================================
! Valid range for V input is 1<V<=3, although with the sample data files
! used here, Genesys can reasonably extrapolate well outside the data range.
V=?1.7395
IF (V>=1 & V<2) THEN GOTO INTERPOL1_2
IF (V>=2 & V<=3) THEN GOTO INTERPOL2_3
LABEL INTERPOL1_2
EQS11=(DATAFILEIMPORT2.DATA.DB[S11]-DATAFILEIMPORT1.DATA.DB[S11])*(V-1)+DATAFILEIMPORT1.DATA.DB[S11]
EQS21=(DATAFILEIMPORT2.DATA.DB[S21]-DATAFILEIMPORT1.DATA.DB[S21])*(V-1)+DATAFILEIMPORT1.DATA.DB[S21]
EQS12=(DATAFILEIMPORT2.DATA.DB[S12]-DATAFILEIMPORT1.DATA.DB[S12])*(V-1)+DATAFILEIMPORT1.DATA.DB[S12]
EQS22=(DATAFILEIMPORT2.DATA.DB[S22]-DATAFILEIMPORT1.DATA.DB[S22])*(V-1)+DATAFILEIMPORT1.DATA.DB[S22]
GOTO END
LABEL INTERPOL2_3
EQS11=(DATAFILEIMPORT3.DATA.DB[S11]-DATAFILEIMPORT2.DATA.DB[S11])*(V-2)+DATAFILEIMPORT2.DATA.DB[S11]
EQS21=(DATAFILEIMPORT3.DATA.DB[S21]-DATAFILEIMPORT2.DATA.DB[S21])*(V-2)+DATAFILEIMPORT2.DATA.DB[S21]
EQS12=(DATAFILEIMPORT3.DATA.DB[S12]-DATAFILEIMPORT2.DATA.DB[S12])*(V-2)+DATAFILEIMPORT2.DATA.DB[S12]
EQS22=(DATAFILEIMPORT3.DATA.DB[S22]-DATAFILEIMPORT2.DATA.DB[S22])*(V-2)+DATAFILEIMPORT2.DATA.DB[S22]
LABEL END

=================================================================
Notes section
=================================================================
This workspace displays 3 sample data files:
Brown trace = Datafileimport1, which is S21 of a 1dB attenuator
Red trace = Datafileimport2, which is S21 of a 2dB attenuator
Orange trace = Datafileimport3, which is S21 of a 3dB attenuator

Blue trace is gotten from equations EQS21, which is interpolated S21.
Note from inspecting the equations that interpolation isn't limited among only two data files-
rather, this setup determines which pair of data files to interpolate from as a function of the input variable.
This is extendable to any number of data files.

The most apparent application for the setup described here might be to first acquire data (S-parameter snapshots)
for a given device with a chosen variable adjusted in predetermined increments, then assemble the device data and end up
with a model that will accept a large range of input values for the chosen variable, interpolating among the device data
to produce its output.  To aid in ease of understanding of this setup, the device data files used here represent simple
resistive attenuators- their S21 and S12 are identical with zero phase change, and their input and output return losses
were manually chosen to be -50dB, also with zero phase change.  Please note!  Depending on the nature of actual device
data files used, and the amount of change of the chosen variable between

[file]atten_3db.txt[/file]
[file]atten_2db.txt[/file]
[file]atten_1db.txt[/file]
[file]datafile_interpolation_v403_jm2.wsp[/file]