Jonathan Leto: November 2008 Archives

In Tensor Calculus, a Jacobian is a matrix defined asJ_{mn} = \frac{dy^m}{dx^n}  where the y^i 's are a new coordinate system defined in terms of the original coordinate system, the x^i 's. (Note that we are using subscripts, x^2 denotes the second element of the \mathbf{x} vector.) The determinant of this matrix J=det([J_{mn}]) is important because this represents the constant of proportionality between volumes in the old coordinates and in the new coordinates. As a simple example polar coordinates is the transformation  (x,y)= (r \cos {\theta} , r \sin {\theta} ) . When we want to perform an integration in cartesian coordinates by transforming into polar coordinates, we write \int f(x,y) dx dy = \int f(r,\theta) r dr d\theta  , the factor of r is precisely the Jacobian. So in general, to convert an integral in the x^i coordinate system to the y^i coordinate system we have \int f(\mathbf{x}) d\mathbf{x} = \int    f(\mathbf{y}) J(\mathbf{y}) d\mathbf{y}  where \mathbf{x}=(x^1,x^2,\cdots,x^n)  and \mathbf{y}=(y^1,y^2,\cdots,y^n) .

In differential equation theory, the Jacobian matrix plays a key role in defining the stability of solutions. As a simple example, consider the matrix ordinary differential equation \dot{\mathbf{x}} = A \mathbf{x}  where A = \left(\begin{array}{cc}a&b\\c&d\end{array} 
ight) . Because this is a linear system, the solution will always be a linear combination of exponentials \mathbf{x} = \mathbf{v_1} e^{\lambda_1 t} + \mathbf{v_2} e^{\lambda_2 t } where \mathbf{v_{1,2}} are the eigenvectors and \lambda_{1,2} are the eigenvalues, and t is time, which is positive. Since t > 0 , we must have  Re(\lambda_{1,2}) < 0 for the solution to decay to a steady state. If this is violated for any \lambda_i then that exponential "blows up" as t 
ightarrow \infty , since it is an exponential with an ever-increasing postive argument. Note that if the eigenvalues are complex then the imaginary part of the eigenvalue is related to the oscillatory part of the solution.

A  \lambda_i  would be called an unstable eigenvalue of the system and also forms part of the vector space called the unstable manifold. Instability is defined as the tendency for a system to shoot away from a certain state when it is slightly disturbed (perturbed) from that state. Stability is the feature of a system to come back to a certain state if it is slightly perturbed from that state.

Stability has important consequences for applications, because it can determine if your chemical/combustion reaction will go out of control, of if the species in your mathematical model go extinct, etc, depending on what the differential equations describe. Whatever your equations describe, knowing if the solutions are stable is pretty important and usually the first step of an analysis. If you have stable solutions, then you can reasonably trust numerics but if you are trying to numerically simulate an unstable solution of an equation, you must be much more careful. In these situations you want to use specialized integration algorithms that preserve certain properties of your solutions, like if it is symplectic. More about this later!

LaTeX finally works

| | Comments (0) | TrackBacks (0)
Yes, now I can write Euler's Identity properly: e^{i \pi } + 1 = 0 . This required some heavy hacking on the MTLaTeX plugin, mostly in telling LaTeX where to find style files and fonts. I fixed some glaring security bugs waiting to happen and improved error reporting. Once I started looking at the source, it was pretty apparent that it was translated from PHP *wince*. I started an overhaul, but it definitely needs a rewrite from the ground up. It would be nice to have config parameters viewable and changeable within MT. Thankfully MT has some pretty good documentation.

LaTeX makes math jokes so much more fun:

\int{ \frac{1}{cabin} } = \log{ cabin} + C

Don't forget the + C , it's important. 

Thesis Revisited

| | Comments (0) | TrackBacks (0)
Enough time has passed after the defense of my masters that I can stand looking at it again, so I did a git svn clone of my old svn thesis repo and put it on my gitweb. The scary-sounding title of my thesis was: Solitary Wave Families In Two Non-Integrable Models Using Reversible Systems Theory. It is 48 pages of gobbleygook unless you have some decent differential equations and linear algebra background. The presentation that I gave during my defense is at least a tiny bit more digestible. It at least has a Sherlock Holmes quote and some pretty pictures. One sentence english translation of my thesis: I found some solutions to some equations that people hadn't found before.

One chapter of my thesis was accepted and published in Communications in Nonlinear Science and Numerical Simulation. Here is the abstract. The actual print publication date is Volume 14, Issue 5, May 2009, Pages 1999-2005, but it is "pre-published" online.

Next on my list is to get LaTeX rendering to work in MovableType.

People Pay for Oracle?

| | Comments (0) | TrackBacks (0)
I was utterly amazed when I had the pleasure of interacting with an Oracle database at work and realized that even the latest and greatest Oracle 10 command-line shell has no readline support.  Are we still in the days of vacuum tubes? Seriously people! Thankfully there is a spiffy utility called rlwrap which saves the day. It acts as a buffer between another interactive program and provides proper command completion and history. 

GitX 0.5 has Gravatar Support!

| | Comments (0) | TrackBacks (0)
GitX just auto-upgraded itself and the interface just keeps getting prettier and more functional! Check out the spiffy Gravatar and one-click gist creation: gitx-gravatar

Running a Factor Script

| | Comments (0) | TrackBacks (0)
For those who are put off by the interactive UI part of Factor, you can run a script from the command-line like so

#! /Users/leto/git/factor/factor  -script

USING: gsl gsl.sf.result gsl.sf.bessel gsl.sf.log kernel tools.test ;

"gsl.sf" test

Note the space after the ! is necessary because every "word" in Factor must be separated by a space. The practice of running factor as a non-interactive script is not encouraged, but in certain  situations it wins the day. The above script could be factored to take an argument of a subsystem to test and then I would make a key-binding in vim (or emacs or whatever) so that when I am editing a file and I type ,t it shows me the results of that subsystems tests.

All of this stuff can be done in the interactive UI, but I think people will fiddle with Factor more  if they can easily bolt it onto their current workflow. People tend not to even try things that require totally changing their current tool chain. For me, I am editing the source of the GSL bindings in VIM, so having that script is invaluable. I hack on the source and whenever I change anything important I run the tests by hitting 2 keys. It is really important to make running and writing tests as easy as possible, or they won't get written at all. 

Today ...... is a good day to hack.

New Factor Git repo

| | Comments (0) | TrackBacks (0)
You can view my new factor repo's gitweb. Or you can clone my repo with

git clone

This should start getting pulled upstream into the main factor repo sometime soon.

The GSL bindings are now in "extra/gsl", which is the extra.gsl namespace in Factor. I have bindings to all of GSL's special functions, I am currently working on documenting the Bessel functions and writing tests for the functions which take/return gsl_sf_result structures. If you would like to see another subsystem, just ask and I will let you know if it is doable. There are almost 50 subsystems, so if you want to help: clone, hack, commit and push!

CouchDB talk at OpenSourcery

| | Comments (0) | TrackBacks (0)
I attended a presentation at OpenSourcery by Chris Anderson about CouchDB. He showed off  Futon, which is CouchDB's online web interface, which allows one to do normal CRUD, as well as set up replications, run tests and set configuration variables. It has some simple JavaScript functions which are basically map/reduce elements and it seems to be tightly integrated with jQuery. When I asked about Prototype I got the "Why are you still using Prototype?" spiel. Perhaps I should actually look into why people think jQuery is so much better.  Anyway, Here are my rough notes of the interesting features of CouchDB that caught my eye:

HTTP server + JSON Doc DB (key/value pairs), RESTful

Incremental Map reduce views

peer-based replication

multi-master  OR push all changes to one write-master and + read slaves

concurrency over serial speed

Ex: = 120GB database, 200ms response

written in Erlang

sharding via hash functions

documents vs. relations

each doc has a "revision"

first in wins

standalone apps via _external servers 

p2p replication - this is really cool and powerful

_external servers - api to parse request as json, filter it and then return

rollup = reduce 

re-reduce phase =~ aggregate

Bessel Functions in Factor

| | Comments (0) | TrackBacks (0)
View Screenshot

Click on the link above to see a screenshot of how to make plots of functions in Factor. I am showing off the Regular Bessel function J0(x) which is called gsl_sf_bessel_J0 in GSL. In the background I also have the source of the documentation.

Fish-Eye View of The GSOC08 Mentor Summit

| | Comments (0) | TrackBacks (0)
DSC_5188-DSC_5204-mercator.jpg DSC_5188-DSC_5204-sky.jpg

GSL for Factor

| | Comments (0) | TrackBacks (0)
Factor is a new language that is gaining momentum in the open source community. A few of the core members were in town visiting after the creator Slava gave a Google Tech Talk. Over beers and pizza at the Lucky Lab NW the Factor guys told me how FFI works and we had a binding to a Bessel function working within half an hour. It's that frickin' easy! 

Here is the gitweb for factor-gsl, which currently has support for all Bessel functions. 

To clone master repo:

git clone

Example usage: 

( scratchpad ) USE: gsl.sf.bessel
( scratchpad ) 10 gsl_sf_bessel_J0 .

There are tests also, but the docs are still a bit rough. 

Review of Javascript: The Hidden Manual

| | Comments (0) | TrackBacks (0)

This book claims to "familiarize Web designers with ins and outs of JavaScript and then move on to advanced tool for adding really useful interactivity to a Web site as quickly and easily as possible."

I am coming more from a development background but my JavaScript was quite rough, so I liked that this book does not assume that you know CSS selectors and DOM structures by heart. 

The book exclusively uses jQuery, which is used in almost every example. Other libraries are mentioned on page 170 but it would have been nice to see some comparisons between how something is done in jQuery versus one of the other popular libraries. 

Other than that, the book gives a nice short introduction about the history of JavaScript and inspirational advice for budding web developers.

I think the title is a bit vague, it should mention somehow that it exclusively uses jQuery. Other than that it seems like a good book for designers branching out into development.

About this Archive

This page is a archive of recent entries written by Jonathan Leto in November 2008.

Jonathan Leto: October 2008 is the previous archive.

Jonathan Leto: December 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Clicky Web Analytics Screw you, spammers! 42