Tuesday, January 3, 2012

Nuclear Politics Prior

One of the recurring themes of Climate Resistance (which I've mentioned approvingly before) is that the politics around the solutions proposed for climate change are prior to any consideration of the science of the environment (or the more interesting question Lorenz asked about the existence and uniqueness of long-time averages of the earth's weather).

This state of politics prior is unavoidable, and therefore not unique to the field of climate policy. I think this talk by Kirk Sorensen on the history of US breeder reactor development provides another good example.

The policy maker (Nixon in this case) picked the solution based on desired political outcomes (jobs and lucre for politically useful districts). "The Science" was merely a part of the marketing and public relations campaign for that choice. Dissenting scientific positions (the molten salt folks in this case) were suppressed with "Rickoverian dedication".

See this extensive remix for lots of info on LFTR.
"There's been a very bipartisan approach to scaring the public." Kirk Sorensen (~1:20 or so)
"The whole aim of practical politics is to keep the populace alarmed (and hence clamorous to be led to safety) by menacing it with an endless series of hobgoblins, all of them imaginary." H.L. Mencken

Monday, January 2, 2012

Setting up a project on Github

I've been an SVN user for a while, but it seems like more and more projects are going distributed version control systems like Git so I wanted to learn how to use Git. I found this crash course on Git for SVN users which provides a useful Rosetta stone, and this warning:

SVN is based on an older version control system called CVS, and its designers followed a simple rule: when in doubt, do like CVS. Git also takes a form of inspiration from CVS, and its designer also followed a simple rule: when in doubt, do exactly the opposite of CVS. This approach lead to many technical innovations, but also lead to a lot of extra headscratching among migrators. You have been warned.
This sounds a lot link Linus Torvalds' talk, WWCVSND: What Would CVS Not Do?

Github has a set of steps for setting up on linux. Git comes in the Fedora repos (and probably every other repo), so install is easy. A nice bit of documentation that comes with the install is Everyday GIT With 20 Commands Or So.

Since I already use password-less ssh to hop between the boxes in my little network, I didn't move my old public key as in the instructions. I created a config file in the .ssh directory containing these lines:
Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh/id_rsa_git
TCPKeepAlive yes
IdentitiesOnly yes
Where id_rsa_git.pub is the key I uploaded to github. Authenticating to github is then just:
ssh -T git@github.com
Then you accept their RSA key like you would for doing any other ssh login.

The next thing is to create a repo. Clicking through the instructions brings you to a page with several "next steps". Which for my example are:
mkdir FalknerSkan
cd FalknerSkan
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:jstults/FalknerSkan.git
git push -u origin master
Which gives some output ending in something like: Branch master set up to track remote branch master from origin.

If you'd like, you can read up on the Falkner-Skan ODE at the viscous aero course on MIT's OCW:

Sunday, January 1, 2012

Now you have N problems

(10:40) It's not that regulators don't understand information technology, because it should be possible to be a non-expert and still make a good law. MPs and Congressmen and so on are elected to represent districts and people, not disciplines and issues.

That couple of sentences reminded me of a recent post on single-issue advocacy by Roger Pielke Jr. So, in that spirit, here's a fun word game: How applicable is Doctorow's criticism if you substitute "climate" for "copyright" below?

(22:20) But the reality is, copyright legislation gets as far as it does precisely because it's not taken seriously, which is why on one hand, Canada has had Parliament after Parliament introduce one stupid copyright bill after another, but on the other hand, Parliament after Parliament has failed to actually vote on the bill. [...] It's why the World Intellectual Property Organization is gulled time and again into enacting crazed, pig-ignorant copyright proposals because when the nations of the world send their U.N. missions to Geneva, they send water experts, not copyright experts; they send health experts, not copyright experts; they send agriculture experts, not copyright experts, because copyright is just not important to pretty much everyone!
Canada's Parliament didn't vote on its copyright bills because, of all the things that Canada needs to do, fixing copyright ranks well below health emergencies on first nations reservations, exploiting the oil patch in Alberta, interceding in sectarian resentments among French- and English-speakers, solving resources crises in the nation's fisheries, and thousand other issues! The triviality of copyright tells you that when other sectors of the economy start to evince concerns about the internet and the PC, that copyright will be revealed for a minor skirmish, and not a war. Why would other sectors nurse grudges against computers? Well, because the world we live in today is /made/ of computers. We don't have cars anymore, we have computers we ride in; we don't have airplanes anymore, we have flying Solaris boxes with a big bucketful of SCADA controllers [laughter]; a 3D printer is not a device, it's a peripheral, and it only works connected to a computer; a radio is no longer a crystal, it's a general-purpose computer with a fast ADC and a fast DAC and some software.

