Page 1 of 3

MOGA optimizer for rings

Posted: 07 Sep 2011, 09:11
by michael_borland
As many of you know, APS is using a Multi-Objective Genetic Algorithm (MOGA) optimizer to develop lattices for operations and the APS upgrade. Details of our approach are described in this document:
http://www.aps.anl.gov/Science/Publicat ... 418279.pdf

In addition to APS, we've applied this algorithm to NSLS-II, SPEAR, Diamond, and PEPX. For those who might want to try it, I've uploaded a set of examples and instructions. You can get it from our software downloads page at

http://www.aps.anl.gov/Accelerator_Syst ... shtml#MOGA

--Michael

Re: MOGA optimizer for rings

Posted: 07 Sep 2011, 09:12
by michael_borland
By the way, I'd like to thank Lanfa Wang (SLAC) for being the first to try this and helping to iron out some confusing parts.

--Michael

Re: MOGA optimizer for rings

Posted: 07 Jul 2012, 15:08
by kron
Hi Michael

I have tried to used MOGA optimizer to optimize beam emittace and DA.
I found some problem with the DA calculation process in "processJob" script which integrate the clipped area.
It give abnormal large area when the unclipped area is zero.
mpl.png
At the right down corner.
Those with the large area have DA like this:
002834check.png
DA
002834check.png (3.96 KiB) Viewed 12621 times
I tried to solve this problem by adding a line in the script:
...
-redefine=column,Area1, Area 0 == ? 0 : Area1 $ " \
...
this seem to solve the problem. However is there a better way to this?
And I wonder why the calculation gives the wrong values in the first place?

Also I try to use the FMA and diffusion rate as the objective for DA optimization but there is a problem with some points
(close to horizontal and vertical axis) which the algorithm can not find the real frequency (is it FFT ?) (If I understand correctly from your
explanation in another post)
as you can see:
985fma.png
fmaresult
985fma.png (22.27 KiB) Viewed 12620 times
Is there a way to solve this?

Many thanks
Thapakron

Re: MOGA optimizer for rings

Posted: 07 Jul 2012, 15:17
by michael_borland
Thapakron,

I wonder if you are using a very old version of elegant? The problem with getting very large area when the area is actually zero was solved several releases ago (I thought). If not, perhaps you can post the files for one of these cases.

The problem with FMA near the y=0 plane is due to cross-plane coupling. When the y value is very small, the motion coupled from the x plane can produce complex motion that doesn't have an unique, easily-identified frequency. The best thing to do is ignore the data for small y. You can change the input file to increase ymin in the &frequency_map command, or just filter the data after the fact.

--Michael

Re: MOGA optimizer for rings

Posted: 07 Jul 2012, 19:19
by kron
Michael,

Thanks a lot for your help.
I use Elegant 24.0.1-1.x86_64.

Please find the attached aperture output.

Thanks,
Thapakron

Re: MOGA optimizer for rings

Posted: 07 Jul 2012, 22:43
by michael_borland
Thapakon,

Can you try the most recent version? You are two versions behind.

If it still shows the problem, I need you to send the *input* files to diagnose the issue.

--Michael

Re: MOGA optimizer for rings

Posted: 08 Jul 2012, 06:20
by kron
Hi Michael

The Area obtained from Elegant is correct (zero when there is no aperture).
But during the clipped Area (Area1) calculation by the script "processJob", it gives
some large constant value for example ***

Area_check :0.000000000000000e+00 (from .aper)
Area1_check:1.005000000000000e+00 (after processing) ***

On the other hand, when the Area is non-zero the clipped area (Area1) can be calculated correctly:
Area_check :1.125074645767331e-04 (from .aper)
Area1_check:7.669601360507396e-05 (after processing) ***

you can see from attached script.

Thanks a lot
Thapakron

Re: MOGA optimizer for rings

Posted: 26 Jan 2013, 16:04
by xhs05
Hi Michael,
I met a problem when I try to use the geneticOptimizer.

I met a problem when I follow the steps in the GuideToUse to run demo.

The problem is :

bash: plotTwiss: command not found.

We are using the "Elegant 25.1.0" in Red Hat Enterprise Linux Workstation release 6.3.

Could you give me some suggestions on this problem?

Regards,
Haisheng Xu

Re: MOGA optimizer for rings

Posted: 26 Jan 2013, 17:03
by michael_borland
Haisheng,

The script plotTwiss should be included in the distribution, but perhaps we missed it. I've attached it here. Just unzip and put in your search path.

--Michael

Re: MOGA optimizer for rings

Posted: 28 Jan 2013, 09:19
by xhs05
Thank you, Michael!

We'll try to add this script into the search path.

Regards,
Haisheng Xu