output_at_each_step creates unknown tokens when combined with optimization_covariable

Moderators: cyao, michael_borland

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

output_at_each_step creates unknown tokens when combined with optimization_covariable

Post by foshea » 10 Mar 2020, 18:11

I'm trying to optimize a toy beam line and I can't access all the parameters I want to because of unexpected behavior of the output_at_each_step flag in twiss_setup.

When the flag is set (output_at_each_step = 1), the following optimization_covariable throws an unknown token:

Code: Select all

&optimization_covariable
name=TB, item=betax, equation="MW#1.betax" 
&end
Where MW is a mark element and TB is a twiss element. The MW#1.betax is the unknown token.

When I comment out the output_at_each_step flag, the previous optimization_covariable works just fine, but the following optimization_term does not (another unknown token error):

Code: Select all

&optimization_term
term = "SW.ANGLE atan 0.25 0.01 selt"
&end 
SW is a properly defined CSBEND element, the SW.ANGLE is the unknown token.

Since I can get one or the other to work depending on how the output_at_each_step flag is set, I know that everything is defined properly enough. Is this the intended functionality of output_at_each_step? If so, I do not understand it.

Edit: EDRIFT items don't appear to cause any problems, but KQUAD elements fail similarly to the CSBEND elements.

Edit: A set of files that can be used to recreate this problem are located in this topic:
viewtopic.php?f=9&t=1104
Last edited by foshea on 25 Aug 2020, 13:47, edited 2 times in total.

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

Re: output_at_each_step creates unknown tokens

Post by foshea » 13 Mar 2020, 17:16

I have one more clue. I cannot use beam line element parameters (quad strength, drift lengths, bend angles) in optimization_term, optimization_covariable, or rpn_expression unless they are also used as optimization_variables as well. At the moment I have output_at_each_step commented out because I need to be able to link the beta function at two points.

Is this intended? I don't recall ever encountering this problem before.

Post Reply