# Issue 95, 17 February 2011

Featuring

Nonlinear Optimization Made Easier with the AMPL Modelling Language and NAG Solvers

Whether you have come across optimization software only once, or if you are an experienced user of NAG optimization routines (NAG Library E04 Chapter), you may know what a nontrivial task it is to set up a new optimization problem.

First of all, you need to formulate the problem as a mathematical model, then choose the right algorithm/routine, read all the relevant documentation, write your first code and follow the usual loop of testing and tuning until you finally compute something. Unfortunately, there are several obstacles on your way to satisfactory results.

One of the typical complications is a necessity to alter your mathematical model (often several times) before the formulation you use fully suits your needs and thus you keep re-writing parts of your code again and again. Another is the inevitability that dozens of errors will be hidden as typos in formulae for derivatives. These are probably the most prominent examples that can be very easily tackled by using a modelling language instead of usual C, Fortran or VB coding.

Jan Fiala, Numerical Software Developer at NAG, would like to share his experience with AMPL, A Mathematical Programming Language, equipped with two of our NAG solvers, namely E04UFF and E04UGF. If you have never heard about AMPL, don't worry, it's not complicated at all. The linked paper shows how easy it is to write your mathematical problem in AMPL and invoke NAG optimization routines. Technical issues how to get things working are also covered.

It might take you approximately 45 minutes to go through the whole tutorial. Hopefully, by the end you will see AMPL as a viable alternative for inputting your problems. Read the paper here.

Note: you can download all the associated files discussed in the paper from the NAG website so you can test it yourself.

New Technical Report: Reverse Communication in the NAG Library explained

Some NAG Library procedures are implemented with a reverse communication interface. Reverse communication is a means of avoiding procedure arguments in the parameter list of a procedure. Using this technique each call to a routine advances a numerical algorithm one-step before returning to the user for fresh information or with a solution. Instead of calling a routine once with all of the information provided, the user calls it several times, each time checking what new information is required.

A new technical report has been written to detail more about reverse communication. To read the report visit http://www.nag.co.uk/doc/TechRep/pdf/tr1_11.pdf.

Screenshot shows NAG routine C05AZF example program in Excel. C05AZF locates a simple zero of a continuous function on a given interval by a combination of the methods of linear interpolation, linear extrapolation and bisection. It uses reverse communication for evaluating the function.

Case Study: NAG Library Aids Spintronics in Magnetic Nanostructures at The University of Graz

Spintronics is a hot research topic; the 2007 Nobel Prize for Physics was awarded for the discovery of the giant magneto resistance (a spin-dependent transport effect), which dramatically improved the data storage capabilities of hard disks used nowadays in most computers. Spintronics (= spin+electronics) tries to utilize the so-called spin of the electron (which is a quantum mechanical angular momentum, giving a magnetic moment, which can point only in two opposite directions) to store or manipulate information. It is hoped that spintronics can provide novel functionalities and drastically improve the perfomance of information technology.

To learn how NAG routines have been used to aid spintronics visit http://www.nag.co.uk/Market/articles/spintronics_magnetic_nanostructures.pdf.

NAG in the News: The View from the High End Fortran, Parallelism and the HECToR Service

Since its inception in 1956 Fortran, and indeed FORTRAN, has been the computational language of science and engineering. Through Fortran aeroplanes fly, drugs are designed and nuclear reactors react. Through codes from the original manual still look familiar Fortran itself has changed much over the last half century and more. So how is it currently being used on modern architectures, particularly at the high end? And how has the recent (in Fortran terms!) move from serial architectures to parallel ones affected practice? And indeed how has the evolution of those parallel platforms affected practice?

In this article I shall give a brief and somewhat personal view of current programming practice on HECToR, the current UK National Academic Supercomputer service, and how application development is supported. I shall cover the hardware and software environment on the machine. Following that I shall cover how computational science and engineering (CSE) support is provided, and finally I shall discuss, with examples, how people are exploiting such machines.

F# Math: NAG Library for .NET, with F# support

Don Syme, Principal Researcher at Microsoft Research and designer and architect of the F# programming language, recently looked at NAG's latest numerical library, the NAG Library for .NET.

"As a general .NET library, this is an important addition to the set of tools that F#, C#, VB and other .NET programmers can use for math-oriented programming. From the perspective of F# users, one really important thing is the inclusion of documentation describing the use of the library from F#. Here are some of the samples on the NAG site:"

A00: Licence Check Example
E04: Optimization Example
Monitoring Function (e04cb example)
Internal Monitoring (e04xa example)

To read his full blog review visit http://blogs.msdn.com/b/dsyme/archive/2010/11/13/f-math-nag-library-for-net-with-f-support.aspx

Presentation Links from NAG Quant Day, University of Frankfurt

NAG continued its series of events for Quants in Frankfurt recently. Attendees enjoyed two highly focussed presentations by academics Adrian Buss, Raman Uppal and Grigory Vilkov as well as Uwe Naumann. To view their presentation slides click on the links featured below.

Asset Prices in General Equilibrium with Transactions Costs and Recursive Utility

The Art of Differentiating Computer Programs - Algorithmic Differentiation - Why and How?

If you're interested in hosting a similar type of event at your place of work, please email us at nagmarketing@nag.co.uk.

Recent Blog Posts

The Practical Use Of GPUs To Improve The Performance Of Numerical Applications
3 March 2011, Illinois Technology Association, Chicago
NAG and NVIDIA are co-hosting a technology event which will detail the use of numerical code on GPGPUs. NAG routines on GPUs will be described to help those who are making use of Graphical Processors to increase the performance of their applications. Full details will be published shortly, however space will be limited. If you'd like to reserve a place please email us.

NAG 'direct award' prize for best financial math project using NAG
Would you like to win a free pass to the prestigious finance event Global Derivatives Trading and Risk Management 2011? If you're a student studying mathematical finance you can enter the NAG 'direct award' prize by sending through details of your mathematical project. Email us for more information.
The most recent winner of a NAG 'direct award' prize is Nicoletta Gabrielli, University of Rome, Masters Student. To learn more about Nicoletta's work visit http://www.nag.co.uk/about/student_awards/work.asp.

One element of NAG's CSE role in HECToR is the provision of HPC related training courses. The courses are provided free of charge to HECToR users and UK academics whose work is covered by the remit of one of the participating research councils (EPSRC, NERC and BBSRC). Others people may attend on payment of a course fee. Please see the HECTOR eligibility page for more details

Here are the courses being held over the next few months.

Fortran 95
16-18 February 2011, King's College London

Multicore
5 April 2011, Imperial College London

Gemini, the Cray XE6 Interconnect
6 April, NAG's Manchester Office
13 April, NAG's Oxford Office

Co-Array Fortran
7 April, NAG's Manchester Office
13 April, NAG's Oxford Office

Please feel free to forward this newsletter to colleagues or to post it to your company's Intranet sites.