Page 2 of 3

Re: 3D B field map

Posted: 01 Jul 2016, 06:29
by Jerbe
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

Re: 3D B field map

Posted: 01 Jul 2016, 08:54
by michael_borland
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

Re: 3D B field map

Posted: 08 Jul 2016, 06:21
by Jerbe
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

Re: 3D B field map

Posted: 08 Jul 2016, 11:29
by michael_borland
Jan,

Here's an example.

--Michael

Re: 3D B field map

Posted: 28 Jul 2016, 08:10
by Jerbe
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

Re: 3D B field map

Posted: 28 Jul 2016, 10:34
by michael_borland
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

Re: 3D B field map

Posted: 29 Jul 2016, 03:12
by Jerbe
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

Re: 3D B field map

Posted: 29 Jul 2016, 07:58
by michael_borland
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

Re: 3D B field map

Posted: 31 Mar 2017, 11:12
by Hwang, Ji-Gwang
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

Re: 3D B field map

Posted: 31 Mar 2017, 15:17
by michael_borland
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