Home Forums SYSTEM Matlab Co-Simulation

Viewing 2 reply threads
  • Author
    Posts
    • #15156
      Abdallah Ismail
      Participant

      When I used Matlab Component to get spatial mode to matlab workspace.
      I found in “Inputport1.Sampled(1,1).Spatial.ModeX.Amplitude” a matrix 100X100 that represent the mode profile function.
      I plotted this matrix in Matlab and found it meets the designated mode.
      I need to Know how this matrix constructed? i.e F(x,y) is the matrix values ,what is the value of x and y for each element in the matrix.
      Regards,

    • #15268
      Damian Marek
      Participant

      Hi Abdallah,

      To save memory only the number of x and y points are saved (size of field array) and the delta x and delta y are saved. From these values you can calculate the vectors x and y.

      In the attached Matlab code I perform this operation and below is an excerpt of how you could program it.

      xvector = linspace(-dx*0.5*size(Ef,2),dx*0.5*size(Ef,2), size(Ef,2));
      yvector = linspace(-dy*0.5*size(Ef,1),dy*0.5*size(Ef,1), size(Ef,1));

    • #15587
      Abdallah Ismail
      Participant

      Thanks Damian,
      I get it but i think your method to calculate Aeff for the fundamental mode will not work for the other modes because they are complex number values.I’ll need to take the absolute of the mode profile matrix.
      Regards,
      Abdallah

      • #15588
        Damian Marek
        Participant

        You are absolutely correct! You will need to include a conjugate term in the integrals for a complex field.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.