problem when optimizing phase advance

Moderators: cyao, michael_borland

Post Reply
hsayed
Posts: 8
Joined: 22 Jul 2008, 12:51

problem when optimizing phase advance

Post by hsayed » 10 May 2010, 12:50

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

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

Re: problem when optimizing phase advance

Post by michael_borland » 13 May 2010, 16:25

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

hsayed
Posts: 8
Joined: 22 Jul 2008, 12:51

Re: problem when optimizing phase advance

Post by hsayed » 13 May 2010, 17:18

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
Attachments
matching.cmmd.ele
Command file
(3.52 KiB) Downloaded 1166 times
elec.ring.v10.lte
Lattice file
(900 Bytes) Downloaded 1167 times

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

Re: problem when optimizing phase advance

Post by michael_borland » 14 May 2010, 09:02

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

wguo
Posts: 41
Joined: 13 Jun 2008, 12:54

Re: problem when optimizing phase advance

Post by wguo » 06 Jan 2011, 17:08

Hi Michael,

Would you consider adding the psix and psiy column for the optimizer? I am having the same trouble.

Best regards,

Weiming

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

Re: problem when optimizing phase advance

Post by michael_borland » 06 Jan 2011, 17:20

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

wguo
Posts: 41
Joined: 13 Jun 2008, 12:54

Re: problem when optimizing phase advance

Post by wguo » 07 Jan 2011, 09:45

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

foshea
Posts: 34
Joined: 23 Jun 2009, 21:00

Re: problem when optimizing phase advance

Post by foshea » 09 Mar 2020, 17:34

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.

wguo
Posts: 41
Joined: 13 Jun 2008, 12:54

Re: problem when optimizing phase advance

Post by wguo » 09 Mar 2020, 19:41

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

foshea
Posts: 34
Joined: 23 Jun 2009, 21:00

Re: problem when optimizing phase advance

Post by foshea » 09 Mar 2020, 20:27

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.

Post Reply