Skip to content

Display/Save currents #61

Closed
Closed

Description

@g4ixt

xnec2c v4.4.16 on Kubuntu 24.04. 14MHz folded dipole, centre excited with 77V (P=20W) set with Z0 = 300 Ohm, resonant on 14.239MHz

When I run the model and select "view currents," the graduated colour scale is missing (bug?) but at the resonant frequency it shows the max current as 2.59E-1 Amps on screen. Plugging this back into the usual formula with P gives R of 298 Ohms as expected.

When I select a frequency of 14.239MHz in the "view currents" window and then File > save currents/charges as CSV, I have a file with the correct frequency in column A but for no tag/segment do I see a current of 2.59E-1 Amps, they are all very much smaller.

I may very well be misunderstanding or doing something wrong. Files attached. Any advice?

Ian G4IXT

(Supplementary Question: What units are "charges" in and is there any way to relate them to Voltage on the wire?)
g4ixt_folded_v8_14MHz.tar.gz

Activity

  1. KJ7LNW commented on Dec 28, 2024

    @KJ7LNW
    Owner

    When I run the model and select "view currents," the graduated colour scale is missing (bug?)

    that is strange the color scale works on my screen, so maybe it is a distribution issue? but let's get to the math problem:

    but at the resonant frequency it shows the max current as 2.59E-1 Amps on screen. Plugging this back into the usual formula with P gives R of 298 Ohms as expected.
    ...
    have a file with the correct frequency in column A but for no tag/segment do I see a current of 2.59E-1 Amps, they are all very much smaller.

    In Draw_Wire_Segments(), when displaying currents, the code shows:

    if( isFlagSet(DRAW_CURRENTS) )
      snprintf( label, s, "%8.2E", cmax * (double)data.wlam );

    The displayed current is scaled by wavelength (data.wlam), but in Save_Currents_CSV() the raw current values are saved without this scaling.

    So, cabs(real+imag*i)*lambda will probably yield 2.59E-1 for some tag/seg?

    Can you confirm that that works for you in the spreadsheet?

    If this looks right to you then I will update the function to include a magnitude column scaled by wavelength, but I have another question, too:

    Do you believe that the complex and real value should also be scaled by wave length when writing to the CSV? I am not so familiar with the math here (as I am just the maintainer), so your help would be appreciated.

    @neoklis, can you comment on this?

  2. KJ7LNW commented on Dec 28, 2024

    @KJ7LNW
    Owner

    (FYI, CSV current/charge save feature was added in 0018d01 for #34)

  3. KJ7LNW commented on Dec 28, 2024

    @KJ7LNW
    Owner

    see attached does this look correct?

    g4ixt_folded_v8_14MHz-currents2.csv

  4. KJ7LNW commented on Dec 29, 2024

    @KJ7LNW
    Owner

    I believe this is complete and solved, but reopen the issue if the problem persists.

  5. KJ7LNW commented on Dec 29, 2024

    @KJ7LNW
    Owner

    and I forgot to mention, if you build this from git then you will have the latest version that contains the fix:

    optional:

    • apt remove xnec2c
    • make install
    • make desktop-install # Optional: for icons and file association.
    • xnec2c # installed from git
  6. neoklis commented on Dec 29, 2024

    @neoklis
    Contributor
  7. KJ7LNW commented on Dec 29, 2024

    @KJ7LNW
    Owner

    Awesome, thanks! See 01c9bef for the diff. This fixed both current and charge scaling and added magnitude columns.

  8. g4ixt commented on Dec 29, 2024

    @g4ixt
    Author

    see attached does this look correct?

    g4ixt_folded_v8_14MHz-currents2.csv

    Yes, that looks correct, thank you.

    Ian

  9. g4ixt commented on Dec 29, 2024

    @g4ixt
    Author

    When I run the model and select "view currents," the graduated colour scale is missing (bug?)
    that is strange the color scale works on my screen, so maybe it is a distribution issue?

    It turns out to be a window size issue. Since it worked ok for you I thought to try changing the window size (I had 3 windows 'docked' on my widescreen monitor). As soon as I changed the size, the graduated colour scale appeared.

  10. added a commit that references this issue on Jan 16, 2025
    01c9bef
  11. added a commit that references this issue on Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions