Page 1 of 1

user defined variable as optimisation variable

Posted: 11 Jul 2014, 21:29
by libov
Hi Michael et al,

let's say I defined a variable in the lattice file and used it for several elements. Can I use this variable as optimisation variable?

For example,
.lte file:
Q1: K1=1,L=myVariable
Q2: K1=2,L=myVariable

.ele file:
<say that myVariable should be varied>

Of course one could do:
&optimization_variable name=Q1, item= L, ... &end
&optimization_variable name=Q2, item= L, ... &end
&optimization_term term="Q1.L Q2.L 1e-3 sene" &end

but for many elements the latter procedure gets a bit tedious..

Thanks in advance !

Yours
Slava

Re: user defined variable as optimisation variable

Posted: 14 Jul 2014, 08:30
by michael_borland
Slava,

Unfortunately, there isn't a way to use a user-defined variable in optimization. It's something we should add.

Meanwhile, here's how I would do it:
&optimization_variable name=Q1, item= L, ... &end
&optimization_covariable name=Q2, item= L, equation = "Q1.L" &end
&optimization_covariable name=Q3, item= L, equation = "Q1.L" &end
&optimization_covariable name=Q4, item= L, equation = "Q1.L" &end

etc.

--Michael

Re: user defined variable as optimisation variable

Posted: 16 Jul 2014, 02:52
by libov
Thanks!!
Slava