User:Brian P. Josey/Notebook/2010/04/30

{| width="800"
 * style="background-color: #EEE"|[[Image:owwnotebook_icon.png|128px]] Project name
 * style="background-color: #F2F2F2" align="center"|  |Main project page
 * style="background-color: #F2F2F2" align="center"|  |Main project page


 * colspan="2"|
 * colspan="2"|

Code Update
I have been updating the code I developed in MATLAB that I use to analyze the models I generate in FEMM. While the original version of my code worked, I felt that I could do it better now that I know more about the software, and there were some new features that I wanted to include, and have readily available. Here are the changes that I made:


 * The program now focuses in on a width about equal to twice the thickness of a centrifuge tube wall
 * Graphs now include markers to show where liquid would exist in flow cells and a tube
 * I can now graph force as a function of length
 * I've included a way to determine average magnetic field, derivative and force
 * I am working on a way to calculate the terminal velocity of a ferritin in water

Field of Control
Here is a graph of the field of my control, my complex model of the magnetic yoke, as a function of length:



In this graph, the field,y-axis, is measured in Tesla, and the length, x-axis, is measured in inches. In total, the graph, and all the others on this page, runs from the inside of the cover slip on the flow cell to about twice this thickness of the wall of one of the micro-centrifuge tubes. This of course assumes that the flow cell is pressed up against the cone on the left. The vertical red line is where the slide would begin, so between the left end of the graph and the red line is where the liquid would be in a flow cell. The vertical black line represents the inside edge of the centrifuge tube, so everything to the right of it is where the liquid would be in the tube. A quick glance shows why I've had more success with flow cells than I have with centrifuge tubes, there is a greater field in the flow cells.

Derivative of Control
Here is a graph of the derivative of the above graph:



I need the derivative of the field to calculate the force, and one thing that is really annoying me is that the derivative is not smooth, like the graph of the field is. I have no reason to believe that this much noise is necessary from the data, and I would assume that it would be a continuous function. I use the Euler derivative I learn in class to calculate the derivative of the function. To counter the noise, I created a very small box in my FEMM model, just larger than the width of the graph and the tip of the cone. In this box, I cut the mesh size down substantially, to 0.0005, and grabbed a decent number of points to work with, 150. I had hoped that the smaller mesh size, and more points than I had before, 36 by the way I processed it, would have removed all this noise. Unfortunately that isn't the case and I have to keep thinking about it. I've been thinking about smoothing operations and talking to Koch about which ones he likes. Either way, it is clear that there is a greater derivative near the tip of the cone, to the left, than away from it. This makes physical sense because it implies that there is greater force near the tip.

Comparisons
I had hoped to definitively prove the worth of the yoke, which I am convinced of, but I do not have a complete set of data to support it yet. Recoding sidetracked my effort to prove this point, and I will return to it next week.

One thing that I was able to do was graph the difference between the field and derivatives between the magnetic yoke, and another simulation. This second simulation consists of a cone magnet pointing at the cover slip of the flow cell, and the two small cylindrical magnets on the other side of the flow cell. When I analyzed my data, I was able to generate this graph, which is the field of the second model subtracted from the magnetic yoke.



As you can see, because all the values are positive, the magnetic yoke has a stronger field across the whole length that I measured. There is still noise that is popping up from how FEMM creates the data, or from how I analyze it. Either way, I was also able to graph the percent difference as a function of length:



Here it is clear that the magnetic yoke has a field that varies between about 12% and 19% greater than the field of the cone and cylindrical magnets flanking the flow cell.

Here is a graph of the difference in the derivative between the magnetic yoke and the simpler model:



As with all of my graphs, I have positive values indicating that the magnetic yoke has a greater derivative. Of course, with all of the noise, it is clear that this graph is junk. The wildly varying difference is the result of the noise in the derivative. I am working on a way to smooth out the derivative graphs so that things like this don't keep happening.

Force
With my new code, I was finally able to determine the force that an individual ferritin molecule would feel in one of my magnetic fields. I approached this two different ways. The first was to multiply the magnetic moment, and a conversion factor to change inches into meters, against the derivative. For the magnetic yoke, this created this graph:



Here the force is measured in femto-newtons, (fN or 10-12 N). And because the graph has the same shape as the derivative graph, it checks. I used the magnetic moment of 13,200 Bohr magnetons, or 1.22417 * 10-19 J/T, for the ferritin and determined the force for a single ferritin protein.

I determined that over the width of the flow cell, the average force acting on a ferritin molecule in the magnetic yoke is 0.238 fN, compared to 0.226 fN for the simpler model. While this suggests that the force is stronger with the yoke than without it, the problem is that the graph of the force is not smooth, and a quick look at the area representing the flow cell reviels a large spike in the data. So I until I can generate smooth derivatives from the data, I will not use this number in my calculations. It does however give me an idea of the scale of the force. Koch's notes mentioned that he had calculated a force of about 1 fN for magnetoferritin, which suggests that a force on the scale of a couple tenths of a fN is reasonable.

Terminal Velocity and Smoothing
There were two things that I wasn't able to complete today that I will finish next week: terminal velocity of ferritin and smoothing of the derivatives. I've already argued why I need to do the smoothing. I want to calculate the terminal velocity of the ferritin moving in the water to determine how fast it could move on its own, or in a cell. This will be very useful down the road.


 * }