Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. Exporting in .mat file of Electric field

Exporting in .mat file of Electric field

Scheduled Pinned Locked Moved Solved Python API
3 Posts 2 Posters 679 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rediponi
    wrote on last edited by
    #1

    My aim is to export the Electric field of my simulation in a .mat file.
    I am using the following code:

    inputs = [em_sensor_extractor.Outputs["EM E(x,y,z,f0)"]]
    matlab_exporter_2 = analysis.exporters.MatlabExporter(inputs=inputs)
    matlab_exporter_2.FileName = u" export file name "
    matlab_exporter_2.UpdateAttributes()
    matlab_exporter_2.Update()
    document.AllAlgorithms.Add(matlab_exporter_2)

    I obtain Axis0,1,2 and Snapshot0 matrix with Nx3 dimensions as output

    Does each of the Snapshot0 dimension contain the complex value of Ex,Ey,Ez ?

    When i plot them in matlab and Sim4Life i do not observe the same magnitudes.
    Is there any point that i am missing ?

    1 Reply Last reply
    0
    • SylvainS Offline
      SylvainS Offline
      Sylvain
      ZMT
      wrote on last edited by
      #2

      Yes, Snapshot0 contains complex values.

      Are the magnitudes different by a factor of sqrt(2) ? If so, perhaps you are mixing up absolute magnitude values with RMS values?
      If it is instead the pattern that is different (e.g. when you plot a 2D slice of the data), it is possible that you are not "reshaping" the data properly. Can you provide more information on what you are doing and what you are seeing? (you can copy/paste screenshot onto the forum posts, I think)

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rediponi
        wrote on last edited by
        #3

        I found the mistake. There was one pixel shift in the lines that i was comparing. The rest was correct.

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Search