¿ªÔÆÌåÓý

Re: plot window


 

¿ªÔÆÌåÓý

On 27/02/2025 16:10, alan victor via groups.io wrote:
Yes, I tried. All I get are selections on GD and phase.
Only for Bode. If you choose the Cartesian format, you can get imaginary. what other options do you want?
?
For example, in using the s parameter script it would be nice to plot transmission gain s21 and SWR (for which I have a simple
expression) on left and right axis of a single plot pane. Are there more plot options if I rev up from LTspice XVII?
S-parameters of 1 and 2 port networks are automatically available as plot options if you use the .NET directive with .AC analyses. This then gives you the options: Sxx, Yxx, Zxx, Zin & Zout.

See: Help > LTspice > LTspice? > Dot Commands > .NET ¡ª Compute Network Parameters in a .AC Analysis

For SWR and other formats like Gmax and MSG, I have defined plot functions, which are stored in the plot.defs file. Hardly anyone actually uses plot.defs, but it's very useful once you get used to it.

E.g.:

* Functions for RF design using S-parameters with 2 port networks
* Note: due to the way LTspice displays functions (as voltages), MSG & Gmax are exported as square roots since they are powers to start with
.func mS11() {mag(S11(V1))}
.func mS21() {mag(S21(V1))}
.func mS12() {mag(S12(V1))}
.func mS22() {mag(S22(V1))}
.func DeltaInt() {S11(V1)*S22(V1)-S12(V1)*S21(V1)}
.func MSGInt() {ms21()/ms12()}
.func KR() {(1-ms11()**2-ms22()**2+mag(DeltaInt())**2)/2/mag(S21(V1)*S12(V1))}
.func GmaxInt() {1/(Kr()+sqrt(Kr()**2-1))*MSGInt()}
.func MSG() {sqrt(MSGInt())}
.func Gmax() {sqrt(GmaxInt())}
.func VSWR(Sxx) {(1+mag(Sxx))/(1-mag(Sxx))}

(Functions including "Int" are not for plotting, they are intermediate functions.

Note: if you edit plot.defs (Plot Settings > Edit Plot Defs file), the changes don't become active until LTspice is closed and re-started.

--
Regards,
Tony

Join [email protected] to automatically receive all group messages.