How Mathematics made a Calculation Model feasible

In this blog series, we show that our mathematical strengths are an important complement to our programming skills. Using a mathematical approach, we achieve solutions that programming alone couldn’t.

The blogs are based on interviews with colleagues who recently completed projects where mathematics played a decisive role.

In this second instalment, we speak with Thea, who, along with Bas and then-colleague Alouette, worked on a fantastic project for Boskalis.

At Boskalis, a wide variety of things happen. What exactly did you work on?

Boskalis frequently uses settlement models: calculation models that predict how bodies of sand behave over time. This is crucial for projects such as terrain elevation or land reclamation. They calculated the models analytically in Excel, but this was very complex and not user-friendly. The long formulas were difficult to manage, making it very difficult to add new options or make changes to the calculation. We were asked to make the process faster and more reliable.

Was it immediately clear that you would be working with mathematics here?

No, not really. A Boskalis employee had started implementing a numerical solution in Python on his own initiative but ran into problems with the computation time. His question was: “Can you help make it faster?” Once we started the project, it turned out there was a mathematical bottleneck.

Why did the models require so much computation time?

The time integration was too simple for the type of processes being simulated. As a result, the time step had to be very small (minutes instead of days) to remain numerically stable. This led to a huge number of time steps for simulations spanning years.

How did you approach this?

We started by separating the time integration from the rest of the code so that we could even try other methods. At the same time, we set up tests and Continuous Integration (CI) to ensure the results remained correct after each adjustment. We also developed a plan to apply an implicit time integration method (the implicit Euler method, see box). This is a mathematical technique that allows for much larger time steps. In the second phase of the project, we further developed this idea by linearizing the equation and calculating the required Jacobian. We were then able to implement the new integration method.

And did that save on computation time?

Yes, enormously. The computation time went from “practically unusable” to “quite fast enough.” This also made the Python version suitable for more complex scenarios.

You sound really enthusiastic about the mathematical techniques used!

Absolutely! This project started with a question about Python optimization, but in the end, it turned out that the computational choices made all the difference. We found the lessons learned from the project so valuable that we developed an internal course based on the knowledge gained. Naturally, we used a different case study for this because the Boskalis code is confidential. This way, we can also show colleagues how to apply these kinds of mathematical insights structurally in projects.

Was the client satisfied as well?

Absolutely! Boskalis clearly saw the added value of our approach. By combining scientific knowledge with mathematics and software engineering, we were able to build a solution they fully trusted. It just goes to show: the combination of mathematics and programming leads to solutions that wouldn’t be feasible on their own.

The mathematical details

To use the implicit Euler method, a Jacobian must be calculated. Ideally, you calculate with an analytical Jacobian, but deriving this was very time-consuming and error prone. Therefore, they chose to calculate a Jacobian using finite differences. This shortened the calculation time sufficiently to allow the model to be used in practice.