Integration of Mathematica in the Large Hadron Collider geometry database Jerome Beauquis Elena Wildner IMS06, 20 June, 2006, Elena Wildner
Outline INTRODUCTION THE DIPOLE GEOMERTY HOW TO SOLVE THE PROBLEMS The superconducting LHC The LHC Main Dipole THE DIPOLE GEOMERTY Definitions How to Control the Dipole Geometry Tolerances Control Criteria Magnet Instability HOW TO SOLVE THE PROBLEMS Limited resources Working with the data base in Mathematica Setting up Derived Parameter Values in Mathematica Using WEB Services Parameter Browser Palette CONCLUSION REFERENCES IMS06, 20 June, 2006, Elena Wildner
The Superconducting LHC The Tunnel existed (LEP) and had to be reused for LHC (proton proton collisions) High energies are needed to explore physics (7 TeV) This means high speed of particles The force to bend particles is high The field needed to house the accelerator in the tunnel ~9T Superconducting Technology necessary INTRODUCTION . IMS06, 20 June, 2006, Elena Wildner
The LHC Main Dipole (1) The LHC Dipole (1232 + spares to be produced) by 3 firms (Germany, France and Italy, very large high tech contracts) INTRODUCTION We needed safe and powerful tools to manage the follow up of the production IMS06, 20 June, 2006, Elena Wildner
The LHC Main Dipole (2) “Two in one” structure Yoke Collars Coil INTRODUCTION Collars Coil Beam-tube IMS06, 20 June, 2006, Elena Wildner
The Dipole geometry Definitions The beam must pass through the 56 mm (diameter) cold bore tube. The dipole is bent 9.14 mm (9.11 at cryogenic temperature) The Dipole is supported in three positions vertically Horizontally the magnet was initially supported in two places. Connection side Lyre side Field extension Reference on Layout Drawings Distance between cold bore tubes Flanges Cold mass end plate X Y Sagitta THE DIPOLE GEOMETRY IMS06, 20 June, 2006, Elena Wildner
The Crucial Geometry Parameters Measurements of the CBT center along the magnet Computation of geometrical axis (best fit of measurement points to the theoretical trajectories) Corrector position Flanges (hard tolerance) Fiducials (external references) THE DIPOLE GEOMETRY IMS06, 20 June, 2006, Elena Wildner
Control of the Dipole Cold Mass Geometry 1. When the magnet comes to CERN, the sagitta has naturally changed (mechanism unknown today, studies ongoing) 2. At Cryostating the central support is blocked, no horizontal movement at the supports possible 3. The magnet is cold tested 4. The magnet is fiducialized: during this procedure the shape is adjusted by acting on the position of the central support, horizontally and vertically. Central support is blocked, horizontal degree of freedom suppressed Degree of freedom THE DIPOLE GEOMETRY Large sagitta -> correctors >> 0 y IMS06, 20 June, 2006, Elena Wildner
Cryostating THE DIPOLE GEOMETRY IMS06, 20 June, 2006, Elena Wildner
Requirements for the cold bore tube excursions Tolerances Requirements for the cold bore tube excursions H axis points to the centre of the machine THE DIPOLE GEOMETRY 15 % can be out horizontally, hard tolerance in industry 1.5 Last measurement at CERN Last industry IMS06, 20 June, 2006, Elena Wildner
Cold Mass Geometry Instability (1) “Natural” sagitta increase Industry: Corrector ~ 0 THE DIPOLE GEOMETRY IMS06, 20 June, 2006, Elena Wildner
Cold Mass Geometry Instability (2) Firm 1 Firm 2 -1 1 2 3 dsagitta 4 6 8 10 Mean 0.71 Stdev 0.77 Total 127 -1 1 2 3 4 6 8 10 Total 90 Mean 0.33 Stdev 0.58 dsagitta THE DIPOLE GEOMETRY The sagitta is not stable !!! Firm 3 Mean 0.51 Stdev 0.60 -1 1 2 3 2.5 5 7.5 10 12.5 15 Total 91 dsagitta Different change of agitta for different firms IMS06, 20 June, 2006, Elena Wildner
How to control the sagitta Push the central support horizontally and block it Control parameter? Sagitta is a natural choice How to calculate it HOW TO SOLVE THE PROBLEM IMS06, 20 June, 2006, Elena Wildner
Sequence Diagram HOW TO SOLVE THE PROBLEM IMS06, 20 June, 2006, Elena Wildner
Mathematica via JLink KernelLink mLink = MathLinkFactory.createKernelLink( "-linkmode launch -linkname 'c:\\program files\\wolfram research\\mathematica\\5.0\\mathkernel'"); mLink.activate(); mLink.evaluate("<<OwnPackages`DerivedData`"); mLink.putFunction("EvaluatePacket",1); mLink.putFunction("RaceTrackAp",1); mLink.put(ShapeAp1); mLink.endPacket(); mLink.waitForAnswer(); RaceTrack[0]=mLink.getDoubleArray1(); Create the link to the kernel Connect the link Load the package HOW TO SOLVE THE PROBLEM Call the function and send parameters Get results and store in java object IMS06, 20 June, 2006, Elena Wildner
Calculation of a Derived Parameter: The Sagitta Some Derived Parameters in the Package: Shape Classification Measurement Data Filtering Corrector Position Calculation Sagitta ... etc IMS06, 20 June, 2006, Elena Wildner
Measurements collected in an ORACLE database Conclusion Measurements collected in an ORACLE database Communication software specialists-engineers needed Mathematica calculations of derived parameters by engineers, easy prototyping Integration by software specialists Derived data package is growing and becoming more and more powerful The approach was crucial for the very production speed and the problems we had with the magnet stability Today the solution would be to use Mathematica to directly access ORACLE (no Java) CONCLUSION IMS06, 20 June, 2006, Elena Wildner
Acknowledgements IMS06, 20 June, 2006, Elena Wildner
Java & Oracle (1/2) DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(LOAD_BALANCE=off)(ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=orapdb2.cern.ch)(PORT=1521))(ADDRESS=(PROTOCOL=TCP) (HOST=orapdb1.cern.ch)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PDB.WORLD) (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))","user","pwd"); Statement query = connect.createStatement(); ResultSet rsetShape; rsetShape = query.executeQuery ("select Y,DX,DZ,Aperture from CRYOGEO_AXIS WHERE MAGNET_NU=" + MagnetNumber + " AND step='" + Step1 + "' and final_meas='T' ORDER BY APERTURE,Y"); j=0; i=0; while (rsetShape.next()) { if (rsetShape.getInt("APERTURE")==1) { ShapeAp1[0][i]=(Double)Yap1.elementAt(i); ShapeAp1[1][i]=(Double)DXap1.elementAt(i); ShapeAp1[2][i]=(Double)DZap1.elementAt(i); i++; } else { ShapeAp2[0][j]=(Double)Yap2.elementAt(i); ShapeAp2[1][j]=(Double)DXap2.elementAt(i); ShapeAp2[2][j]=(Double)DZap2.elementAt(i); j++; Connect to the DB Get measurements from the DB HOW TO SOLVE THE PROBLEM Put data in java objects to be sent to mathematica package IMS06, 20 June, 2006, Elena Wildner
Java & Oracle (2/2) Insert results into the DB via prepared statements for performance PreparedStatement InsertPstmt = conn.prepareStatement("Insert into CRYOGEO_RACETRACK(Magnet_Nu,Step,Reference_Meas, Magnet_Name,Stage,Aperture,Y,RTrack) values(?,?,?,?,?,?,?,?)"); InsertPstmt.setInt(1,Integer.parseInt(AdminData[0])); InsertPstmt.setString(2,AdminData[1]); InsertPstmt.setInt(3,Integer.parseInt(AdminData[2])); InsertPstmt.setString(4,AdminData[3]); InsertPstmt.setString(5,AdminData[4]); for(i=0;i<ShapeAp1[0].length;i++){ InsertPstmt.setInt(6,1); InsertPstmt.setDouble(7,Double.parseDouble( ShapeAp1[0][i].toString())); InsertPstmt.setDouble(8,RaceTrack[0][i+1]); InsertPstmt.executeUpdate(); }//for for(i=0;i<ShapeAp2[0].length;i++){ InsertPstmt.setInt(6,2); ShapeAp2[0][i].toString())); InsertPstmt.setDouble(8,RaceTrack[1][i+1]); InsertPstmt.close(); conn.commit(); conn.close(); Assign values to bind variables and close objects and connection HOW TO SOLVE THE PROBLEM IMS06, 20 June, 2006, Elena Wildner