Where To Find This Example
AWR Version 14
AWR Version 13
Using Marker Values in Output Equations
This project shows some examples of using the marker( , ) function in Output Equations documents.
To see the marker function in action, select Simulate > Analyze. When the simulation is finished, maximize any of the schematics, double-click on the graph with the marker in it to edit, and move the marker.
The marker( , ) function provides access to the values displayed on any marker in any graph, and is automatically re-evaluated when the marker is moved. So moving a marker in a graph will automatically and immediately update all calculations and measurements that depend on it.
The examples in this project are distinct from one another, and are identified by the numerical prefix in the associated document names. This is only to keep the examples simple, not a restriction. The calculations in an Output Equations document can depend on any measurements or markers in the project.
The two arguments in the marker( , ) function are the name of the graph document, and the ID of the marker. The name of the graph document is the one shown in the project browser, or on the title bar of the graph window. This is not always the same as the title shown inside of the graph window, which can be customized. To display marker IDs in the graph (useful when there are multiple markers present), right-click in the graph window > Properties… > Markers tab, and check Data markers in legend.
Relevant notes on working in the AWR design environment (AWRDE):
1. Window-in-window (e.g. the graph and equation windows embedded in the schematics): click once to move or reshape the embedded window, double-click to interact with and edit the contents of the window.
2. Output Equations: to edit an output equation, shown in a teal/green color by default, right click on it and select Properties… Double-clicking leads to manual editing, which can be used to change the name (left side of the equals sign), but editing the measurement this way is error-prone.
This first example is not a practical application, but a simple demonstration. It involves an s21 measurement on the “1_Simple” schematic, which is setup for a one-dimensional frequency sweep. The marker is on the trace in the Smith chart, “1 Simple s21”. So it includes a complex value whose format is determined by the options selected in the Graph Properties > Markers tab of that graph: in this case, dB Magnitude/Angle. Moving the marker in the Smith chart affects the rectangular graphs: it moves the corresponding point in the “1 Simple s21 dB” graph, and renormalizes the measurement in “1 Simple s21 dB Normalized” by that value.
This is accomplished by the equations in the associated “1_Simple” output equations document:
- “mrk” is a vector of the three values shown on the marker.
- “s21dB_mrk” is an x-y point from the marker: s21 in dB vs. frequency. This is plotted on the rectangular graph “1 Simple s21 dB”, where the swept dB|s21| measurement is plotted as well.
- “s21dB” is dB|s21| vs. frequency,
- “s21dBn” is “s21dB” normalized by the value of the marker. It is plotted in the rectangular graph “1 Simple s21 dB Normalized”.
If the marker options on the Smith chart were changed, for example to display Real/Imaginary values, then the equations would have to be re-written to calculate s21 in dB. The two disabled equations make “s21dB_mrk” independent of the marker format:
- “s21dB_int” interpolates “s21dB” at the frequency value from the marker.
- “s21dB_mrk” replaces the previous one by plotting “s21dB_int” vs. the marker frequency.
The schematic “2_IV_to_Sparameters” is set up to sweep the drain and gate bias voltages of a common-source FET. A DC drain current measurement plots the I-V curve in the “2 IV Bias Selector for s22” graph. An s22 measurement in the output equations document “2_IV2SP” calculates s22 vs. frequency at each bias point. Moving the marker on the I-V curves plots s22, measured at the nearest bias point, in the Smith chart “2 s22 Based on IV Marker”. Enable both measurements in the Smith chart to see all of the s22 curves, and watch as moving the marker selects among them.
In the “2_IV2SP” output equations document:
- “IV” is the I-V measurement with Vds as the x-axis variable.*
- “IV2” is the same, but with Vgs as the x-axis variable.*
- “s22_set” is the full set of complex s22 measurements at all biases.**
- “Vds_vector”: is the vector of simulated Vds values
- “Vgs_vector”: is the vector of simulated Vgs values
- “IVBS” (IV Bias Selector), is the vector of values from the marker, the third value of which is the Vgs value of the trace the marker is on.
- “Vgs_index” is the index number of the Vgs value in “IVBS”; it is N, where Vgs is the Nth value in Vgs_vector.
- “n” is the index number of the bias point identified by the marker, in the overall 2-dimensional sweep.**
- “s22” extracts the nth s22 measurement from the full set in “s22_set”.**
* “IV” and “IV2” could specify a single Vgs and Vds value, respectively. They are only used to extract the vectors of Vds and Vgs values using the “swpvals( )” function.
** In a multi-dimensional sweep, the x-axis variable is identified in the measurement setup. For “s22_set”, this is frequency. The s22 measurement values corresponding to these sweep values can be thought of as columns “stacked”, one after the other, for each combination of the additional swept variables. In this case, “s22_set” stacks the s22 (vs. frequency) values as follows:
s22 at final Vgs and final Vds
s22 at final Vgs and first Vds
s22 at second Vgs and final Vds
s22 at second Vgs and first Vds
s22 at first Vgs and final Vds
s22 at first Vgs and second Vds
s22 at first Vgs and first Vds
The order of the swept variables is alphabetical, based on the ID parameter of the SWPVAR block used, with the first variable changing the fastest.
The schematic “3_LP_to_PoPi” is set up to perform a power sweep at each load impedance specified as real/imaginary gamma values in the data file “3_PoPi_Gammas”. The Smith chart “3 Load Pull Contours” plots PAE contours from a load pull data file, as well as the interpolated maximum output power (Pout) and PAE impedances. Pout contour measurement is included in the graph but disabled to reduce clutter. This graph also plots the load gammas at which power sweeps were performed, shown as small circles. Moving the marker “m1”, regardless of which measurement it is associated with, will identify and mark the nearest load gamma simulated, and it will show the corresponding power curve in the rectangular graph “3 Pout vs Pin”. Enable both measurements in “3 Pout vs Pin” to see all of the power curves, and watch as moving the marker selects among them. (Load gamma values are coarsely distributed and restricted to one quadrant in order to speed up simulation, and show how output equations can use the marker on one measurement to find the nearest point on another.)
In the “Global Definitions” document, G reads the contents of “3_LP_Data”, and Gc constructs a vector of complex values from the two columns. In the schematic “3_LP_to_PoPi”, the variable indx is swept as an integer to select each value in Gc, which is used to calculate and set the fundamental gamma values in the load tuner.
In the output equations document “3_LP2PoPi”:
- “Gmrk” gets the marker value
- “Gmrkc” reconstructs a complex number from the individual real and imaginary values
- “Gdelta” measured the difference in magnitude between each value in Gc and Gmrkc.
- “indx” is N, where the Nth value in Gc is closest to Gmrkc.
- “Gcx” is that Nth value in Gc.
- “PoPiA” is the stack of output power values at the fundamental, with input power as the x-axis variable, at each load gamma.
- “PoPi” is the specific power curve for load gamma of “Gcx”.
The schematic “4_Spectrum_and_Time_Domain” is set up to perform a power sweep. The power curve is plotted in the graph "4 Pout vs Pin". Moving the marker in this graph will automatically update the output spectrum and time domain voltage waveform plotted in the aptly named "4 Spectrum" and "4 Time Domain" graphs. This example was included to demonstrate how to work with measurements whose x-axes vary with a swept parameter. Such measurements store the x-axis and y-axis (measurement) values in alternating columns of the data.
In the output equations document “4_Spec_TD”:
- “Po” is the Pout vs. Pin measurements at the frequency selected by the tuner
- "Spectra" is the spectrum measurement at the same frequency
- "Vouts" is the voltage waveform
- "Pi" is the input power sweep values from Po
- "M_P" gets the marker value
- "Pindx" is the index of the Pi value closest to the marker's x-value from M_P
- "Spectrum" plots the y and x values from Spectra that correspond to Pindx against one another
- "Voltage" plots the y and x values from Vouts that correspond to Pindx against one another