GlueTrack interpreter for S2E beam dynamic simulations Igor Zagorodnov BDGM, DESY 23.01.06.

Slides:



Advertisements
Similar presentations
Python Whats in a name? Snake logos and mascot notwithstanding, its named after Monty Pythons Flying Circus Humor-impaired can safely.
Advertisements

director of PythonLabs at Zope Corporation
OPERATING SYSTEM An operating system is a group of computer programs that coordinates all the activities among computer hardware devices. It is the first.
FLASH Simulations SASE Killer Igor Zagorodnov S2E Meeting DESY 24 June 2014.
RF Tweak 5 Tool for FLASH and XFEL
AstroGrid: Virtual Observatory Service Nicholas Walton AstroGrid: Virtual Observatory Service Nicholas Walton AstroGrid and Euro-VO Technology Centre Project.
Types of software. Sonam Dema..
An ide for teaching and learning prolog
Python for S60 SmartPhones PostPC Workshop Fall 2006 Amnon Dekel.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
Python Python طراحی و پیاده سازی زبان‌های برنامه‌سازی.
About Python. Sept. 2003© Guido van Rossum 2 Executive Summary Dynamically typed object-oriented language Python programs look like executable.
OpenAlea An OpenSource platform for plant modeling C. Pradal, S. Dufour-Kowalski, F. Boudon, C. Fournier, C. Godin.
Topics Introduction Hardware and Software How Computers Store Data
Intro to Python Programming (Introduction) Pamela A. Moore Zenia C. Bahorski Eastern Michigan University March 7, 2012 A language to swear by, not at.
High-level Languages.
SB ScriptBasic Introduction to ScriptBasic There are more people writing programs in BASIC than the number of people capable programming.
Standard Grade Computing System Software & Operating Systems.
Python Guido van Rossum Sung-Jin Hong SPARCS
The Python Language Petr Přikryl Part I Socrates IP, 15th June 2004 TU of Brno, FIT, Czech Republic.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
Introduction to Programming Peggy Batchelor.
Magnetic Field Measurement System as Part of a Software Family Jerzy M. Nogiec Joe DiMarco Fermilab.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
An overview of scripting languages Alexander Kanavin Teachers: Barbara Miraftabi, Jan Voracek.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Python From the book “Think Python”
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
Astra A Space Charge Tracking Algorithm
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
K.Furukawa, Nov Database and Simulation Codes 1 Simple thoughts Around Information Repository and Around Simulation Codes K. Furukawa, KEK Nov.
1 Control Software (CAT) Introduction USB Interface implementation Calorimeter Electronics Upgrade Meeting Frédéric Machefert Wednesday 5 th May, 2010.
Intro to Python Programming (Part 1) Pamela Moore Zenia Bahorski Eastern Michigan University March 16, 2011 A language to swear by, not at.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Beam Dynamics and FEL Simulations for FLASH Igor Zagorodnov and Martin Dohlus Beam Dynamics Meeting, DESY.
Unit 1 Basic Python programs, functions Special thanks to Roy McElmurry, John Kurkowski, Scott Shawcroft, Ryan Tucker, Paul Beck for their work. Except.
Getting Started with SIDL using the ANL SIDL Environment (ASE) ANL SIDL Team MCS Division, ANL April 2003 The ANL SIDL compilers are based on the Scientific.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
 Programming - the process of creating computer programs.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Software Development Introduction
3D codes: TraFiC4 and CSRtrack Torsten Limberg DESY Zeuthen 2003.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
S2E (start-to-end) Simulations at DESY T. Limberg TESLA Collaboration Meeting in Frascati, May 2003.
TRIUMF HLA Development High Level Applications Perform tasks of accelerator and beam control at control- room level, directly interfacing with operators.
Large-scale accelerator simulations: Synergia on the Grid turn 1 turn 27 turn 19 turn 16 C++ Synergia Field solver (FFT, multigrid) Field solver (FFT,
David Adams ATLAS AJDL: Abstract Job Description Language David Adams BNL June 29, 2004 PPDG Collaboration Meeting Williams Bay.
Zope Concepts - Python scripts Valentin Baciu Finsiel Romania Tirana, 6 June 2005.
Python Programming Unit -1.
A Python Tour: Just a Brief Introduction
Topics Introduction Hardware and Software How Computers Store Data
Do you know this browser?...
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
basic Python programs, defining functions
Introduction to Algorithm Design
Java Server Pages (JSP)
System calls….. C-program->POSIX call
FEATURES OF PYTHON.
New VUV-FEL Simulation results
Python Basics. Topics Features How does Python work Basic Features I/O in Python Operators Control Statements Function/Scope of variables OOP Concepts.
Web Application Development Using PHP
Introduction to Computer Science
Presentation transcript:

GlueTrack interpreter for S2E beam dynamic simulations Igor Zagorodnov BDGM, DESY

TTF2 – s2e W = wake of one TTF module W L = wake of LOLA structure TM = transverse matching to design optic ASTRA CSRtrack (1d model) GENESIS + W TM + 2  W + W L TM M.Dohlus We want to glue all components, transformations and conversions in one script.

Scripting language? Python (Guido van Rossum) Open Source (OSI Certified) –copyrighted but use not restricted Mature (13 years old) Supportive user community –plenty of good books, too Simple design, easy to learn –reads like “pseudo-code” –Suitable as first language –Suitable as last language :-)

