ZLONGIT reads in impedance file wrong

Moderators: cyao, michael_borland

Post Reply
Teresia
Posts: 30
Joined: 04 Oct 2018, 08:42

ZLONGIT reads in impedance file wrong

Post by Teresia » 28 Apr 2021, 05:11

Hi,

I have a problem with the <filename>=<x>+<y> format when using the ZLONGIT element. I have a SDDS file with three columns, Freq, RealZ and ImagZ corresponding to the frequency, real and imaginary part of an impedance. Even if I specify that that ZREAL and ZIMAG should use different columns it seems they read in the same. The only way I have managed to get it to read in different columns is by separating the real and imaginary part into two different SDDS files.

I discovered it since I could only get the wake and impedance simulations to agree for cases where the real and imaginary impedance is the same. Also, I only got the "error: impedance spectrum has non-zero imaginary DC term (ZLONGIT)" depending on the DC term of the real part, indicating that the real impedance is read in also for the imaginary part.

Am I doing something wrong or is this a bug?

I have attached some files where I get the problem and also the only way I have found to get around it.

Best regards,

Teresia
Attachments
zlongit-files.zip
(6.85 MiB) Downloaded 293 times

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: ZLONGIT reads in impedance file wrong

Post by michael_borland » 14 May 2021, 10:44

Teresia,

The problem is that the quotation marks need to be escaped in the insert_elements command. Instead of

Code: Select all

&insert_elements
        name = impedance,
        element_def = "lon_rw_impedance: zlongit,zreal="impedance_elegant.sdds"="Freq"+"RealZ",zimag="impedance_elegant.sdds"="Freq"+"Im
agZ",interpolate=1,bunched_beam_mode=1"
&end
you should use

Code: Select all

&insert_elements
        name = impedance,
        element_def = "lon_rw_impedance: zlongit,zreal=\"impedance_elegant.sdds=Freq+RealZ\",zimag=\"impedance_elegant.sdds=Freq+ImagZ\"
,interpolate=1,bunched_beam_mode=1"
&end
The \" sequence allows putting a quotation mark inside a quoted string.

--Michael

Teresia
Posts: 30
Joined: 04 Oct 2018, 08:42

Re: ZLONGIT reads in impedance file wrong

Post by Teresia » 21 May 2021, 07:06

Ah! Thank you. I wasn't aware of this. I will try that.

Best regards,

Teresia

Post Reply