Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime...

40
Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr Skowroński 10 Mar 2015 Beam Based Model 1

Transcript of Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime...

Page 1: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam based modelling

Tobias PerssonJonne Moeskops

Mattias FjellstromJaime Coello de Portugal

Ghislain RoyAgnieszka Szczotka

Piotr Skowroński

10 Mar 2015Beam Based Model1

Page 2: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Online Model is quite a fuzzy term different people mean different things:

Optics uploader to LSA and its verifications

Use of the model for beam measurements and setup

Online monitoring of the measured machine parameters and online comparison with the model to spot and study the differences aiming at improving the model

Combinations of the above

10 Mar 20152

Page 3: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Result of our surveyThe first priorities

The Predictor Tool: an application that allows checking effects of arbitrary setting changes (what happens if we change …) GUI letting easily changing arbitrary machine

parameters/knobs and displaying of the expected optics changes

It requires:Extraction of optics, orbit and optics measurements (dispersion, beta beat)Orbit and optics modelling (the effective model) adapting the model to reproduce the measured orbit and optical

parametersExtraction of power converter settings Knobs extraction and simulation so they can be tested before setting in the machineLater include more subtle data like misalignments, magnetic errors, etc.

Revival of Aperture Meter 10 Mar 20153

Page 4: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

The picture

10 Mar 20154

Machine settings

Converter(s)

Optics Measurements

the model

MADX scriptsTw

iss

file

s

Str

ength

file

s

Optics modelling

predictions

model dependent measurements

MD studies

Tools for

Improvingthe model

Tools for

Beam orbit

Misalignments

Magnetic Errors

Nominal Optics

Orbit modelling

Page 5: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Needed Tooling

1. The aperture meter revival and its maintenance2. Inputs for model creation:

Nominal optics from LSA (directly strength files) Orbit Knobs Circuits Settings Circuit Currents to strength converter(s) Misalignments Magnet errors Beta-Beat Measurements from LSA Other relevant measurements

3. Orbit and optics modelling4. GUI(s) for optics visualization and analysis flow

control5. Tool to check effects of setting/knob changes6. Model improvements and studies

10 Mar 20155

Page 6: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Strategy: modular approach

In order to gain maximum flexibility and to provide possibility for batch analyses each component is implemented as a command line toolData exchanged via TFS tables (files)

Can use the components stand-alone, for example The optics extractor lets finding very quickly the exact

state of the machine during an MD

Bootstrapping the model for analyses (f.g. MDs data)Fast to integrate with other applications, for exmple JMad Aperture Meter

Integration done through libraries (Java packages).

10 Mar 20156

Page 7: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

So far

Optics, orbit, knobs and circuits extractor (Tobias and Jonne)Orbit modelling (Mattias)GUI/The predictor tool – first version (Jaime)Aperture Meter revived (Piotr)

All the presented tools are made available on our AFS space

/afs/cern.ch/eng/lhc_online_model/

where all the software is setup (including the examples)

10 Mar 20157

Page 8: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Optics and orbit extractor

lhcmodel/lhcmodelextractorStarted from YASP orbit extractor accsoft-steering-logging-extractor-gui

Added command line options, but preserving the GUI functionality

Optics For a given date it finds optics ID in the databases Creates modifiers.madx with links to appropriate modifier files on AFS Generates a ready to use job.LHCBx.twiss.madx MADX script from a

templateTemplate can be user defined

10 Mar 20158

Tobias PerssonJonne Moeskops

Page 9: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Optics and orbit extractor

List of concrete examples is on our web page and in Examples file

Extract optics and orbit from timber and lsa to create a Madx script for beam 1, write output files to directory ./madxextract/

lhc-model-extractor.sh -e "2012-08-24 09:00:00" B1

Extract beam orbits between 2 timestamps in 1 minute intervals and writes them to directory ./beamorbits/

lhc-model-extractor.sh -oe -time "2012-09-01 11:00:00" "2012-09-01 11:02:00" 00 01 00 -p beamorbits/

Extract beam orbits between begin of RAMP and end of STABLE every 30 minutes for fill 3000

lhc-model-extractor.sh -oe -fill 3000 ramp stable 00 30 00

10 Mar 20159

Tobias PerssonJonne Moeskops