Extremely portable –Unix/Linux, Windows, Mac, PalmOS, WindowsCE, RiscOS, VxWorks, QNX, OS/2, OS/390, AS/400, PlayStation, Sharp Zaurus, BeOS, VMS… Compiles to interpreted byte code –compilation is implicit and automatic Memory management automatic “Safe”: no core dumps due to your bugs Extensible (add new modules) –C/C++/Fortran/whatever –Java (through Jython) Why Python?

Who is using Python? Google (various projects) NASA (several projects) NYSE (one of only three languages "on the floor") Industrial Light & Magic (everything) Yahoo! (Yahoo mail & groups) RealNetworks (function and load testing) RedHat (Linux installation tools) LLNL, Fermilab (steering scientific applications) Zope Corporation (content management) ObjectDomain (embedded Jython in UML tool) Alice project at CMU (accessible 3D graphics) J.Amundson et al. Synergia: An accelerator modeling tool with 3-D space charge, Journal of Comp.Phys., 211 (2006)

S2E_tools.py (parsing, interpretation, analysis) particle_tools.py (conversions, matching, transformations) Python, Scipy, Pylab input.txt (tasks, actions, parameters) mainS2E.py (configuration and start) wakes.py (wake function definitions) Codes (Astra, CSRtrack, Genesis) Input files for the codes report.html figures distributions

! input file for Start-to-End simulation of TTF2 #00 ASTRA -> CSRtrack action=processor task=read sort_len=True in_file=ttf format=astra task=add_wake wake_delta=0 m_interv=[-0.005, 0.005] sigmaI= wake=wake0 task=center centerx=True centery=True centerxs=True centerys=True innterv=[-0.002, 0.002] task=matching interv=[-0.002, 0.002] xpar=[4.619, ,1.0] ypar=[-0.012, 2.809,1.0] task=write out_file=bc1_in.fmt1 format=fmt1 #01 BC1 (CSRtrack) action=CSRtrack task=run work_dir=N1_bc1 command=./src_11 #02 CSRTrack -> ASTRA action=processor task=read in_file=N1_bc1/out/bc1_out.fmt1 format=fmt1 task=center centerz=True task=define_ref_part task=drift length=-1 task=write z0= out_file=N2_bc_to_bc/bc1_out.ini format=astra #03 BC1 to BC2 (ASTRA) action=ASTRA task=run command=./astra, bc_to_bc100.in work_dir=N2_bc_to_bc task=run command=./astra, bc_to_bc300.in work_dir=N2_bc_to_bc input.txt (actions, tasks, parameters)

processor ASTRA, CSRTrack analysis read write add_wake matching drift drift_to define_ref_part center extract_slice_centr mix run os read write slice_analysis m_current m_emmitance m_momentum m_rms_momentum m_hor_offset m_hor_slope m_Twissx m_Twissy m_topview

from S2E_tools import * #configuration runtype='restart'; #'restart','new' fig_dir='./Figures/'; report_file=fig_dir+'report.html'; inputfile='input.txt' outputfile='output.txt' # main code if runtype=='new': html=open(report_file,'w'); html.write(' \n') start,stop,indfig=0,1000,0 if runtype=='restart': html=open(report_file,'a+'); start,stop,indfig=FindRestartParameters(html) actions= ReadTask (inputfile); indfig= RunTask (actions,fig_dir,html,start=start,stop=stop,i ndfig=indfig) html.write(' \n'); html.close() from scipy import * def wakeTM(s): return -1e12*(344*exp(- sqrt(s/ ))) def wakeLOLA(s): return -1e12*(257.6*exp(- sqrt(s/ ))+1.16*cos(1760*s**0.72)/(sqrt(s)+ 1600*s**1.23+1e-20)) def wake0(s): return wakeTM(s) wake0_delta=0 def wake1(s): return 2*wakeTM(s) wake1_delta=0 def wake2(s): return 2*wakeTM(s)+wakeLOLA(s) wake2_delta=-0.036e12*20/22.44 mainS2E.py wakes.py

ACC1 output BC2 Input BC2 output ACC2 input ACC3 output BC3 Input BC3 output ACC4 input LOLA output dogleg input dogleg output ASTRA input ASTRA output 00.4e-70.1e-30.2e ASTRA CSRtrack (1d model) GENESIS + W TM + 2  W + W L TM relative error[%]

Martin Dohlus GlueTrack

# ? VERSION = 1.0 ? SIZE = 319 ? COLUMNS ZPOS GAMMA0 DELGAM EMITX EMITY RXBEAM RYBEAM CURPEAK Genesis input file difference?

Next 1. Parameter scans 2. XFEL simulations Aknowledgements to Martin Dohlus for guidance and MathCAD scripts