Photonics

Photonics

Topics related to Lumerical and more.

arguments of – are not the same type or of an invalid type

    • minusunny
      Subscriber
      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?
    • 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

Viewing 1 reply thread
  • The topic ‘arguments of – are not the same type or of an invalid type’ is closed to new replies.