Unexpected results are good

It’s good to encounter results you don’t expect. Isaac Asimov famously said:

The most exciting phrase to hear in science, the one that heralds new discoveries, is not “Eureka” but “That’s funny…”

As you gain more expertise, you become better at anticipating experimental or numerical outcomes. But at the same time, research is exploration, which I think means regularly encountering things that don’t initially make sense. You have to pay attention to the story told by the data, and sometimes your biased expectation gets in the way of you truly grasping what it’s saying. Accepting that the truth you seek runs deeper than your mental model of it is a healthy form of humility.

Unexpected results mean you actually stand to learn something new. The faster you learn to appreciate unexpected results—instead of trying to force them into your existing paradigm—the better. Especially pay attention to results that only seem slightly off—I have gained significant insights from small deviations from my expectation that I initially assumed were inconsequential, but proved fascinating or important upon further reflection.

PDF syncing in Sublime Text for LaTeX on Windows

I have moved all of my work back onto a Windows box recently, which means completing overhauling my LaTeX setup. I know there are a lot of integrated environments for LaTeX on Windows, but I prefer a straight text editor. Coming from Textmate, I landed on Sublime Text 2.

Sublime comes with a LaTeX bundle already installed (which has syntax highlighting and a number of other bells and whistles), but it takes a bit more elbow grease to achieve two-way syncing with a PDF viewer and use XeTeX. I couldn’t find anywhere else on the web that exactly details this process and confirms that it works, so for anyone searching for the solution (and for myself next time), here is how I got it working:

  • Install Sublime Text 2 and Sumatra PDF Viewer.
  • Install the Sublime Package Control package using these instructions.
  • Install the LatexTools package from these instructions.
  • Make sure SumatraPDF.exe is in your path.
  • Find the file LaTeX.sublime-build in the LatexTools directory and replace the following (in the Windows portion):

    “cmd”: [“texify”, “-b”, “-p”, “–tex-option=”–synctex=1”” ],

with

"cmd": ["latexmk",
"-e", "$pdflatex = 'xelatex %O -interaction=nonstopmode -synctex=1 %S'",
//"-silent",
"-f", "-pdf"],
  • Set Sumatra to perform inverse search in Sublime. Open a LaTeX-generated pdf that was compiled with synctex enabled, and you will see a relevant option in the Sumatra preferences. Replace that line with:

    “C:Program FilesSublime Text 2sublime_text.exe” “%f:%l”`

And you’re done. Now, you can compile any LaTeX file in Sublime Text via latexmk by ctrl+b, and it will launch the pdf in Sumatra, opened exactly at the location of your last edit. When you want to go back to the LaTeX source in Sublime Text, double-click in the pdf wherever you want the source to open.

Big improvement over opening on the title page of your dissertation every compile.

Enough Python to keep me happy

When I started programming in Python several years ago, I liked it so much that I thought I wouldn’t work anywhere in the future that didn’t develop primarily using it. Now, my perspective has shifted.

Very little of my deliverable research output is Python code. Yet, I program in Python almost every day. Whether it’s writing a data filter, a parser with regular expressions, an optimization routine, a plotting utility … I have a growing library of personal software that I rely on heavily to get things done.

What I found is that as long as I am using Python to augment my workflows and solve odd problems, I can tolerate a lot of friction in other areas of my professional life. Using Python as my personal computational platform is a pressure valve in my toolchain. It’s enough to keep me happy.

This realization was incredibly freeing. It removes a massive constraint on potential work environments and sets me up to wield a powerful secret weapon in nearly any firm (design/software/research) in my discipline.

See also: The Python Paradox by Paul Graham and Python is a Voluntary Language by John D. Cook.

Problem to be solved

The other day I completed a difficult and uncertain benchmark in my PhD, the sort of step that tested the viability of one of the major features of my research.

During the several weeks leading up to this, I encountered some of the hardest problems that I’ve faced so far. The thing that surprised me was that after each problem presented itself, I was able to not only identify its source but also a solution, usually quickly even.

After I went through this several times, I realized: these are nothing more than problems to be solved.

What was I so worried about?

Expect to encounter difficulty, but also expect that you will prevail against it. If you are doing interesting work, you will be brought to a standstill by problems that stretch your understanding and threaten your belief in your expertise. Don’t shrink back from these, but rely on your training and move forward confidently. This is pragmatic optimism.

Your saw is sharp enough, and you may actually be on the verge of a better insight than you expected.

Burj Dubai finite element model

My wife and I love to travel off the beaten path, a practice which has brought us to Dubai on several occasions. Being a structural engineer, getting to witness the progress of the Burj Dubai (now Burj Khalifa) at several stages during its construction has been an obvious highlight. Here is a photograph I took from a friend’s apartment during our last visit in 2008:

To say that the Burj Khalifa makes a striking impression on the skyline is an incredible understatement. It is imposing and inspiring.

Several years ago, I implemented a new meshing algorithm in our finite element software. I needed an interesting test case so I decided to mesh a typical floor plan from the Burj Dubai to evaluate my algorithm. I thought it might be interesting to share the results here.

burj2

burj1

burj3d

burj-contour

One note: These are very approximate versions of the floor plans that lack many of the actual features present in the Burj Khalifa. I basically traced a random image I found online to get the geometry. You’d also never build a large scale model of a supertall building where columns are simulated with 3D continuum elements. But, these meshes give you a feel for the famous buttressed core system, developed by William Baker and co at SOM to provide exceptional torsional stiffness and resistance to the effects of wind.