problem when optimizing phase advance
Moderators: cyao, michael_borland
problem when optimizing phase advance
Hi All,
I'm tying to optimize the phase advance between two points in a straight section, when I use psix & psiy in the optimization term command elegant gives me the following error message
unknown token: psix
unknown token: psiy
It does not recognize them?, Is it a bug, or am I using the wrong parameter names
Here are my command line
&optimization_term term = psix 0.96 0.001 sene weight = 1 &end
&optimization_term term = psiy 1.03 0.001 sene weight = 1 &end
Thanks in advance
I'm tying to optimize the phase advance between two points in a straight section, when I use psix & psiy in the optimization term command elegant gives me the following error message
unknown token: psix
unknown token: psiy
It does not recognize them?, Is it a bug, or am I using the wrong parameter names
Here are my command line
&optimization_term term = psix 0.96 0.001 sene weight = 1 &end
&optimization_term term = psiy 1.03 0.001 sene weight = 1 &end
Thanks in advance
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: problem when optimizing phase advance
Hisham,
Have you given a twiss_output command to ensure that elegant is computing twiss parameters?
Also, be sure to quote your optimization expression, e.g.,
&optimization_term term = "psix 0.96 0.001 sene" weight = 1 &end
--Michael
Have you given a twiss_output command to ensure that elegant is computing twiss parameters?
Also, be sure to quote your optimization expression, e.g.,
&optimization_term term = "psix 0.96 0.001 sene" weight = 1 &end
--Michael
Re: problem when optimizing phase advance
Hi Michael,
Yes I did have a twiss command, quoting the optimization equation does not help.
I have attached my files for reference. Thank you
-- Hisham
Yes I did have a twiss command, quoting the optimization equation does not help.
I have attached my files for reference. Thank you
-- Hisham
- Attachments
-
- matching.cmmd.ele
- Command file
- (3.52 KiB) Downloaded 1166 times
-
- elec.ring.v10.lte
- Lattice file
- (900 Bytes) Downloaded 1167 times
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: problem when optimizing phase advance
Hisham,
I don't know why I didn't realize this before, but you need to use nux=psix/2*pi and nuy instead of psix and psiy. Sorry for the confusion.
--Michael
I don't know why I didn't realize this before, but you need to use nux=psix/2*pi and nuy instead of psix and psiy. Sorry for the confusion.
--Michael
Re: problem when optimizing phase advance
Hi Michael,
Would you consider adding the psix and psiy column for the optimizer? I am having the same trouble.
Best regards,
Weiming
Would you consider adding the psix and psiy column for the optimizer? I am having the same trouble.
Best regards,
Weiming
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: problem when optimizing phase advance
Weiming,
You can just use "nux 2 / pi /" and "nuy 2 / pi /". I can add psix and psiy explicitly if that is really a problem.
--Michael
You can just use "nux 2 / pi /" and "nuy 2 / pi /". I can add psix and psiy explicitly if that is really a problem.
--Michael
Re: problem when optimizing phase advance
Hi Michael,
I tried again, it turns out that
Mark#1.nux is equivalent to Mark#1.psix, except a factor of 2pi.
Thanks a lot!
Weiming
I tried again, it turns out that
Mark#1.nux is equivalent to Mark#1.psix, except a factor of 2pi.
Thanks a lot!
Weiming
Re: problem when optimizing phase advance
I realize this thread is over 10 years old, but I'm having a very similar issue.
I'm trying to constrain the phase advance between two points, it shows up in the optimization routine apparently fine:
MARK-NLAE.02#1.psix MARK-TARG.A2#1.psix 3.35 0.1 selt: 0.000000000000000e+00
As you can see it is zero. In fact it is always zero.
When I try to use the tune instead, it remains zero:
1*(MARK-NLAE.02#1.nux MARK-TARG.A2#1.nux 0.53 0.03 selt): 0.000000000000000e+00
However, after the optimizer is done running I can compute the phase advance manually by reading the twiss file and I get 3.15 (or thereabouts). Clearly that constraint is not being met and I can't figure out why. It should be constrained from below, but it doesn't appear to be.
I'm trying to constrain the phase advance between two points, it shows up in the optimization routine apparently fine:
MARK-NLAE.02#1.psix MARK-TARG.A2#1.psix 3.35 0.1 selt: 0.000000000000000e+00
As you can see it is zero. In fact it is always zero.
When I try to use the tune instead, it remains zero:
1*(MARK-NLAE.02#1.nux MARK-TARG.A2#1.nux 0.53 0.03 selt): 0.000000000000000e+00
However, after the optimizer is done running I can compute the phase advance manually by reading the twiss file and I get 3.15 (or thereabouts). Clearly that constraint is not being met and I can't figure out why. It should be constrained from below, but it doesn't appear to be.
Re: problem when optimizing phase advance
In order to constrain the phase advance, here is the syntax if marker 1 preceds marker 2:
"Mark#2.psix Mark#1.psix - 0.5 0.1 segt"
It seems to me you have missed a minus operator after the second psix.
Weiming
"Mark#2.psix Mark#1.psix - 0.5 0.1 segt"
It seems to me you have missed a minus operator after the second psix.
Weiming
Re: problem when optimizing phase advance
Ohh wow, I've probably used those functions a hundred times and I just couldn't see that missing minus sign. Thank you!
I guess what is happening is that once the selt function gets all the inputs it needs it ignores the rest of the stack. That would explain why the error wasn't fatal and why the constraint is always satisfied.
I guess what is happening is that once the selt function gets all the inputs it needs it ignores the rest of the stack. That would explain why the error wasn't fatal and why the constraint is always satisfied.