Page 10: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Optics and orbit extractor

ItoK feature: power converter values This feature allows us to read (for example)

MQT’s settings and follow tune FB action Nota bene, this is the only way to know MQT valuesOrbit correctors settings

Revived tool from Marek Strzelczyk and Gabriel Mueller

Reads the circuits currents for the magnets from the logging DB

Asks LSA to convert them to K Pass the names via file with the list (MAD or PC names

accepted) There are lists of circuits predefined : let us know what lists

are interesting for youlhc-model-extractor.sh -e "2012-08-24 09:00:00" B1 -ItoK list CORR,MQT” lhc-model-extractor.sh -e "2012-08-24 09:00:00" B1 -ItoK file "powerconverters.txt"

10 Mar 201510

Tobias PerssonJonne Moeskops

Page 11: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Optics and orbit extractor

Knobs definitions and their values at a the requested time Implementation was not trivial, because

Knobs setting is logged with time from the beam process startOne has to determine first the active beam process at a time (from LSA) and its activation time (the logging DB)

lhc-model-extractor.sh -e "2012-08-24 22:55:00" B1 -K "LHCBEAM/IP1-SEP-H-MM, LHCBEAM/IP2-SEP-H-MM”

10 Mar 201511

Tobias PerssonJonne Moeskops

Page 12: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Orbit modeling

lhcmodel/virtualcorrectorsOrbit modeling performed by MADX SVD orbit correction tool Provides a script to install virtual correctors at each

quadrupole magnet Orbit correction finds their setting to reproduce the extracted

orbit Saves the setting to a file

10 Mar 201512

Mattias Fjellstrom

Page 13: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Orbit modeling

In general very good agreement with measurements. Single command examples at /afs/cern.ch/eng/lhc_online_model/virtualcorrectors/

ExampleX (where X is a number)

10 Mar 201513

Mattias Fjellstrom

Page 14: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolBased on the Beta-Beating application/afs/cern.ch/eng/lhc_online_model/pro/bin/

gui_bb.v_pro.shgui_bb.v_next.sh

Choose where to place the model and MADX binary

10 Mar 201514

Jaime Coello de Portugal

Page 15: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolImporting optics

10 Mar 201515

Jaime Coello de Portugal

Page 16: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI based on beta beating app.The steering panelCommands can be passed to MADX manually using the input window at the bottom

10 Mar 201516

Jaime Coello de Portugal

Page 17: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor tool

Filter allowing fast access to the model variables

10 Mar 201517

Jaime Coello de Portugal

Page 18: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor tool

Plotting of selected models

10 Mar 201518

Jaime Coello de Portugal

Page 19: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolBeta-beating with respect to selected model.

10 Mar 201519

Jaime Coello de Portugal

Page 20: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolAdding additional effects Orbit modelling

10 Mar 201520

Jaime Coello de Portugal

Page 21: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolAdding additional effects Simulate a knob action

Find a knob

10 Mar 201521

Jaime Coello de Portugal

Page 22: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor toolAdding additional effects Simulate a knob action

Here, effect of a beta beating correction knob

10 Mar 201522

Jaime Coello de Portugal

Page 23: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

GUI / Predictor tool

The models and output files are left in the directory and can be further modified and analyzed manually

All the steps can be done without clicking in the GUI,and be wrapped into a small shell script

10 Mar 201523

Page 24: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experienceAperture measurements

10 Mar 201524

Page 25: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experienceAperture measurements

10 Mar 201525

Page 26: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experienceAperture measurements

10 Mar 201526

Page 27: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experienceAperture measurements

The scanned aperture All recorded beam traces with 3 sigma envelope

10 Mar 201527

Above physical aperture BPM readings due to non-linearities and poor resolution for low bunch charge

Page 28: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experiencePolarity measurements

GUI and Orbit modeling The integrated orbit modelling tool

10 Mar 201528

Display of the extracted and the modelled orbit

Page 29: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experiencePolarity measurements

kqtl11.r2b1 Red: model orbit response to kick with correct polarity Blue: the same with reversed polarity Black: measured orbit

Conclusion: black closer to red, polarity is good minus the offset in s

10 Mar 201529

Page 30: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Sector tests: the first experienceLessons learnt

