# November 2008 Archives

## 5 Minute Math Lesson: What is a Jacobian and what is it good for?

| | Comments (0) | TrackBacks (0)
In Tensor Calculus, a Jacobian is a matrix defined as where the 's are a new coordinate system defined in terms of the original coordinate system, the 's. (Note that we are using subscripts, denotes the second element of the vector.) The determinant of this matrix 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 . When we want to perform an integration in cartesian coordinates by transforming into polar coordinates, we write , the factor of is precisely the Jacobian. So in general, to convert an integral in the coordinate system to the coordinate system we have where and .

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 where . Because this is a linear system, the solution will always be a linear combination of exponentials where are the eigenvectors and are the eigenvalues, and is time, which is positive. Since , we must have for the solution to decay to a steady state. If this is violated for any then that exponential "blows up" as , 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 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: . 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:

Don't forget the , 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:

## 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 http://leto.net/code/factor.git

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: lotsofwords.com = 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)

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)

## 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 http://leto.net/code/factor-gsl.gi

Example usage:

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

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.