How to make the worksheet for the TRD Gas Refill K. Andeen (KIT) Updated 7 Feb 2014 Objective: This worksheet does all of the TRD Gas Refill calculations for you, as long as you give it the proper input parameters. The goal is to eliminate stupid mistakes that can happen when things are done by hand too quickly. Details of the calculations and how to open the programs can be found in the complete Gas Refill Guide. 1 Getting started… • Go to the directory where the worksheet lives: cd • ~trd/Gas_Refills/ Make a new directory for the current refill and copy everything in the example directory to the new directory: mkdir 2013_01_23 cp example_dir/* 2013_01_23/. • Change to your new directory and open the worksheet in your favorite browser (emacs, for example) cd 2013_01_23 emacs make_worksheet.py & • make_worksheet.py has three sections, 1.the input parameters (basic, Day1 and Day2—see next 2 pages) 2.Day 1 calculations—produces the Day 1 worksheet 3.Day 2 calculations—produces the Day 2 worksheet You will need to modify ONLY parameters at top! DO NOT MODIFY THE REST! Note that the code was initially written to take these parameters as inputs from the command line so there are many print statements which may be removed at some point. 2 Input parameters There are three parts to the input parameters as well: basic things, day 1 things and day 2 things…. •Find the first four fields to fill in—these should be simple: – refill = refill number (an integer, ie 23) – day = day 1 or day 2 – who = who are you: put your initials and the initials of those helping you so we know who to blame when it breaks k.a. – Date: use the format DD-Month-YYYY: 13-Mar-2013 •9 more parameters you need to add for Day 1—do NOT modify them on Day 2: – – – – – – – – – target_xe How much Xe you want to add to the TRD: usually 10.2 bars How much CO2 you want to add to the TRD: usually 3.3 bars target_co2 trd_pressure From the TRD Pressure Monitor. See pg 6 for a screenshot. trd_xe_pressure Be sure to use the values for the actual day of the injection (at or just after the black dashed line) trd_co2_pressure From the TRD Gas Monitor. See pg 7 for a screenshot mix_pressure From the previous refill. See pg. 8 for more info. mix_percent_co2 Current_nominal_runtag Ask LEAD for this or look in ~daq/Desktop/tag.log Previous_trd_refill_runtag From the previous refill worksheet and/or tag.log 3 Extra input parameters if it’s Day 2 If this is Day 2, you need to change the day # and fill in 3 more parameters (do NOT modify the parameters from day 1!!!). – add_pressure_xe_1 – add_pressure_co2_1 – mix_pressure_2 From pg 4 of the Day 1 worksheet. You calculate the partial pressure of gas in the mixing vessel like so: Original # + # added = total #. # added is what you want for these fields. (See page 8 of these notes for more info) From the TRD Gas Monitor. See pg 6 for a screenshot—use the new value here, after the 1st injection. 4 Once you have all of your numbers • Simply run the code like so: ./make_worksheet.py • Then transform the .txt output to a pdf like so (where 23 is the refill # and Day 1 is which day of the refill you’re on): ./refill2ps.sh 23_Day1 • Email to experts: Bastian, Karen, Thorsten and Valery • When confirmed, print like so: lpr trd_Refill_23_Day1.ps • Voila! You have a worksheet! 5 TRD-Pressure Monitor (open from ~trd/RUN/) you will want to change the dates and the axes to zoom in here… Current TRD Pressure: Red is actual measured data, black is a value predicted by Bastian’s code behind this program If red and black don’t match in top plot, change this number and hit enter to refresh the plot. Modify the number until red and black overlap. TRD Xenon Pressure Estimate based on info from previous refills. TRD CO2 Pressure Estimate based on info from previous refills. Percent CO2 calculated from two fields above. This is where you fill in your target Xe and target CO2 (see pg 3 of these notes for more details see the gas refill guide) Dashed line marks the current day 6 TRD-GasMonitor This plot has your mix_pressure (from before you start the refi—usually 1100l) and mix_pressure_2 (look again after you are finished with the first injection—usually 1000). Zoom in on it, and use the average of the red one, just for consistency. 7 Getting Numbers from the “Previous Refill” • On Day 1 and Day 2 you need to grab numbers from the previous refill (on Day 2 this means you should get your info. from Day 1) • On a Day 1 worksheet this info is on page 4, while on a Day 2 worksheet this info is on page 3. The lines look like this: Calculate the partial pressure of gas in the mixing vessel CO2 242 + 2600 = 2842 bar Xe 758 + 9500 = 10258 bar • The percent CO2 (see pg 3 of these notes) is: 2842 / (2842 + 10258) = 0.217 = 21.7 % (use the percent #) • 2600 and 9500 are the amount added (see pg 4 of these notes) 8 Calculating Numbers to write into “Mix-b actual” on the front of your Day 2 Worksheet On Day 1 and Day 2, the program calculates the predicted change in TRD pressures. At the beginning of Day 2, we calculate what actually happened on Day 1. But the worksheet can’t calculate what happened on Day 2 because you don’t give the program that information. Therefore you have to do it by hand. It’s easy, here’s how it goes: •The line looks like this: [ (a) / (b) ] + [ (c) / (d) ] TRD: [ (e) / (f) ] = [ (g) / (h) ] •Since the first field is filled out for you, you need to write in what happened into the second field [c/d]. These numbers you’ll get from page 3 of your worksheet as the amount of pressure you added to the mixing vessel. (On Aug 8 2013: [(c) / (d)] = [9400 / 2580] ) •To calculate the third fields us the calculations at the bottom of page 6 of the worksheet. Note that: • 1.15 for the Xenon is a fudge factor Bastian calculated • 230L is the volume of the TRD •Now for the 4th fields, you simply need to add the third fields, to the fourth fields from mix-a actual. So for Aug 8 2013 the values are: [885 / 85] + [47 / 11] = [932 / 96]. •So the whole row looks like this: [754 / 246 ] + [9400 / 2580] TRD + [47 / 11] = [932 / 96] These last numbers (fields g and h) will be used in the gas_composition_history.txt file 9