nse out, now bibtex

I sent my prof.  my version of the manuscript. Now I’m trying to get the proper citations for Nuclear Science and Engineering with bibtex. I’ve been running into Charles Karney’s physics journal bibtex styles, but I haven’t gotten them working yet. They say to run them through the c preprocessor to get different styles, but I just get errors like:

physics.bst:9:19: warning: missing terminating ‘ character

physics.bst:3484:7: warning: extra tokens at end of #else directive

Ah. This is because cpp has decided that it shouldn’t be used for processing anything besides actual source code. Well, thankfully they left in the -traditional-cpp option. So if you use

cpp -P -traditional-cpp physics.bst nse.bst

It will actually work. That’s excellent. This is nice.

[1] C. Tzanos, E. Gyftopoulos, and M. Driscoll, “Optimization of Material
Distributions in Fast Reactor Cores”,    Nucl. Sci. Eng.  52, 84 (1973)

Here’s a nice cheat sheet for VIM. I’m using it to capitalize the first letter of each word in my bibtex.tex file. I’m sure the bibtex style can do this but I’m not bothering.

Here’s the final product: nse.bst

UPDATE: I put double quotes around article and techreport titles, as discussed here.

Also, fonts from my LyX install were really fuzzy when printed. I went into document settings and changed font family to Roman and set font to Latin Modern Roman and now the fonts don’t get fuzzy when you zoom in so I’ll assume they don’t get fuzzy on print either. Let’s hope not.

I also just added a reCAPTCHA plugin to this blog. It works. My simpleCAPTCHA plugin wasn’t showing the image, nor was it even showing up in the plugin list. I renamed the simple-captcha folder in my plugins folder and now recaptcha is in charge.

I need to call Jeff soon to tell him he’s publishing this.

thorium workshop, 2nd iteration

I’m at the thorium workshop here at school. There’s a guy from Thor power in Norway giving a talk. It’s interesting.

Fleming just suggested BeO as a moderator in a Th reactor. It’s diffusion length is just right (more than water, less than graphite), it won’t burn like graphite in air, and it increases your beta-effective with it’s delayed photoneutrons and stuff. I should tell will this.

But I’m actually working on BP stuff. I ran the BP search before the TRU search on the 2nd iteration of case 2. The BP search direction is loading correctly now, but it’s not covering the full power peak. I’m going to get power plots that correspond to the search direction plots now. It was very simple to do with my plotSearchDir2 function. (I have a good library I guess). It’s very useful to see these two together, layered on top of each other with the compiz fusion opacify functionality. Wow.

My mpeg4 povray videos didn’t work on JCLs mac computer. I’ll have to look into that. Ah, mac’s don’t support the avi container. I did this:

ffmpeg -f mp4 -vcodec mpeg4 -i case3-flyby.avi case3-flyby.mov

to convert it to quicktime and sent it to him to see if it would have worked. It did.

There are asymmetries that show up in the 2nd iteration of the v4 case. They’re worse in the 3rd iteration. None help the peaking factor. What the heck. Should have gotten 1/3 core model to work. Must finish manuscript. Will stick with 1st iteration.  Damn damn damn.

second iteration, screen magic, new line search

First thing I did this morning was install the AntiBotQuestion mod in my phpBB3 forum for whatisnuclear.com. Spam bots were getting in so I had to shut them down. Unfortunately it didn’t stop guest posts, but I went to the forum and found an extra few lines to add and now it seems to work. Only issue: if you get the captcha wrong, the anti-spam question doesn’t show up in the re-try page. I’ll try to narrow that down later.

I got a nice plot of the 2nd iteration search direction for case 3. It didn’t yield any improvement, however. That’s too bad, or good. Apparently my linesearching is phenomenal. Maybe I should run a few cases of CORTANA BEFORE doing BDT.

Concerns about the BP search not doing anything persist. As expected, the class 1 enrichment increases each time I add BPs. This increase obviously counteracts the effects of the BPs, but it should at least bring the peaks at BOC and EOC closer together. Ope, I noticed the HF concentrations are all identical. Let’s make them natural. Which Hf isotope is the best absorber? Off to the NNDC. According to my chart of the nuclides, Hf-174 is 0.16%, 176 is 5.%, 177 is 18.%, 178 is 27.&, 179 is 12%, and 180 is 35.% Here are all their cross sections:

