3D B field map

Moderators: cyao, michael_borland

Jerbe
Posts: 7
Joined: 14 Jun 2016, 09:00

Re: 3D B field map

Post by Jerbe » 01 Jul 2016, 06:29

Hi Michael,

I tried to get rid of all errors by using your quad-test example and carefully recalculating my ftable ;)

It now produces results which look as expected. See the attached plot. Ideal is an ftable file of an ideal plasma lens and MHD is a nonlinear plasma lens. Some particles don't het the field (it's only 0.5mm square). Thank you for your help and quick replies!

Cheers,
Jan
Attachments
Ideal-vs-MHD1.png

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

Re: 3D B field map

Post by michael_borland » 01 Jul 2016, 08:54

Jan,

Glad to hear that it is working. In the next release (which I hope to get out next week), there will be some improvements in FTABLE and other elements that should make this sort of thing easier.

--Michael

Jerbe
Posts: 7
Joined: 14 Jun 2016, 09:00

Re: 3D B field map

Post by Jerbe » 08 Jul 2016, 06:21

Hi Michael,

I installed 30.0.0 and saw the changes to FTABLE. It says it's the same format as BMXYZ but I couldn't find a forum entry or example case for that. Did I miss it? I think it would help me alot to see the formatting in an example.

Best,
Jan

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

Re: 3D B field map

Post by michael_borland » 08 Jul 2016, 11:29

Jan,

Here's an example.

--Michael
Attachments
FTABLE-BMXYZ.zip
(24.53 MiB) Downloaded 295 times

Jerbe
Posts: 7
Joined: 14 Jun 2016, 09:00

Re: 3D B field map

Post by Jerbe » 28 Jul 2016, 08:10

Hi Micheal,

thanks again for the help. I used FTABLE with the old input some more and simulated passage through a radially symmetric field. The field is 15mm long (z), and 250µm by 250µm (x and y). It gives the expected results except for a kick at the end of the lens. I plotted s1 over s from my .sig file and saw this. Then i plotted with a scatter plot and saw what's in my attached BeamSize plot. So the FTABLE element seems to have no division. I have KICKS = 400 and element_division = 32. How can I divide the field? Or is this some artefact of the definition of s since it is the distance travelled by individual particles?

Many thanks again and kind regards,
Jan
Attachments
Example.ele
(1 KiB) Downloaded 239 times
Example.lte
(592 Bytes) Downloaded 231 times
BeamSize.png
s1 versus s for FTABLE FACTOR = 1 and 0.

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

Re: 3D B field map

Post by michael_borland » 28 Jul 2016, 10:34

Jan,

Unfortunately, FTABLE elements can be readily divided. You'd have to divide the field file and make many elements.

I'll think about how this might be included as a program feature, but it won't be straightforward.

--Michael

Jerbe
Posts: 7
Joined: 14 Jun 2016, 09:00

Re: 3D B field map

Post by Jerbe » 29 Jul 2016, 03:12

Hi Michael,

I'll just divide the field file since it doesn't vary with z over the most part. That's easy. I just thought i did something wrong. By the way is there any way to input a functional field? It has a very easy formula since it is radially symmetric and it would make things much easier. I've got my script working but maybe for other users that want to do similar things.

Cheers,
Jan

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

Re: 3D B field map

Post by michael_borland » 29 Jul 2016, 07:58

Jan,

There's no way to input a field in functional form, but it is a good suggestion. We'll try to have it in the next release.

--Michael

Hwang, Ji-Gwang
Posts: 40
Joined: 21 Jan 2010, 02:27

Re: 3D B field map

Post by Hwang, Ji-Gwang » 31 Mar 2017, 11:12

Hello, Michael

I tried to use the FTable for tracking simulation of the specific elements.
The FTable input is made following the instruction and checked the field map file by "sddsprint". It looks fine.
But it gives error message such as "error: L+L1+L2 != field length in file %s." even I don't assign the length of the elements.
Could you explain what causes this problem? or how to make the field input file for FTable?

Best regards

Ji-Gwang
Attachments
test_FTable.zip
(17.59 MiB) Downloaded 267 times

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

Re: 3D B field map

Post by michael_borland » 31 Mar 2017, 15:17

Ji-Gwang,

FTABLE requires that you provide a value for L. L1 and L2 are optional. The quantity L+L1+L2 must accurately agree with the span of z given in the file

Code: Select all

$ sddsprocess ftable.ftable -pipe=out -process=z,spread,%sSpread | sdds2stream -pipe -param=zSpread
2.299999952316284e+00
Using this, I modified your lattice file as follows

Code: Select all

RW: ftable,l=2.299999952316284e+00, input_file="ftable.ftable", simple_input=1, FACTOR = 1, N_KICKS = 4000
test: line = (RW)
This runs successfully. Note that I increased the N_KICKS value to get convergence.

You may also try the BMXYZ element, which uses a more conventional integration technique:

Code: Select all

RW: bmxyz,l=2.299999952316284e+00, filename="ftable.ftable", strength = 1, accuracy=1e-12, method = "bulirsch-stoer"
test: line = (RW)
--Michael

Post Reply