Electronics

Electronics

Topics related to HFSS, Maxwell, SIwave, Icepak, Electronics Enterprise and more

Find the magnitude and phase of the Sources using pyaedt

TAGGED: ,

    • tomas.monopoli
      Subscriber

      Hi all, 

      I have an HFSS design and use pyaedt to automate many tasks. 

      I am not able to obtain the list of source magnitudes and phases. Indeed, I am able to edit the sources with the following: 

      solution_module = hfss.get_module("Solutions")
          for M, d_name in zip(moments, dipole_names):
              print(f"{np.real(M)}Vm + {np.imag(M)}i Vm")
              print(d_name)
              solution_module.EditSources(
                  [
                      "FieldType:="       , "TotalFields",
                      "IncludePortPostProcessing:=", False,
                      "SpecifySystemPower:="  , False
                  ])
             
              magnitude = np.abs(M)
              phase = np.angle(M, deg=True)
             
              solution_module.EditSources(
                  [
                      "Name:="        , d_name,
                      "Magnitude:="       , f"{magnitude}{units}",
                      "Phase:="       , f"{phase}deg"
                  ]
              )
       
      However, if I use the same module to try and find the sources, i.e solution_module.GetAllSourceMagnitudes() or solution_module.GetAllSourcePhases(), I get a list of 1s and 0s. While the real magnitudes and phases are different. In my particular example here is the list: 
      I hope someone can help.
      Thank you. 
      Tomas
    • dedgar
      Ansys Employee

      HI Tomas,

       

      I would recommend to post this question as an issue on the pyaedt github site where the pyaedt team can see it.

       

      regards

      dave

Viewing 1 reply thread
  • The topic ‘Find the magnitude and phase of the Sources using pyaedt’ is closed to new replies.