What is the temperature of Lake Traunsee?

Last week I had some days off for hiking in the area around Lake Traunsee (Map).
And, by chance, last weekend was also one of the hottest weekends ever measured in Austria. Therefore, the water temperature of Traunsee, which has a serious reputation for being one of the coldest lakes in Austria, was almost cosy 23 degrees centigrade (measured in Gmunden on July 26).
If we had all desired data, could we model (and eventually calculate) the time evolution of the Traunsee temperature? I am speaking of the forward problem, meaning we want to know if it makes sense to have our bathing trunks prepared after having attended a seminar given by the physicist Anton Zeilinger and the philosopher Franz Schuh "How real is reality?" on August 15.
Obviously, this is not an easy task. We would have to know the initial (today’s) temperature distribution of the water in the lake and of the mountains around it, the temperature of the incoming water (river Traun and possible rainfalls), and at least the thermal boundary conditions at the lake surface, influenced by air temperature and the intensity of solar radiation. After having collected the data, we would have to solve the equations of meteorology with a time horizon of two weeks. Some talented persons can do this with a reasonable accuracy, but I cannot.
As mathematical modelling and computational finance is related to the art of simplification, maybe we can solve a toy problem. So, for the sake of simplicity, the model Traunsee is assumed to be one-dimensional with a given (inhomogeneous) initial temperature u(x,0). We further assume that there is no heat transport by convection within the model Traunsee, only by conduction, and that there is no energy loss or gain across the surface of the lake but only by heat flow into the or out of the (zero-dimensional) model beach. The physical parameters of the Traunsee water (density, heat conductivity and specific heat) are assumed to be known and constant.
This is a forward heat conduction problem, which can be easily solved by finite elements or finite difference techniques. As long as you use an implicit time-stepping scheme, you don’t even have to think about stability.
In our model problem, we set the initial temperature of the left half of Traunsee to 17 degrees, and of the right half to 23 degrees. 

Then we fix the boundary temperature to 20 degrees and let diffusion work for a while. (As we have not specified the dimensions of 1D Traunsee and of the physical parameters of the water in it, it does not make sense to say "for two weeks".) As we espected it, the final temperature is as follows.

What happens mathematically if we know the final temperature and want to calculate the initial one? In a forthcoming blog entry we will study this problem. The backwards heat equation is an inverse problem for a diffusion operator. Expect nasty things to happen.

No Quants - Your Jobs Will Not End In a Cloud

In various forums members have provided a link to ... SW That Will End The Era Of The Quants.
Powerhouse investment banks - along with titans of the fund management industry - are turning to the cloud to unlock powerful supercomputing capacity that will end their reliance on Excel and give them the tools to compete the "quants" that have taken over the business in the last decade.

The Macho of Financial Modeling

I promise to stop beating on rigid instrument-model-method combinations - once. It is a great idea, when models are not only approximations of reality, but game rules that make the market a kind of a fair play - like the option theory based on Black Scholes with analytic solutions (as it was by 1987 before out of the money options were constructed and traded).

Flip the Product Development Timeline - The Projects-for-Product-Cost Option

How to launch a software brand? Independent of the software development methodology the product timeline itself it is characterized by Ideate-Prototype-Program-Refactor-Test-Package-Market.

A Little About The Two-Sidedness of Management

When I was in the factory automation business we said: management is about planning-and-control. And consequently of good nature for automation (especially production and operation management down to the planning-and-control of machine tools, robots, vehicles, ..). We were strictly following the Taylorist paradigm when characterizing our systems, but our teams, the automation-system makers, needed to think out-of-the-boundaries.

More FEM - Time

In our series of blog posts

Hows, Whys and Wherefores of FEM in Quantitative Finance

we discussed the different tasks necessary to get a discretised version of a diffusion-reaction equation. To apply the FE method to problems arising in quantitative finance still some work remains to be done. Todays post will focus on the time discretisation of a time dependent diffusion-reaction equation which can be written in semi-discretised form as

The variation of the time derivative on the left-hand side within an element can
be stated as

In Galerkin formulation, the residual integral for this term is

where C is called the element’s capacitance matrix. We can use the finite difference method for discretising the transient terms. Using a general time stepping scheme  (for different values of Θ the time stepping scheme is implicit, explicit or semi-implicit) we obtain

Rearranging this equation yields an equation of the form = b for the nodal
values of the unknown quantity Φ:

The integral defining the capacitance matrix,

can be evaluated analytically for the linear triangular element yielding

The post excerpts a chapter of the book A Workout in Computational Finance. The next blog post will discuss how to setup the global matrices for the system of linear equations and how to incorporate boundary conditions.

Young Quants - Rethink It, Rebuild It

I enjoy discussing with entry-level quants in forums and groups ....

