Friday, August 1, 2014

The Short One: Lab Book 2014_07_31


Summary:
The day felt productive!  Honest!  However, looking back at the lab book, it doesn't look like a whole lot happened.  It could have been the two meetings sandwiching the beginning and end of the day.  Anyway, here's the cool stuff that did happen.  After fretting for a bit about where to get more computer time to run simulations on the can crusher code, I tried out +The SageMathCloud.  It's so cool!  The simulator runs a little bit faster than my laptop and without out all the incessant fan blowing!  In addition, I can setup simulations in parallel, something I couldn't benefit from when limited to my one local machine.  The simulator proper has been partitioned into its own file.  The simulations are now much more manageable, containing only setup parameters and results.  One new feature was added to the simulator.  The driven can modeling coils can now be made superconducting.  I'm not sure I trust the results yet.  The graph above shown the magnetic field that should be available over the surface of the smallest and the largest sample sizes that have been proposed.  For more on this calculation, see the derivation[1], and of course, the simulator.  Permission to use the pulsed magnet has been given, so with any luck, there will be some experimental results here soon.

If you're new to the experiment, please scroll to the bottom for all the background.


Lab Book 2014_07_31     Hamilton Carter

Sage Cloud start time
5:51 AM
Started sim locally at 5:53 AM
Sim complete at 5:54 on Sage Cloud  took 3 minutes!
Testing again locally… Started sim at 5:59 AM
Finished at 6:03 AM
SageCloud is a minute faster than the laptop

For instructions on how to load files into a sage worksheet, look here
For broad documentation on the same topic, look here
The search for best practices


References:
1.  Derivation of magnetic field coordinates

2.  Simulator on github

Background
Hirsch's theory of hole superconductivity proposes a new BCS-compatible model of Cooper pair formation when superconducting materials phase transition from their normal to their superconducting state[1].  One of the experimentally verifiable predictions of his theory is that when a superconductor rapidly transitions, (quenches), back to its normal state, it will emit x-rays, (colloquially referred to here as H-rays because it's Hirsch's theory).

A superconductor can be rapidly transitioned back to its normal state by placing it in a strong magnetic field.  My experiment will look for H-rays emitted by both a Pb and a YBCO superconductor when it is quenched by a strong magnetic field.
This series of articles chronicles both the experimental lab work and the theory work that’s going into completing the experiment.

The lab book entries in this series detail the preparation and execution of this experiment… mostly.  I also have a few theory projects involving special relativity and quantum field theory.  Occasionally, they appear in these pages.

Call for Input
If you have any ideas, questions, or comments, they're very welcome!

References
1.  Hirsch, J. E., “Pair production and ionizing radiation from superconductors”, http://arxiv.org/abs/cond-mat/0508529 



Thursday, July 31, 2014

Math Notes: Cylindrical r Coordinate Value to Trace a Spherical r Dependent on z


OK, so that was quite the title.  I haven't done one of these in a while, but classes are about to start again and i figured I may as well get started deriving things again.  Plus, I had to do it for the can crusher magnet simulation code[1] for the experiment[3].  Here's what's really going on.  I have a Sage function that will give me the magnetic field in the z direction produced by a coil of wire that sits at z = 0 and a has a radius of 'rcoil'.  I'd like to know the magnetic field produced by the loop of wire along a circular path that is perpendicular to the plane of the current carrying coil.  A circular path perpendicular to the plane of a coil kind of begs for spherical coordinates, but the routine I have takes a z coordinate and a radius coordinate in the cylindrical coordinate system.  In the picture above, the circular path is shown, and the coil of wire is at the diameter of the circle and perpendicular to the page.  Note:  For those reading on G+, the equations aren't going to come out correctly, what with the lack of Latex support and all... apologies, but you can get the full version at, and garner the vast majority of it from the figure below.

