Page 1 of 1

Adjusting drift lenghts

Posted: Wed 1 Mar 2023 14:18
by FrancescoS
Good day,

I know my next question can be stupid, but I am kind of struggling with that.

Let's assume I have 2 meter space between the source (beginning of TW simulation) and a magnet, let's say a dipole.
In this two meter space I want to put two magnets (quads, solenoids...) so that I have a sequence of element like:
Drift1 - Magnet1 - Drift2 - Magnet2 - Drift3 - Dipole
I can adjsut the lenght of each drift the way I want, the only constraint is that the dipole must stay at 2 meters.

Now, the question is: USing the adjust/diagnostics commands, how can I adjust the drift in order to have a fixed lenght of the first section?
I have very blurry memories about a discussion with Didier on this topic, but I can remeber more than this.

Would it be possible to do the same using the mathing commands?

thanks in advance
Francesco

Re: Adjusting drift lenghts

Posted: Thu 2 Mar 2023 09:38
by Didier
Dear Francesco,

Code: Select all

DRIFT 0 100
ADJUST 1 1 1
drift 200 10
QUAD 100 1 100
drift 200 10
QUAD 100 -1 100
ADJUST 1 1 -1
drift 200 10
In this exemple, 2 drifts are linked (thrid parameter of ADJUST=1 & -1) in order to keep total length const (See manual about ADJUST).
Now with 3 drifts as your request, I don't see how do that.

Regards,

Didier

Re: Adjusting drift lenghts

Posted: Thu 2 Mar 2023 09:51
by FrancescoS
Thanks Didier,

I see, it's not straight forward to do that.
maybe splitting the 3rd drift in two might help, I will figure it out and make some test

Cheers
F.