2009. The Financial Modeler's Manifesto, written by Emanuel Derman and Paul Wilmott, was a proposal for more responsibility in quant finance. In short, make models that are adequate, robust and transparent. And this includes models, solvers, calibration ... (unfortunately not alwys distinguished)

Hows, Whys and Wherefores of FEM in Quantitative Finance - VII

Do you remember the equation derived in our last blog post ? -

In the finite element world, K is named element stiffness matrix, M is named element mass matrix and f is called the element load vector. As promised in the last post we will analyse these matrices today starting with the element stiffness matrix. First we calculate the gradient vector of

and obtain

Therefore we end up with

To obtain the element matrices, it is necessary to evaluate the integrals just derived. Restricting ourselves to the two-dimensional case, we will now show that this can be done analytically for simple linear triangular elements where we have shown the element shape functions in a recent blog post.

As long as G is constant inside the element, the element mass matrix can be
easily evaluated

and for the load vector we obtain

This series of blog posts summarizes a chapter of the book A Workout in Computational Finance. The next blog post will discuss how to incorporate a time discretisation to our  setup. It will be published on Monday, 22nd of July.

Summer Stories - Computers Fighting Dragons and Other Fables for Robots

In summer I swim more and read more - often at the same place. This year I decided to reread Stanislav Lem's Short Story Collections - The Star Diaries, Fables for Robots and The Cyberiad - in German.

Writing About Music Is Like Dancing About Architecture

Who said this first? This question has been never satisfactorily resolved - The quote Investigator .
I like music and Thelonious Monk or Frank Zappa were candidates coming to my mind, but it was more probably - Martin Mull, the American actor, comedian, ...?

To Unleash Must Not Mean To Control

This weekend I enjoyed the rest at the Attersee - no storms ... And, sitting in front of the old boathouse,  I remembered that earlier in spring the fishermen set tiny fish to catch the swarms they have built later when they grew - for landing in the pan or on the char grill ...

Econophysics - Economists, You Know Where the Door Is?

Michael Casey has written a provocative essay in Wall Street Journal. Let's face it, economists make lousy economists, he summarizes.

I am interested in the the theory of complex systems, complexity economy and especially its influence on quant finance. Here I have written about major achievements of econophysics.

How we Keep Up with Quants - the Principle of Reciprocity

It sounds so simple: our clients want our best work and our passion.

But, they could expect that we work in a factory mindset, pay us for the best possible work, accept nothing else than high performance .... or they could encourage us, set a high bar and then support us on our way.....

The Problem With Computing "Expected" Returns In Finance

Our core competence is representation: simplified, we represent asset pricing and risk models by the best possible solvers (accurate and robust). And we help to unmask the risky horror of wrong application and wrong computational treatment of the models. This is the reason why we have organized instruments, models and methods (representations) orthogonally.

Tantalus On The Way to The Horizon? No Thanks!

The posts in our Mathematics topic grew fast in the recent weeks. This is part of our brand promise: we deliver not only software and use training, but know-how packages, including views behind the curtain. The Academy, the book, papers, posts, individual mentoring, ....

Hows, Whys and Wherefores of FEM in Quantitative Finance - VI

In the last blog post we discussed the 2D triangular element - a preparation for the next posts of our series. Today we start with the variational formulation of a two dimensional static diffusion-reaction equation.

An element's contribution to the system of equations is given by

where A denotes the element's area and N is the row vector containing the element's shape functions. In A Workout in Computational Finance the derivation of the final equations is explained in detail. At this point we only give the final result of the derivation (neglecting surface integrals)

This equation can be written in a more compact form

In the finite element world, K is named element stiffness matrix, M is named element mass matrix and f is called the element load vector.

This series of blog posts summarizes a chapter of the book A Workout in Computational Finance

The seventh post of the series will be published on Thursday, July 18 (also enthusiastic blog authors need some holiday) and will give a deeper analysis of the derived element matrices in general and will calculate them for the concrete example of the 2D linear triangular element presented in the last post.

Do We Face A Supercomputing Crisis?

Virtual design, predictive modeling and simulations are increasingly essential for smarter science, faster innovation, better product development.

In finance, we want deal types with better return characteristics. Risk shall not only be priced, but optimized .... More exposure modeling, collateral management and what have you might force us to perform many millions of single valuations to price a single instrument in a certain counter party regime.

We Listen to Alternative Rock Bands Online - But Pay to See the Superstars?

The in-the-title conclusion of this recently posted Wired article did not really surprise me much: it's been never so easy for innovators to create awareness, but if they want profits from being-on-the-road and not being-on-the-roads to make profit from their products they may fail.

To Minimize Project Failures - You Must Look Deeper

You might have observed that we had a spirited discussion in Wilmott Forums (Book and Numerical Methods) about the correct application of solvers and how to test them - you can follow it via Andreas' recent "Vasicek examples" posts in our Mathematics thread.