In the news

Posted in Web 2 years, 3 months ago

An article was published in the Vancouver Sun about university education in British Columbia. It also mentions Zymeworks, the company at work at. The president of my company has a few good words to say about SFU.

The dark blob in the background is my head. Check out my new haircut!

My family hates me

Posted in Activity 2 years, 3 months ago

Just like Moslems need to visit Mecca once in their lives, Vancouverites need to do the Grind. To quote Wikipedia: “Grouse Mountain is a ski area and tourist attraction located in the District of North Vancouver, British Columbia. Public access to the mountain is by aerial tramway, the Grouse Grind hiking trail, or the Old Grouse Mountain Highway.” One of things I have been doing regularly this summer is the grind. The Grind has the reputation of quickly assessing your fitness level. Less than a hour: you’re fit, between one and two hours: needs work, and beyond two hours: bad shape. I decided to do the Grind yesterday with my family.

The 1/4th mark

Sometimes, the truth can be bitter. The truth about your fitness level stares right back at you during the grind. None of that “I carry a six pound calculus text book to school” lies. And my family hates me for that.

As always, Murphy Law dictates that your camera’s battery must die right before you need it. As a result, I couldn’t take any pictures at the top.

PS: The yellow board says “ATTENTION HIKERS: You have reached the 1/4th mark in the Grouse Grind Trail. The remainder of this trail is extremely steep and dangerous. Proceed at your own risk.” In ALL CAPS, but I wanted to save your ears from the bleeding.

Interval computing

Posted in Physics 2 years, 3 months ago

A great challenge in numerical computation is coming up with algorithms that are stable for a wide range of inputs. This leads to creative approaches like partial pivoting in gaussian elimination, or accurate floating point summation which is important in inner products. Unfortunately, all of these solutions are problem specific.

Enter interval computing.

Interval computing attempts to solve rounding errors on computers. It does this by placing brackets around the error. It’s almost like the uncertaininty we place on observables in physical experiments. For example, a reading A with a standard deviation \partial A can be written using intervals:

 A \pm \partial A  \sim [A - \partial A, A + \partial A] \sim [a, b] = \bar{A}

In general,  \bar{A} = [a, b] defines an interval which bounds the floating point number. Four of our primitve operations add, subtract, multiply and divide on two intervals \bar{A} =
[a,b] and \bar{B} = [c,d] are:

 \bar{A} + \bar{B} = [a+c,b+d]

 \bar{A} - \bar{B} = [a-d,b-c]

 \bar{A} \times \bar{B} = [min(ac,ad, bc,bd), max(ac,ad,bc,bd)]

 \frac {1}{\bar{A}} = [1/b, 1/a]

 \bar{A} \div \bar{B} = \bar{A} \times \frac{1}{\bar{B}}

(where the interval \bar{B} does not contain zero.)

Interval computation can also be used for transcendental functions such as log or sin. The Taylor expansion for sin for example is:

 \sin(x) = x - \frac {x ^ 3} { 3 !} + \cdots

which is a composition of the primitive operations defined above. Interval computation is very useful in determining the robustness of a numerical procedure.

Higher order functions

Posted in Physics 2 years, 3 months ago

Joel Spolsky, of the JoelOnSoftware fame, recently wrote about higher order functions in “modern” languages. While these features have existed for decades in functional programming languages, they have gained a lot of attention lately due to Google’s MapReduce technology.

Simply put, map and reduce are primitives in languages such as lisp. Thinking in terms of lists (naturally), map lets you apply a function to every element of a list, while reduce lets you combine values of the list in some way. Pick up any lisp book for more details on this programming paradigm.

I find a great deal of similarity between functionals in programming, and functionals in variational calculus. Unfortunately, variational calculus is a much neglected field of calculus specially at the undergraduate level. Variational calculus lets you define “functions of functions.” For example, the functional defined for the continuous function y(t) in the region [a,b]:

J[y] = \int _ {a}^{b} y(t) dt

is the area under the y(t) curve. See how J is completely independent of y(t)? That’s the power of variational calculus.

In general, if we have functions of the form:

J[y] = \int F(y, \dot y, x) dx

we can use the Euler-Lagrange equations to derive a differential equation to solve the problem.

Variational calculus finds much use in diverse fields such as aerospace control (optimize a trajectory based on fuel cost), operations research (optimize FedEx’s drop off targets based on distance travelled), and image inpainting (total variational models). If you haven’t figured it out yet, “optimization” is the reason this entry is posted under Numerical.

A usability problem

Posted in Misc 2 years, 3 months ago

I stumbled upon a problem with the Mac OSX Preview program today. The print dialog hides the current page number when it pops up. This is a big problem when you want to print a single page, and the page numbers on the PDF do not correspond to the actual page numbers.

The two screenshots, with and without the print dialog open: Mac OSX Preview Bug Mac OSX Preview Bug