Full Transcript

Sunday, December 18, 2011

Fedora 16 Install Notes

Notes on using the pre-upgrade method to go from Fedora 14 to 16 (yes, it's risky to skip a version). The reason for my upgrade is that Fedora 14 is now at end-of-life, I'd like to get FEniCS working, and some of the new spins look pretty cool.

One of the things I had to manually fix after reboot was the TexLive development repo (only 60% complete, estimated for Fedora 17). I had this activated to get the IJ4UQ styles to work.
yum remove texlive-release
rpm -i http://jnovy.fedorapeople.org/texlive/packages.f16/texlive-release.noarch.rpm
Manually remove some old conflicting packages (some from Fedora 12, yikes! I'm a lazy sys-admin).
List the repositories to make sure everything is pointing at the correct release version.
yum repolist
Sync things up.
yum distro-sync
I got this error: grubby fatal error: unable to find a suitable template. According to the forum I did,
mv /boot/grub/grub.conf /boot/grub/grub.conf.old
and then,
yum reinstall kernel
yum clean all && yum install texlive

The other problem I ran in to was with the hwloc package. I had to downgrade it to the 1.2.1 version, the 1.3 version seems to be missing the shared library needed by mpich and scotch.

Friday, December 16, 2011

McCain's Hangar Queen

Senator McCain's colorful statements about the F-22 are getting lots of coverage.

Another example of how flawed the Pentagon’s weapons procurement process is can be found in the F-22 RAPTOR program. When the Pentagon and the defense industry originally conceived of the F-22 in the mid-1980s, they intended it to serve as a revolutionary solution to the Air Force’s need to maintain air superiority in the face of the Soviet threat during the Cold War. The F-22 obtained ‘full operational capability’ twenty years later -- well after the Soviet Union dissolved. When it finally emerged from its extended testing and development phase, the F-22 was recognized as a very capable tactical fighter, probably the best in the world for some time to come. But, plagued with developmental and technical issues that caused the cost of buying to go through the roof, not only was the F-22 twenty years in the making, but the process has proved so costly that the Pentagon could ultimately afford only 187 of the planes -- rather than the 750 it originally planned to buy.

“Unfortunately, the F-22 also ended up being effectively too expensive to operate compared to the legacy aircraft it was designed to replace. It also ended up largely irrelevant to the most predominant current threats to national security -- terrorists, insurgencies, and other non-state actors. In fact, if one were to set aside the F-22’s occasional appearances in recent big-budget Hollywood movies where it has been featured fighting aliens and giant robots, the F-22 has to this day not flown a single combat sortie -- despite that we have been at war for 10 years as of this September and recently supported a no-fly zone in Libya.

“Politically engineered to draw in over 1,000 suppliers from 44 states represented by key Members of Congress and, by the estimates of prime contractor Lockheed Martin, directly or indirectly supporting 95,000 jobs, there can be little doubt that the program kept being extended far longer than it should have been -- ultimately to the detriment to the taxpayer and the warfighter. As such, it remains an excellent example of how much our defense procurement process has been in need in reform. We may fight a near-peer military competitor with a fifth-generation fighter capability someday, but we have been at war for 10 years and until a few months ago had been helping NATO with a no-fly zone in Libya. And, this enormously expensive aircraft sat out both campaigns.

“Moreover, as a result of problems with its OBOG (On-Board Oxygen Generating) system, which has caused pilots to get dizzy or, in some cases, lose consciousness from lack of oxygen, on May 3, 2011, the Air Force grounded its entire fleet of F-22s. While this grounding was lifted earlier this year, exactly why F-22 pilots have been experiencing hypoxia remains unknown -- but similar unexplained incidents continue.

“And then, there is the issue of the sky-rocketing maintenance costs to the Air Force in trying to sustain a barely adequate ‘mission capable rate’ for the F-22. Its seems that the ‘plug and play’ component maintenance features that were supposed to reduce costs for the Air Force over the life cycle of the aircraft doesn’t really play well. And, each time a panel is opened for maintenance, the costs to repair the ‘low-observable’ surface in order to maintain its stealthiness have made this critical feature of the aircraft cost-prohibitive to sustain over the long-run. Finally, it seems that the engineers and technicians designing the F-22 forgot a basic law of physics during some point of the development phase -- that dissimilar metals in contact with each other have a tendency to corrode. The Air Force is now faced with a huge maintenance headache costing over hundreds of millions of dollars-and-growing to keep all 168 F-22s sitting on the ramp from corroding from the inside out.

One thing is clear: because of a problem directly attributable to how aggressively the F-22 was acquired -- procuring significant quantities of aircraft without having conducted careful developmental testing and reliably estimating how much they will cost to own and operate -- the 168 F-22s, costing over $200 million each, may very well become the most expensive corroding hanger queens ever in the history of modern military aviation.

REMARKS BY SENATOR JOHN McCAIN ON THE “MILITARY-INDUSTRIAL-CONGRESSIONAL” COMPLEX

What bothers me most about the F-22 is not the maintenance problems, operational difficulties, or danger to air-crews. These require mere engineering fixes. What really bothers me is the damage these huge programs cause to rational risk assessment and national security.

"The reality is we are fighting two wars, in Iraq and Afghanistan, and the F-22 has not performed a single mission in either theater," Gates told a Senate committee last week.

Carlson ["We think that [187 planes] is the wrong number"], however, told a group of reporters earlier in the week that the Air Force was "committed to funding 380" of the fighters, regardless of the Bush administration's decision.

According to an Air Force official briefed on the Thursday rebuke, Gates telephoned Air Force Secretary Michael W. Wynne, who was on vacation at the time, to express his displeasure with Carlson.

The senior defense official said Carlson's remarks, reported Thursday by the trade publication Aerospace Daily, angered the Pentagon's top leadership, adding that they were "completely unacceptable and out of line."

Fighter Dispute Hits Stratosphere

That's not something that more money or more technology can fix.

Thursday, November 24, 2011

OpenFOAM and FEniCS Fedora Install Notes

Notes on installing OpenFOAM and FEniCS from source on Fedora 14.

Both projects implement ideas similar to A Livermore Physics Applications Language (NALPAL, why ALPAL): take high-level descriptions of partial differential equations and automatically generate code to solve them with numerical approximations based on finite-volume (OpenFOAM) or finite-element (FEniCS) methods.

Steps for OpenFOAM

  1. Install Fedora packages for paraview, cmake, flex, qt, zlib.
    [root@deeds foo]$ yum -y install paraview cmake flex qt-devel libXt-devel zlib-devel zlib-static scotch scotch-devel openmpi openmpi-devel
    You probably already have gnuplot and readline installed, if not, install those too.
  2. Unpack the OpenFOAM tarball:
    [jstults@deeds OpenFOAM]$ tar -zxvf OpenFOAM-2.0.1.gtgz
  3. Add the environment variable definitions to the bashrc file
    source $HOME/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc
    [jstults@deeds OpenFOAM]$ source ~/.bashrc
  4. Run the OpenFOAM-X.y.z/bin/foamSystemCheck script, you should get something that says, "System check: PASS", "Continue OpenFOAM installation."
  5. Go to the top-level directory, since you defined the proper environment variables that is something like
    [jstults@deeds OpenFOAM]$ cd $WM_PROJECT_DIR
  6. Make it
    [jstults@deeds OpenFOAM-X.y.z]$ ./Allwmake
  7. Various Consequences ensue...

Steps for FEniCS

Required components: Python packages FFC, FIAT, Instant, Viper and UFL, and Python/C++ packages Dolfin and UFC

  1. Install things packaged for Fedora
    [root@deeds FEniCS]$ yum -y install python-ferari python-instant python-fiat
  2. Download the other components from launchpad, and install using
    [jstults@deeds FEniCS]$ python setup.py install --prefix=~/FEniCS
    for the Python packages, and
    [jstults@deeds FEniCS]$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/FEniCS ./src
    [jstults@deeds FEniCS]$ make
    [jstults@deeds FEniCS]$ make install
    for the C++/Python packages (DOLFIN and UFC).

OR, do it automatically if you have root and internet access (I still haven't got this to work: a bit of buffoonery on my part, problems finding boost libraries).

  1. Download Dorsal
  2. Run the script
    [jstults@deeds FEniCS]$ ./dorsal.sh
  3. Execute the yum command in the output from the script in another terminal.
    [root@deeds FEniCS]$ yum install -y redhat-lsb bzr bzrtools subversion \ libxml2-devel gcc gcc-c++ openmpi-devel openmpi numpy swig wget \ boost-devel vtk-python atlas-devel suitesparse-devel blas-devel \ lapack-devel cln-devel ginac-devel python-devel cmake \ ScientificPython mpfr-devel armadillo-devel gmp-devel CGAL-devel \ cppunit-devel flex bison valgrind-devel
    I also installed the boost-openmpi-devel and boost-mpich2-devel packages as well. MPI on Fedora is kind of a mess. I added these two lines to my bashrc:
    module unload mpich2-i386
    module load openmpi-i386
  4. When the packages are installed, go back to the terminal running dorsal.sh and hit ENTER.

I ended up downloading the development version of dorsal to get the latest third-party software built, because it's so easy:
[jstults@deeds dorsal]$ bzr branch lp:dorsal
Pretty darn slick, Yea for distributed version control systems! Boo for dependency hell!

FEniCS is currently under heavy development towards a 1.0 release, so I expect to be able to build it on Fedora 14 Real Soon Now ; - )

Update: Johannes and friends got me straightened out.

Thursday, November 17, 2011

Qu8k Accelerometer Data

There was a pretty cool amateur rocket shot recently that was an attempt to win the Carmack micro-prize. The rocket is called Qu8k, designed and built by Derek Deville and friends. One of the stipulations of the prize is collection of a GPS location by the onboard avionics at an altitude above 100kft (as long as the velocity is low, this should theoretically not require an unrestricted GPS).

Of course, since the other stipulation of the prize is a detailed report about the shot and the data collected, this gives us number crunching nerds a neat data set to play with. Derek posted a spreadsheet of the accelerometer data, along with a simple first order integration (twice) to get velocity and altitude. I tried an FFT-based method to compare against the first order approach in the spread-sheet, and a second-order trapezoidal rule integration. The python script to do the integration and make the two plots below is on github.

The errors in the numerical integration are not terrible (the plots of the trajectories using the different approaches are indistinguishable in the eye-ball norm).

One of the cool things about Python is the array masking capability. That makes implementing the temperature ratio component of the 1976 US Standard atmosphere (to estimate Mach number) 7 lines of code.

Tuesday, October 11, 2011

Notre Dame V&V Workshop

The folks at Notre Dame are putting on a Verification and Validation Workshop. The preliminary agenda is up on the workshop site.
The purpose of the workshop is to bring together a diverse group of computational scientists working in fields in which reliability of predictive computational models is important. Via formal presentations, structured discussions, and informal conversations, we seek to heighten awareness of the importance of reliable computations, which are becoming ever more critical in our world.

The intended audience is computational scientists and decision makers in fields as diverse as earth/atmospheric sciences, computational biology, engineering science, applied mechanics, applied mathematics, astrophysics, and computational chemistry.
It looks very interesting. Unfortunately, I don't think I'll be able to attend. Hopefully they will post posters and papers. Update: I was able to attend. They will be posting the presenters' slides. I will put up some of my notes when they get the slides up.

Monday, October 3, 2011

J2X Time Series

I thought the intermittent splashing of the cooling water/steam in the close-up portion of this J2-X engine test video looked interesting.

So, I used mplayer to dump frames from the video (30 fps) to jpg files (about 1800 images), and the Python Image Library to crop to a rectangle focused on the splashes.
When a splash occurs the pixels in this region become much whiter, so the whiteness of the region should give an indication of the "splashiness". I then converted the images to black and white, and averaged the pixel values to get a scalar time-series. The whole time series is shown in the plot below.
Also, here's a text file if you want to play with the data.
Here's a PSD and autocorrelation for the section of the data excluding the start-up and shut-down transients.
Here's a recurrence plot of that section of the data.
This is a pretty short data set, but you can see that there are little "bursts" of periodic response in the recurrence plot (compare to some of the recurrence plots for Lorenz63 trajectories). I'm pretty sure this is not significant to engine development in any way, but I thought it was a neat source of time series data.