Hafnium isotopes absorption cross sections
Hafnium isotopes absorption cross sections

Jeff talked about Europium a lot. Here’s a comparison of The two natural isotopes with some of the better Hafnium ones:

Absorption cross-sections of Hafnium and Europium
Absorption cross-sections of Hafnium and Europium

Yeah that Eu-151 is pretty rocking. Given more time, I would put that in. For now, I’ll either admit that the BP searches didn’t do anything, or leave them out completely.

Time to give Professor his slides. If you import EPS into GIMP, make sure to turn the anti-aliasing filters on. OK sent them off. I went up and talked them over with him and he gave me a few tasks:

  1. Switch TRU enrichment one high means add and low means take out. I thought this was done already. Check negative jump. Yeah, in positive jump parameter cases, the search direction is switched by the line search, but the plots will still be wrong. Need to swap them in plotting too for intuition.
  2. Do a fly-by animation. YES! This is going to be hilarious. It’s rendering now. I’ll put it on youtube soon. (here it is)
  3. Remove empty hexes in the core map image.

While doing this, I realized that the BP search and TRU searches shouldn’t be switched from each other. It just worked out that way because they’re both accomplishing the same work. It’s on the 2nd iteration that the BP search might make more sense. All I have to do is work on my line search parser, making it that it reads old controls and updates them rather than making a whole new set each time. hmmmm. Exciting. This also explains why the BP search isn’t doing much. It’s not changing things in the right places. Let’s design a new line searcher

New Line Search Ideas

Currently, we have binned regions based on search directions to have values centered around 1.0, with min and max of  0 and 2. Additionally, the BP line search has the capability of setting any value less than a certain cutoff to zero. Both TRU enrichment modification factors and BP EF priorities get set directly to whatever is in these bins. This makes good sense for the first iteration, where everything is set to 1.0. But in subsequent iterations, these values should represent percent changes in the current value. So if we have a 1.05, increase the current value by 5%. That’s pretty easy.

I’m starting these changes on revision 10. Will start with BP search because it doesn’t work well anyway. Hmm, it’s not so simple as to just doing this multiplication though, because if I want to just increase the size of the feed each time, I don’t want the priority distribution changing. Obviously, I want to separate increase feed size into a different function. Duh.

Linux screen utility wonder

I did learn that I’ve been using screen wrong the whole time. You should only start a screen session once! Not once for each window. Press Ctrl+a, A to name your window, Ctrl+a, c to react a new window, Ctrl+a, ” to list all windows…. etc. How great is that. Productivity just increased. Here’s where I read about it.


Back to work on the same old. I figured out the grayscale images yesterday, but I still need to generate them for all the new uranium cases that don’t have thousands of kg of Hafnium in them. Additionally, I’m going to add a picture of the adjont source in the 1-D slab. Will need to try to make it eps. On it. Running the analytic oned solution now. I chose search and will see what we get. It’s been a while since I ran this code. OK I got a decent plot out. I used TeX text processing on it and it looks phenomenal. Now to generate the B&W ones for three cases…

In case 1, the 0-th timestep jump parameter is negative, so we need to switch the sense of all search directions. Run.py can handle that now, with the N option, for “negative.” That’s revision 8 in the itd svn repository. Rerunning v6 case with proper sense. Let’s see if we can do better. With improper searching, we started at peaking factor 1.05038 and got to 1.04 by bp search, and to 1.039 by end of BDT. Lame.

Uhh. I just spend 1.5 hours with MCNP crap for a student in my class. Why are we struggling with MCNP when we should be learning reactor analysis? Damn another hour with the class! These guys are killing me.

Well here’s some instructions I just made for doing safety analysis of SFRs in REBUS or MC**2:

<!– @page { margin: 0.79in } P { margin-bottom: 0.08in } –>

Disabling the criticality search in REBUS

by Nick Touran

If you want to perform any kind of basic void coefficient, Doppler coefficient, or temperature coefficient of reactivity estimations in REBUS for fast reactors, you have to disable the criticality search. Here’s how.

  1. Run your regular base case of interest. Look at the output for the final value of the enrichment modification factor. You will find a edit like this near the bottom:


+ +


+ +




