Ansys Learning Forum Forums Discuss Simulation Photonics arguments of – are not the same type or of an invalid type Reply To: arguments of – are not the same type or of an invalid type

Afroditi Petropoulou
Ansys 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