Page 1 of 1
problem when optimizing phase advance
Posted: 10 May 2010, 12:50
by hsayed
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
Re: problem when optimizing phase advance
Posted: 13 May 2010, 16:25
by michael_borland
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
Re: problem when optimizing phase advance
Posted: 13 May 2010, 17:18
by hsayed
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
Re: problem when optimizing phase advance
Posted: 14 May 2010, 09:02
by michael_borland
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
Re: problem when optimizing phase advance
Posted: 06 Jan 2011, 17:08
by wguo
Hi Michael,
Would you consider adding the psix and psiy column for the optimizer? I am having the same trouble.
Best regards,
Weiming
Re: problem when optimizing phase advance
Posted: 06 Jan 2011, 17:20
by michael_borland
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
Re: problem when optimizing phase advance
Posted: 07 Jan 2011, 09:45
by wguo
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
Re: problem when optimizing phase advance
Posted: 09 Mar 2020, 17:34
by foshea
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.
Re: problem when optimizing phase advance
Posted: 09 Mar 2020, 19:41
by wguo
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
Re: problem when optimizing phase advance
Posted: 09 Mar 2020, 20:27
by foshea
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.