Capturing knowledge with pure maths
Mathematics is ubiquitous and Ray Girvan finds that Maple 10 has evolved to put a friendly face on deep maths
When Maple 10's introductory booklet states that 'mathematics touches us every day', it is preaching to the converted, as I find it often provides a secret weapon for problems that don't immediately present themselves as mathematical. Currently I'm helping prepare material for a biography (I was brought in to digitise the source photos). One difficulty is that many of the prints have a hexagonal surface texture that shows up on scans. Luckily, this periodic noise is amenable to a bit of mathematics. Run through a Fast Fourier Transform, it appears in the frequency domain as 'spikes' that can be cut out before reconstituting the image by an Inverse Fast Fourier Transform. The secret weapon in this case is a fairly old copy of Media Cybernetics' scientific image processing package, Image-Pro Plus, but the Video and Image Processing Blockset in Matlab does the same.
Another example: I help the Devon History Society with its guestbook, which has recurring enquiries about the location of lost streets or buildings - the centre of Exeter was heavily damaged in the 'Baedeker Blitz' during the Second World War. The raw Ordnance Survey data is easy enough to find from sites such as Old Maps and Get-A-Map, but non-standardised scale and orientation of their download images make a straight overlay impossible. Again, the solution is mathematical. A rough-and-ready approach is to find landmark pairs that exist both on old and new maps, measure their separation in pixels on each map, use the ratio to rescale the images accordingly, then correct for orientation in any program that offers image rotation. (The latter function is standard for image processing packages, including add-ons such as the Image Processing Extension Pack for Mathcad, or Digital Image Processing for Mathematica). The whole task could be also done with the ready-made image registration routines in Matlab's Image Processing Toolbox.
This situation - multiple approaches drawing on the same core functions - applies to mathematics packages too. Differences in those functions have long since become obscure: it's the specific interface to those functions that is the point of difference nowadays. But Maple 10 is unusual in providing multiple interfaces. The Standard builds on the integrated text/maths Worksheet format introduced in Maple 9, but it now has a second mode, Document, which dispenses with the command prompt. The Classic, a separate program with a no-frills interface, is provided for underpowered machines (with the Standard, window-switching is slow if you have less than the recommended RAM). And then there's the Maplesoft Calculator. Aside from a taste for the retro - I have plenty of calculators, but most of them are mechanical - I'm not a great fan. However, I agree with Felix Grant's assessment in the June 2005 issue of Scientific Computing World: Maple 10's deceptively simple-looking implementation of a graphing calculator turns out to be far more, drawing on the underlying Maple system for powerful features for extracting information from a graph. Clicking on the appropriate tab and dragging the cursor over the graph window gives readouts of values such as intercepts, maxima, minima, and area under curves.
Maplesoft describes the chief themes behind Maple 10 as 'deep math, ease of use, and knowledge capture'. Knowledge capture refers to the facility to create 'document blocks': hidden areas of code that do the calculation in live documents (akin to the collapsible regions in Mathcad and Mathematica). 'Deep math' is shorthand for a range of updates in the mathematical functions and code infrastructure. Apart from generic go-faster changes, whose significance is always difficult to judge, there are nearly a dozen new packages. Highlights I noticed relevant to scientific computing are the upgrades to give closed-form solutions for travelling wave PDE solutions (such as the soliton-generating Korteweg-deVries equation) and a completely new Statistics package covering plots, probability distributions, regression, estimation, derived functions, data smoothing, hypothesis testing, and so on. For a simple vector of data, many of the statistical functions are available through an interactive 'Maplet'-based control panel that, like the graphing calculator, enables readout and manipulation of the data.
Two packages allow calculation of error in derived values: the ScientificErrorAnalysis introduced with Maple 9 works on assumptions of statistical error, while the new Tolerances package uses interval arithmetic to derive rigorous bounds. AudioTools and ImageTools give basic functions for sound and image manipulation, but the latter is a trifle weak - it's surprising that a function as fundamental as image rotation was omitted.
This leaves the last of the trio of stated themes for Maple 10: ease of use. Whatever may be happening 'under the hood', its most obvious strengths are in the many friendly developments to its general interface. The new Document style isn't 100 percent free-form, but it has broken away from the strict command-line format and Maple syntax - the built-in editor automatically formats expressions into typeset layout during input. If there's room, derivations can be chained across the page, and parallel display regions can be created with tables.
A number of tools have been added to speed up programming, such as a menu of 100 or so templates, quick-access boilerplate routines for pasting into worksheets, the addition of slider bars and other graphical interface elements to the expanded symbol palette, and a graphical interface to the Maplets package for making Maple's customised applet-style applications. I'm not so sure of the effectiveness of the Symbol Recogniser; maybe it's my artistic ability, but nothing I could do would make it recognise the symbol for pi.
Maple 10 looks like an evolutionary rather than revolutionary development from the previous version. Nevertheless, the update continues in bringing its mathematical power into an accessible form that's increasingly the norm for such packages, and I highly recommend it to anyone who needs a strong repertoire of pure mathematics in a clean modern interface.