Note the factor. You need to put it into your perturbed file.

  1. Make a new rebus and MC**2 case with the perturbations you wanted. Decrease the sodium density, decrease the fuel density, eject a control rod, whatever.

  2. In that new rebus input, go to the A.BURN card 4. You should see a 1.000 representing the desired k-eff at EOC. After that, there is a convergence criterion, probably set to 0.0001 or so. Change it to 1.000. This disables the criticality search.

  3. The last two numbers in that same line are the first and second guesses of the new enrichment modification factor. Change the first one to the factor noted from the previous output file. Keep in mind that you can only put this number between certain columns. Check the manual to see which ones. Be careful with this!

  4. If there is a burn cycle time search enabled as well, disable it in the same manner (on card 3 though) and insert the burn step time manually!

  5. Now criticality search is off and you’ve manually set the critical class 1 enrichment. You’re ready to run. Run your new rebus case and compare k-effs with those from the base case.


If you change a density somewhere, make sure it changes in the cross section library calculation too! The energy self shielding can vary wildly with different densities.

This method of calculating safety parameters should be taken with a grain of salt because it does not account for any anisotopies that you may see in real rod ejection accidents, etc. Diffusion theory is only an approximation of transport! Try using some perturbation theory codes like VARIANT if you want better results.

Have fun!

OK. What else? The new line search behaved very well. But in v5, the big case, the reactivity swings are all miniscule! 1.001 at BOC? Say what? Investigating. The core is breeding plutonium. It’s a breeder. Ah! Well the plenum had the wrong material, it looks like. I fixed it in the CORTANA input maker to agree nicely with the Hill cases of old and am now re-running just the first rebus case. This large case requires a very low guess of the enrichment modification factor.

jacobi-free newton-krylov methods, macarthur foundation, rebus

I just went to a talk this morning by D.A. Knoll about the Jacobi-free Newton-Krylov methods he’s been working on at INL. He’s eliminated the need for operator splitting with his formulation, and thus gained Newton-like convergence on problems that usually don’t have anywhere near that speed. The trade-off is that in preconditioning, you still have to use the low-order operator if you want any real efficiency. So, for instance, you’d use the power iteration to precondition the Newton-Krylov version of solving a k-eigenvalue problem. This solves many problems with discretization and provides what he called “scale bridging.” I’m wondering if this could help with my thesis idea of depletion perturbation theory. I need the harmonic eigenfunctions of a time dependent diffusion system. Hmmm.

Knoll is talking about this stuff at this year’s M&C. He has a 2004 survey of the topic in Journal of Computational Physics.

On a more fun note, I asked Fleming about the whole 4n+0 ($$4n+0$$) radioactive decay chain terminology for the Thorium decay chain. A more self-descriptive name of this would be $$A%4=0$$, as this is what it’s actually trying to say. The A value of Th-232 is perfectly divisible by 4. Since alpha-decay is the primary mode of changing A in radioactive decay of these heavy elements, and all alpha decays change A by exactly 4,  all nuclides in the decay chain will have the same modulo with 4. Thus, the Thorium-232 decay chain nuclides all have zero modulus with 4. And since A=238 of U-238 has a remainder of 2 when divided by 4, the U-238 chain is called 4n+2. U-235 has a remainder of 3 when 235 is divided by 4, so the U-235 chain is 4n+3. And so on. Apparently, this his how high schoolers used to be taught about radioactive decay. Now that I look harder, this is well documented on wikipedia.

Whoa. REBUS is totally messing up again. I have an external feed, EFB set to size 0 that only contains Hafnium, but there’s a bunch of hafnium showing up in my simulations. This is not OK. I could have sworn this model was working properly. Oh, I bet I know what was happening. I think REBUS doesn’t let you use 0.0 for an external feed size. This perfectly explains the large jump in behavior I was observing once I started the BP line searches! So for the initial run, I’ll need to put in 1e-10 as the external feed size. Testing this now. On the bad side, we’ll surely see less impressive optimization results now, since there were thousands of kilograms of Hafnium in each initial run. Damn. Yup, sure enough. Set EFB size to 1.0E-10 and it behaves correctly. Now to rerun all again.

JCL got back to me on the manuscript. We need more words, so I’ll go through and try to beef it up.

web page, REBUS

