-
-
January 9, 2024 at 1:28 amminusunnySubscriber
CMRR,Insertion loss, Imbalance, phase deviation T1 = getresult("FDTD::ports::Out1","T"); lambda1 = T1.lambda; T2 = getresult("FDTD::ports::Out2","T"); lambda2 = T2.lambda; T3 = getresult("FDTD::ports::Out3","T"); lambda3 = T3.lambda; T4 = getresult("FDTD::ports::Out4","T"); lambda4 = T4.lambda; I = -20*log10(abs(T1-T4)/abs(T1+T4)); Q = -20*log10(abs(T2-T3)/abs(T2+T3));
When i try to run this code i am getting error ' arguments of - are not the same type or of an invalid type' at the last two lines.May i know the reason why? -
January 10, 2024 at 8:44 amAfroditi PetropoulouAnsys Employee
Dear Minu,
Thank you for contacting us!
The reason you get this error is because when you use the
getresult("FDTD::ports::Out1","T");
script command, the obtained T1, T2, T3 and T4 are matrix datasets and you cannot do calculations with datasets, only with matrices. When you run the script you can see that in the Script Workspace as shown below:
If you want to calculate I and Q you need to get the transmission matrices from these datasets, the same way you got the lambda matrices:
T1_result = T1.T;
T2_result = T2.T; .... and so on.
Then you can calculate I and Q as:
I = -20*log10(abs(T1_result-T4_result)/abs(T1_result+T4_result));
Q = -20*log10(abs(T2_result-T3_result)/abs(T2_result+T3_result));
Best Regards,
Afroditi
-
Viewing 1 reply thread
- The topic ‘arguments of – are not the same type or of an invalid type’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- Import material .txt file with script
- Trapezoidal ring
- Help for qINTERCONNECT
- Absorption cross-section of AuNR excited by prism-based TIR
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
- Edge Coupler EME Example Issue
Top Contributors
-
1882
-
802
-
599
-
591
-
366
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.