The tools showed to be usefulThe GUI needs to be made more intuitiveBetter annotation of the data (beam No, date, effects included)Easier comparison with the measurementsAdditional tool for plot manipulations would be off hand For example, for polarity checks we needed to compare

difference of orbits between 2 models (no problem, this is in) with difference between 2 measured orbits

10 Mar 201530

Page 31: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model 10 Mar 201531

Web page http://lhcmodel.web.cern.ch

Page 32: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Other Inputs for Model Creation

Misalignments and Magnetic Errors Currently implemented in WISE Data extraction currently not automatic Is it worth re-writing it as a Java/console version?

10 Mar 201532

Page 33: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Conclusions

Aperture meter operational

Automatic data extraction for optics, orbit, knobs and circuit settings, plus conversion to MADX formatOrbit modelling First version of the prediction tool / the model GUIFirst successful practical usage during the sector tests

10 Mar 201533

Page 34: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Outlook

Extraction of the measured beam parameters and errorsOptics modellingGUI improvements Creation of a model from a beam process

Useful for an MD preparatory studies Re-opening of a model from disk user interface improvements

We will follow the commissioning & MDs analyzing all the available data to validate the model Prove its accuracy Optimize the algorithms Look for systematic effects indicating misalignments or

errors

10 Mar 201534

Page 35: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

The END

10 Mar 201535

Not really, just the beginning…

We will be happy to hear about any ideas for application of the beam-based model

Page 36: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

The scope

Provide more detailed machine model that accounts forall dynamical information available in the control system For example orbit or implemented corrections For a given moment in past as well as “on-line”

Applications To check effects of settings changes

What happens if – prediction tool To provide data for model-based measurements

For example beta beating or aperture measurements Verify the accuracy of the model against measurements

Study the available data to validate the beam based model and look for systematic effects

10 Mar 201536

Page 37: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Next stepsTools for model improvements

Comparing model continuously will show when it deviates from reality

Application to monitor and compare with model Tune Chroma Orbit

Functionality to compare the model with more sophisticated measurements, f.g. beta-beating Phases Beta Dispersion

Feed-backs action studies Orbit Tune

Corrections Linear Non-linear

10 Mar 201537

Bumps Crossing angles Aperture (losses)

Tune Coupling Chromaticity

Page 38: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

The codes

Java codes naturally use the CO framework including the SVNFor other codes lhcmodel SVN repository was setup MADX scripts The copy of the LHC model itself

So we can add improvements that we need Other programs Scripts that glue it all together and allow easy single

command execution

10 Mar 201538

Page 39: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

pre-existing Packages

Applications accsoft-om-app-apperturemeter accsoft-om-app-bpscan accsoft-om-app-chroma accsoft-om-app-dataextraction accsoft-om-app-measurementanalyzer

Underlying libraries accsoft-om-core accsoft-om-domain accsoft-om-gui accsoft-om-jmad-online-service accsoft-om-logging accsoft-om-lsa accsoft-om-manager accsoft-om-math accsoft-om-measurements accsoft-om-server accsoft-om-util

10 Mar 201539

185606 lines of Java code

Page 40: Beam based modelling Beam based modelling Tobias Persson Jonne Moeskops Mattias Fjellstrom Jaime Coello de Portugal Ghislain Roy Agnieszka Szczotka Piotr.

Beam Based Model

Coverage and priorities

10 Mar 201540

Extractors Names p

Nominal optics from LSA (strength files)

Piotr 1

Circuits Settings Piotr 3

Circuit Currents to strength converter(s)

Piotr 4

Misalignments Piotr 1

Orbit Tobias 2

b-beat meas. from LSA OMC 5

Tools for setup & OP Names

p

Aperture meter(modifs for sector tests - line)

Piotr 1

Optics visualization (with possibility to change parameters)

TBD 1

Beam-beam footprint 9

Rematch + knob production ?

Tools for model improvements-up

Names p

Orbit modelling Ghislain

1

Feedback action studies Tobias 5

Comparison of directly measured parameters (orbit, bumps, Q, Q’, Xing, aper)

2

Comparison of b-beat meas.

Tobias/P.

3

Corrections follow-up 4

Tune modelling Ghislain

2

Chroma modelling Ghislain