OK I got the forum up and running. It’s at http://www.whatisnuclear.com/forum/. We actually have 2 interesting posts. Well, OK I did send it out to ne-gradstudents. There was a request months ago for something like it and I just decided it was a good idea. I expect it won’t get much traffic.

Two lame things I struggled with:

1) Changing the color scheme in the phpBB3 application for the prosilver theme almost drove me crazy. It stores CSS data in the database, so when you change the CSS files, the theme is not updated. I tried switching the CSS data to be stored in the file system, but then I couldn’t change any images! It was horrible, until I realized what was going on. The prosilver theme requires the CSS be in the database because all the template files point to database variable locations. So the trick is, keep it all in the database, but edit the load settings in General -> server settings and turn Recompile stale style components to yes. Then, edit the CSS file and your changes will actually propagate. That took me forever to figure out.

2) My favicon.ico got reverted to the basic favicon.ico from hostmonster. I tried putting my version in my main folder but it wouldn’t change back. I even got a firefox plug-in that’s supposed to refresh the icons. Then I found that it has to be a windows icon, so if you create it with the GIMP, you have to follow these instructions. And it worked when I went to my site in my VMs, but my main firefox icon has not refreshed yet! I expect it to soon. I guess the plug-in isn’t working.

As for research, the equilibrium line-search I was running had 0.0 EOL peaking factors! I guess I forgot to propagate the changes. Will rerun soon. Hmm, just changing the peak fast fluences flag didn’t help. Trying A.BURN card. Yup that did it. The last two lines in card 02 of A.BURN should be 1 in this case. The peak fluence flag doesn’t matter. That makes more sense.

And in other news, my Dad read a book called The Black Swan. He made my ask Karl what he thinks about it out there in Berkeley. It’s arguing that the bell curve doesn’t work for things it’s been used for, like economies and whatnot. Here’s a blurb from the book [pdf].

It’s a nice day today so I went out on the roof with Adrienne and Alex. I got the idea to take a panoramic photo from the top and it got me working on photostitching in Linux. So I did some searching and found that Hugin sounds like the way to go. I got it out of the Ubuntu repository, put some control points in (fairly easily), and then tried to make the image but it complained that enfuse wasn’t found. So I downloaded it and ./configure and sudo make; make install ‘d it. While doing so, I had to get lots of libraries out of the repos, including boost development libraries and one called libxmi that I got from here (manually). I learned that you need more than 1 control point, or else it spins your images around and makes a big mess. But soon, I made a beautiful panoramic that is stitched together very nicely. Cool.

Uploading large files to gallery2 required that I go into my php.ini in the main folder and change

upload_max_filesize = 2M to 20 M. Then it uploaded no problem.

Hot Tub Controller

So, I have to tell you about the hot tub project. It’s been going on for a few weeks now and we just basically finished it. I (with some help from Jesse) have set up a microcontroller to control and monitor the hot tub. We have a temperature sensor mounted on the heating element tube and we wired in a relay to control when the heater turn on. Then we wrote code to allow it to interface with email, the internet, and even text messages! For real. Look:

Text message from the hot tub
Text message from the hot tub

Haha! Here are some more gems:

Temperature plotsand you can control it with this form:

control_formOr you can just control it from the command line:

terminalSo here’s what’s going on. Firstly, there’s an arduino connected to a USB port of the computer in the basement. Here’s a pic:

ArduinoOne of the digital pins on the Arduino is connected to a OneWire bus with three temperature sensors hooked up to it with a pull-down resistor connecting the bus to the 5V line. That’s the green wire. The ground is white ground.  The three sensors are hooked up (in parasite power mode) to 30 feet of indoor/outdoor CAT-5 wire from Home Depot. I surrounded each temperature sensor with a piece of 3/8″ O.D. copper tubing (which is miraculously already corroding) and pinched them down and sealed them up with Silicone. Here’s a pic of the outdoor sensor.

Outdoor temp sensor in copper

Anyway, yeah. The last sensor, the one on the tub, is wrapped in lots of insulation from the hardware store to try to keep the outdoor temperature from affecting the hot tub readings.

On another digital pin (the orange wire), we have a relay circuit that we can turn on and off easily. In the hot tub, it connects the wire that connects the coil of the main heater relay. So it’s  a relay for a relay, effectively. We just set the temperature dial very high and use the Arduino to cut it off when we want. We got the circuit from here. Here’s a copy of that:


Nice. I used a relay that can handle up to 30A, 240V, with a 12V coil. I got the 12V by splicing off of the hard drive power cable inside the computer (blue wire, with white blue as ground. That’s the same ground, but we didn’t want to tap into the fragile cat5 wire again). That’s unfortunate because it requires the computer be on to have the heater on. A better design would not rely on the computer to maintain control of the hot tub.

The rest of it is just software. I’m using the pySerial module to read and write to the USB tty device in 32-bit Ubuntu 8.10 Linux. The code that I compiled on the Arduino chip simply accepts simple characters through the serial port and does as asked. It knows how to turn heater on, off, read temperatures, and tell whether or not the heater is on. I’ll build some safety logic in soon. Right now, all the control logic and communication is done in Python on the computer. I have an Arduino class that abstracts the commands the Arduino knows. Then there’s the hottubController class that checks the sensors and turns the heat on and off accordingly. It calls the communication class, that checks for commands in an IMAP email account, submits temperature information to a MySQL database on my server, and sends command responses via SMTP. The text messaging functionality works simply because you can easily use the text-to-email gateways used by many major phone companies. The MySQL stuff is done with the MySQLdb python module, which is fairly simple.

The web form is a python cgi that makes that simple HTML table and sends the commands in. The plotter is another python script that reads the database and puts the data into an HTML file, which is then parsed by the flot JavaScript plotting routines on the clientside, allowing zooming and dynamic date x-axis labels, which are awesome.

Still to come: predictive hot tub times. Since the heating is very linear, it’s possible to extrapolate the time at which the tub will reach a given temperature. You’ll get a text that says: “the hot tub will be ready at 10:37PM” How cool will that be at the bar?

With all the copper, casings, arduino, sensors, relays, silicone, insulation, and various other tools I bought during this, it’s up to about $100, not including the computer. Not bad!

More Details

In case you’re wondering or debugging the hot tub controller, here are some more details.

The breadboard setup for the hot tub controller
The breadboard setup for the hot tub controller
Here's what the arduino wires look like. Nothing special.
Here's what the arduino wires look like. Nothing special.

Out at the hot tub, you’ll see a silver toggle switch. Under normal operation, this should be in the center position. To shut down special features and go back to plain-old hot tub, put the switch in the up position. This gives control of the hot tub back to its internal thermostat. It also disables the 10 second heater delay relay.

Too much information

I do a lot of stuff each day, and then forget most of it. Sometimes I learn something, sometimes I get a thesis topic, sometimes I do a fun project or have a nice thought. I think a wordpress page might help me organize and remember what I do with my life. That’d be nice.

Today, I spent most of the day making a new webpage for whatisnuclear.com. You can find it at http://www.whatisnuclear.com/articles/recycling.html

Since Obama zeroed out the funding for Yucca mountain, Prof. Fleming, Kearfoot and I think it’s a great time to start recycling. I made this page to help explain exactly what that means and why it’s good.

I then went to Sweetwaters and got some Chai with skim milk. It was delicious! I opened up the lappy laptop and worked on my single goal of the evening: plotting search directions in a manner similar to the input maker. I searched for some kind of wxPython colormap, but didn’t find anything and then luckily found that Matplotlib has all the capability I need. Using the scatter function, you can specify hexagon symbols with arbitrary angles. Excellent. Check this plot out:

Burnable poison search direction for timestep 0
Burnable poison search direction for timestep 0

Yeah. That’s excellent. Now I just have to figure out how to get it to size automatically.

Ceris brought a recent The Economist over with some legalization of drugs propaganda. They’re position has been to legalize the drugs, and spend the billions on treating addiction instead of jailing recreational users. I agree. It had other articles that caught my interest, specifically some on the clean coal myth, solar collecting balloons, and devices that charge wirelessly. That got me thinking that my camera batteries never charge anymore. So I went online and bought a well-reviewed charger, thinking that maybe my Ni-MH chargers are both defective, since all 12 of my batteries don’t last in my camera anymore.

I watched the rest of RENT last night with Adrienne and dumpster girl. I never knew what it was about. I kind of liked it, although I don’t have much profound thought about it. It’s been a lazy weekend. The most important accomplishment was the completion of the hot tub controller project. More on this once my camera works again.