At each height z above the coil the magnetic field will be the same all the way around the coil for a given spherical radius.  We can exploit this radial symmetry and only calculate the value of the magnetic field once instead of at each point around the circle.  Then, we can simply make a plot of the magnetic field vs z with the understanding that the radius of the sphere is constant and specified.  Here's the transform to get the value of the magnetic field dependent on our position on the z axis, given the radisu of the sphere we're interested in and the z coordinate, (of course... don't you just love saying that?).  The only trick is to figure out what cylindrical value of radius to plug in for each value of z to keep all our points on the spherical circle.
For any point on the sphere, notice that the cylindrical r value can be written as

$r = r_{coil}*cos\theta$,

where $r_{coil}$ is the constant radius of the coil which is also the constant radius of the sphere that we're interested in.  Next, we note that at each point along the spherical path

$\theta = asin\left(\dfrac{z}{r_coil}\right)$


Plugging this into the first expression, we get

$r = r_coil cos\left(asin\left(\dfrac{z}{r_{coil}}\right)\right)$

There's one last little modification.  Arcsin's of other functions always creep me out just a little, so fortunately, there's a trig identity we can use to get rid of this one.  The identity[2] is

$cos\left(arcsin\left(x\right)\right) = \sqrt{1-x^2}$

By plugging this in, we get the final expression

$r = r_{coil} \sqrt{1-\left(\dfrac{z}{r_{coil}}\right)^2}$

Now, for each value of z, I just call the magnetic field routine, passing it the radius of the coil, the value of z, and the expression for r above that depends only on the radius of the coil and z!  The sage code looks like so:

Bzradius(rcoil, z, curren) = dbcoilbz(rcoil, z, rcoil*(1-(z/rcoil)^2)^0.5, curren)


This gives me nice little graphs like the following.



References:
1.  github Can Crusher simulation project
https://github.com/hcarter333/cancrusher

2.  Trig identities
https://en.wikipedia.org/wiki/Trigonometry_idenities#Compositions_of_trig_and_inverse_trig_functions

3.  The hray experiment
http://copaseticflow.blogspot.com/2014/07/simulations-everywhere-simulations-lab.html

Simulations! Everywhere Simulations! Lab Book 2014_07_31


Summary:
Excuse a brief moment of frivolity please.  OMG, This is So *#($&#@ cool!!!

OK, now that I've got that out of my system we can move on.  The can crusher simulator port from IDL to Sage is complete and it's working spectacularly well!  I was able to run simulations to find out what the temperature of the can would increase to due to the magnetic pulse.  I was also able to plot the magnetic field in a sphere around the pulisng coil to determine if the coil as specified would provide a high enough magnetic field to quench the entire superconducting Pb sample at once.  Meanwhile, work is continuing on fixing the vacuum leak detector.  I was unable to find an instrument panel bulb to attempt the kluge fix suggested below, so it looks like I'll be ordering a replacement part instead.

If you're new to the experiment, you can find background by scrolling to the bottom of the page.

Lab Book 2014_07_30     Hamilton Carter

Vacuum Leak Detector Work
Still looking into a replacement for the Pirani gauge.  We don’t have any bulbs here that will substitute for the 70 ohms specified here.
Proposed procedure for calibrating bulb
1.       Use potentiometer and voltmeter to determine at what resistance the leak detector will turn on the diffusion pump.  The potentiometer will be inserted between the pins of the PI-1 and adjusted till the diffusion pump power comes on.  This will be the resistance the detector wants to see to turn on the diffusion pump.  The voltmeter will watch the disconnected power line to the diffusion pump to determine when power is applied to the pump.
2.       Place the proposed bulb in vacuum.  Run the same current through it and measure its resistance vs. pressure, with a bridge?  Check the pressure in the chamber with a calibrated vacuum meter.  Check for the resistance to reach the proper value at the proper pressure so that the diffusion pump will not be damaged.
3.       if the resistance is not correct at the correct pressure, try making a resistive combination to bring the resistance into range.

Can Crusher Simulation
I started to ask interesting questions using the simulator today.  Here’s a graph comparing the driving current at room temperature and at the temperature of our sample, 4.2 degrees Kelvin.


Notice the initial spike in current on the lower temperature curve.  I’m wondering if this can be made to help quench the superconductor even more quickly.

The heat created by the can crushing currents should be able to be related to temperature using the heat capacity of the material.  Actually, the code that converts to temperature is already in the simulation.  I just need to store the values per time tick.  DONE!
Here’s the graph of the temperature change in the can with the can starting at 293 K vs. 4.2 K.  This should be further updated to include the entire volume of liquid helium in the Dewar.  At the moment, the calculation only takes into account the mass of the can.  It can be seen that in the coarse sense, there is not much difference after 20 microseconds or so.


The initial results for the magnetic field along the surface of the superconductor look troublesome.  More soon.
However, before we get into that, here are the current curves for the planned largest and smallest Pb spherical sample sizes at room temperature.


A simulation is being run at liquid helium temperatures.  The next step is to put in the material constant values for Pb and modify the moving coils so they fit on a spherical form matching the two sample sizes rather than a cylindrical form, (the default for the soda can crusher).
Here are the liquid helium temperature results


Notice that the current goes up with the smaller sample size.  It would seem there should be a sweet spot between size and current.

Here are the results of the magnetic field calculation along the surface of the sphere as the coordinate on the z axis, (here shown on the x axis of the graph), increases.  The small sample size will quench comfortably, while the big sample will not be completely immersed in a quenching field.  The next step is to try the simulation again with a 5000 volt charge on the capacitors instead of the 3000 volts that is being used now.


Here’s the math for determining the cylindrical radius required by the magnetic field function for the z coordinate with an axis along a sphere that is slightly smaller than the sample size.

Background
Hirsch's theory of hole superconductivity proposes a new BCS-compatible model of Cooper pair formation when superconducting materials phase transition from their normal to their superconducting state[1].  One of the experimentally verifiable predictions of his theory is that when a superconductor rapidly transitions, (quenches), back to its normal state, it will emit x-rays, (colloquially referred to here as H-rays because it's Hirsch's theory).

A superconductor can be rapidly transitioned back to its normal state by placing it in a strong magnetic field.  My experiment will look for H-rays emitted by both a Pb and a YBCO superconductor when it is quenched by a strong magnetic field.
This series of articles chronicles both the experimental lab work and the theory work that’s going into completing the experiment.

The lab book entries in this series detail the preparation and execution of this experiment… mostly.  I also have a few theory projects involving special relativity and quantum field theory.  Occasionally, they appear in these pages.

Call for Input
If you have any ideas, questions, or comments, they're very welcome!

References

1.  Hirsch, J. E., “Pair production and ionizing radiation from superconductors”, http://arxiv.org/abs/cond-mat/0508529 

Wednesday, July 30, 2014

Leak Detector Down but Not Out, Code Crusher Code Objectified! Lab Book 2014_07_29


Alternate Title:  How Could Something So Pretty be So Broken?

Summary
It finally became too cumbersome to work with the can crusher simulation code in script form.  the bulk of this morning was spent in meetings and reworking the can crusher code to be object oriented.  The object oriented refactoring was completed and tested and works great!  It’s now very easy to run multiple simulations and compare their results.  The next step is to write code that runs the simulation to the peak current point and then plots the magnet field in on a spherical surface that will correspond to the surface of the superconductor Pb sample being used.  There are other simulations that need to be done as well.  For example, finding out how the current traces change when the temperature of the material is 4.2 K, the temperature of liquid helium.

The leak detector problem has been isolated.  The Pirani gauge that measures the vacuum on the diffusion pump side of the system has burned out.  Since it shows no vacuum in its burned out state, the diffusion pump is never turned on by the leak detectors control logic.  The Pirani gauge is literally a light bulb with the top cut off and its measured resistance varies as a function of the pressure of the air the bulb is immersed in.

Scroll down for background on the experiment.
Can Crusher Code
Moved the can crusher code implementation to object oriented from the Python script based version.  The code is now much easier to test with the ability to instantiate multiple simulations to compare results. 

Vacuum Leak Detector Work
The thermocouple gauge was attached directly to the gauge port on the liquid nitrogen trap.

The gauge that was is installed on the liquid nitrogen trap during normal operation is an Alcatel PI 1, see picture below.  This is a pirani sensor and may be the source of our problems.  For more information on the sensor, see http://dalibor.farny.cz/helium-leak-detector-running/  and https://en.wikipedia.org/wiki/Pirani_gauge


The bulb should have a cold resistance of 70 ohms.  Ours measures as an open circuit.  It seems the bulb is burned out.

Background
Hirsch's theory of hole superconductivity proposes a new BCS-compatible model of Cooper pair formation when superconducting materials phase transition from their normal to their superconducting state[1].  One of the experimentally verifiable predictions of his theory is that when a superconductor rapidly transitions, (quenches), back to its normal state, it will emit x-rays, (colloquially referred to here as H-rays because it's Hirsch's theory).

A superconductor can be rapidly transitioned back to its normal state by placing it in a strong magnetic field.  My experiment will look for H-rays emitted by both a Pb and a YBCO superconductor when it is quenched by a strong magnetic field.
This series of articles chronicles both the experimental lab work and the theory work that’s going into completing the experiment.

The lab book entries in this series detail the preparation and execution of this experiment… mostly.  I also have a few theory projects involving special relativity and quantum field theory.  Occasionally, they appear in these pages.

Call for Input
If you have any ideas, questions, or comments, they're very welcome!

References

1.  Hirsch, J. E., “Pair production and ionizing radiation from superconductors”, http://arxiv.org/abs/cond-mat/0508529 


Tuesday, July 29, 2014

SageMath, Where Objects Rock and Scripts Don't

I moved the Sage simulation of the can crusher to an object oriented implementation today.  A few days ago,I was worried this might have been a bit of overkill and just a subconcious desire on my part to place the project in a code format I'm used to seeing things in.  I hit an example yesterday that convinced me otherwiser, and only a few short, OK,  and somewhat grueling, hours later, I had a much easier to use OO simulator.

Prior to yesterday, my usage mode of the can crusher code was as follows:
1.  Evaluate the cell that contained the initializaiton code.  There were some declarations of global varaibles and a little bit of code that atually ran on evaluation to place values in these variables.
2.  Evaluate the cells that contained the current calculating function and the can moving function separately.
3.  Evaluate the cell that contained the simulation code.

This, as far as I knew had to be done every time I wanted to change any values and run a simulation.  I was constantly worried that I might not evaluate the cells in the correct order or that a rogue global variable might escape initialization.

The clincher came when I wondered if there was a difference between the simulated current through the driving coil when the can was allowed to crush and when it was not.  In order to do this, I had to execute the above procedure, then, copy the results of the global current array into a placeholder array, then modify the simulation code, then run the above procedure again, and finally graph the new global current array and the placeholder array on the same plot to get the following result


Contemplating the stress of wondering what I had called my placeholder variables and whether or not I'd run through the initialization procedure correctly every time led to this morning's object oriented re-write.  What I wound up with was a simulator object that encapsulates all the initialization procedures and its own set of member variables that correspond to the previous set of globally available variables  Now, to create a comparison like the one shown above, I can just create two simulations, passing both of them the same limit for the number of simulation steps to run, but tell one of them to turn the can moving portion of the code off, like so, (my simulator class is named Crusher):

nm_crushtest = Crusher()
nm_crushtest.set_movecan(False)
nm_crushtest.simulate(372)

crushtest = Crusher()
crushtest.simulate(372)

After the simulations have run, the graph is easy to generate:

nomove = list_plot(nm_crushtest.coilOutTime[0:372, 0:2], color='red')
move = list_plot(crushtest.coilOutTime[0:372, 0:2], color='blue')
show(nomove + move)


The Grueling Bit
If you're coming from a C++ background, the only part that will drive you nuts is having to put 'self.' in front of every member variable every time it is used in the class definition.  I still think I must have been doing this wrong and hope that I kind Python expert will correct my gruesomely bad coding style soon.

References:
1.  The Python object oriented documentation
https://docs.python.org/2/tutorial/classes.html

2.  Upcoming useful docs: How to handle large +Sage Mathematical Software System programs
http://www.sagemath.org/doc/tutorial/programming.html

3.  The can crusher simulator in it's many revision controlled incarnations
https://github.com/hcarter333/cancrusher