Fitting data with dynamical models: ten lessons on mathematical field work

Sign in
Advanced course / School
From October 24, 2023
to November 29, 2023

Location: CRM / Online via ZOOM

Room: Auditorium 

Registration deadline 16 / 10 / 2023


Period: Tuesdays and Wednesdays from October 24th to November 29th, 2023
Time Schedule: 15h to 17h
October: days 24, 25 and 31
November: days 7, 8, 14, 15, 21, 22, 28 and 29


Mathematical models are essential for understanding and predicting the behaviour of dynamical processes in a wide range of fields, from physics and engineering to biology and social sciences. A mathematical model is a set of equations that describe the evolution of a system over time, based on certain assumptions and simplifications. By formulating a mathematical model, scientists can gain insight into the underlying mechanisms of a dynamical process and test hypotheses that would be difficult or impossible to investigate experimentally. Moreover, mathematical models allow scientists to make predictions about the behaviour of a system under different conditions and to design interventions that optimize its performance.

In addition to their explanatory and predictive power, mathematical models are also a valuable tool for communication and collaboration between scientists from different fields. By using a common language of mathematics, scientists can share ideas, test each other’s models, and build on each other’s work. This interdisciplinary approach has led to many breakthroughs in science and technology, from the development of new drugs and materials to the design of more efficient and sustainable systems. Overall, mathematical modeling is an indispensable tool for advancing our understanding of the world around us and for solving some of the most pressing problems of our time.

Fitting mathematical models to real data is a crucial step in scientific research and engineering applications as it allows us to quantitatively describe and understand the observed phenomena. By fitting models to data, we can extract important parameters that characterize the system under study and test the validity of the model assumptions. Furthermore, fitting models to data enables us to make predictions about the behaviour of the system under different conditions, estimate the uncertainties in the predictions, and design experiments to test the model predictions. In this way, fitting models to data provides a powerful tool for hypothesis testing, model selection, and decision-making in a wide range of scientific fields.

In this course, given a time series of observed data, we will model their time evolution using dynamical systems theory with the objective of determining the possible sets of parameters such that the time trajectories generated by the model fit the time series of the observed data. To do so, we will provide different modelling approaches based on mathematical and/or computational models and a variety of different tools for data fitting. In summary, we aim to design models that describe observed data and validate them.


Session 1 (Josep Sardanyés). Introduction to mathematical and computational tools to investigate dynamical processes.

Here we’ll start by providing a general catalogue of different modelling approaches for dynamical processes, including both mathematical and computational models (or both simultaneously) and explaining the strong and weak points, as well as the assumptions of each approach. This introduction to these mathematical and computational tools will cover a range of techniques used in the study of dynamical processes, including ODEs, PDES, and numerical simulations under deterministic and stochastic settings. Participants will learn how to design mathematical models to describe the behavior of dynamical systems and use them to investigate physical systems such as oscillators or biological systems such as species interactions in ecosystems.

Session 2 (Lluís Alsedà). Introduction to data fitting methods.

Specification of problems towards the comparison (error measuring) between the modeled and the observed data. Error measures and error norms (least squares and others). Parameters’ fitting error minimizers. Minimization techniques; deterministic versus heuristic.

Session 3 (Josep Sardanyés). Modelling examples in Biology: ODEs and cellular automata (CA) models.

This part of the course will provide participants with practical examples of how differential equations and CA models can be used to study dynamical processes in different fields such in Virology and Ecology. Differential equations are commonly used to model the reproduction cycles of RNA viruses, and participants will learn how to formulate and solve these equations. CA models, on the other hand, can be used to study the spatial distribution of populations, and participants will learn how to implement and analyze these models. Here, we will define useful and well-stablished theories behind different interactions among biological species such as cooperative, antagonistic, and eco-evolutionary phenomena.

Session 4 (to be decided). Algorithms for the integration of ODEs.

Session 5 (Lluís Alsedà). Deterministic minimisation algorithms with inequality restrictions: penalty and barrier methods.

Quasi-Newton algorithms and Levenberg-Marquardt. Advantages and disadvantages and when to use them.

Session 6 (Lluís Alsedà, continuation of session 5). Examples of deterministic minimisation methods.

Detailed solutions of concrete examples.

Session 7 (Lluís Alsedà). Heuristic optimization methods.

Genetic algorithms. How do they work and hints on their implementation.

Session 8 (Lluís Alsedà, continuation of session 7). Heuristic optimization methods.

Detailed solutions of concrete examples.

Session 9 (Josep Sardanyés). Using Macroevolutionary algorithms (MA) for data fitting: theory and examples.

MA [2,3] have been successfully used for real data fitting in a variety of fields, such as biology, ecology, and engineering. These algorithms simulate the process of natural selection by generating a population of candidate solutions and iteratively improving them through the application of selection, mutation, and macroextinctions. Macroevolutionary algorithms are particularly well-suited for complex, multi-dimensional optimization problems where traditional optimization techniques may fail. Here, we will provide some theoretical aspects of this method together with an example used to fit dynamical models to experiments about plant RNA viral strains’ competition at different temperatures [4].

Session 10 (Lluís Alsedà). Other heuristic optimization methods.

Simulated annealing and Montecarlo methods. Pseudo-random number generators. How do they work and hints on their implementation.

Session 11 (Lluís Alsedà & Josep Sardanyés). Open debate about pros and cons of the different modelling approaches and optimisation tools proposed in the course.

The aim of this session is to share experiences on modelling and fitting with the audience and discuss how to decide between different approaches depending on the data type and properties.


1. Oro D., Alsedà Ll., Hastings A., Genovart M., Sardanyés J. Social copying drives a tipping point for nonlinear population collapse. Proceedings of the National Academy of Sciences USA 120(11), e2214055120 (2023)

2. Marín J., Solé RV. Macroevolutionary algorithms: A new optimization method on fitness landscapes. IEEE Transactions on Evolutionary Computation, 3(4), 272-286

3. J. Sardanyés, C. Alcaide, P. Martínez, SF. Elena. Modelling temperature-dependent dynamics of single and mixed infections in a plant virus. Applied Mathematical Modelling 102, 695-705 (2022)

4. Marín J., Solé RV. Evolutionary Optimization through extinction dynamics. IEEE Transactions on Evolutionary Computation, 3(4), 272-286

Organising Committee

Lluís Alsedà | Universitat Autònoma de Barcelona – CRM
Josep Sardanyés | Centre de Recerca Matemàtica


Lluís Alsedà

Professor at UAB, Director at CRM

I am a PH. D. in Mathematics since 1984 and professor at the Universitat Autònoma de Barcelona since 2004. Previously I have occupied a number of permanent positions in Mathematics and Economics.

I have supervised 8 PhD Thesis and a number of master thesis. I have published 1 book (two editions) and 4 books as associate editor. Also I have 93 published papers.

I have been Vice-Dean for Studies of the Faculty of Economics of the UAB, Director of the Department of Mathematics of the UAB, member of the Scientific Committees of several societies, main organizer of several international conferences with associated grants and I have been evaluating projects for several research agencies. Also, I have been co-creator and co-cordinator (during two terms of three years) of the Spanish network DANCE (; including 220 researchers on dynamical systems and non-linear dynamics of the whole Spain).

Josep Sardanyés

Principal Investigator at CRM

Josep Sardanyés holds a degree in Biology from the University of Barcelona and a doctorate in Biomedicine from the Pompeu Fabra University (UPF). After obtaining his doctorate, he spent time as a postdoctoral researcher at the Institute of Plant Molecular and Cellular Biology (CSIC-UPV, Valencia), at The David J. Gladstone Institutes (University of California, San Francisco, USA), and at the Complex Systems Laboratory of the UPF. Since 2017, he has been a researcher in the Mathematical and Computational Biology Group of the CRM.


Name Institution
Mittu Walia Indian Institute of Technology Roorkee
Daniela Cialfi Università degli studi Gabriele d\'Annunzio
Gissell Estrada-Rodriguez Universitat Politècnica de Catalunya
Felipe Lumbreras Universitat Autònoma de Barcelona
J. Tomás Lázaro Universitat Politècnica de Catalunya
Jorge Ramirez Ruiz Universitat Pompeu Fabra
Teodoro Mayayo Universitat Politècnica de Catalunya
Mehdi Lotfi University of Greifswald
Andriana Karuk FIDMAG
Marc Jorba-Cuscó Centre de Recerca Matemàtica
Sudhir Singh Gitam University, Bengaluru, India
Ernest Montbrió Universitat Pompeu Fabra
Oriol Llopis Almela Centre de Recerca Matemàtica
Marta Pardo Araujo Universitat Politècnica de Catalunya
Juan Arellano Tintó Centre de Recerca Matemàtica
Èlia Lleal Neuroelectrics
JIAN WANG Katholieke Universiteit Leuven
Nabil REZAIKI Badji Mokhtar university
Philip Pita Universitat de Barcelona
Nilay Yönet Yildiz Technical University
Isaac de Palau Universitat de Girona
Ielyaas Cloete Centre de Recerca Matemàtica
Maria Guasch Morgades Neuroelectrics
Juan Carlos Muñoz Sánchez CSIC
Sandra Hidalgo Vazquez Centre de Recerca Matemàtica
Andrea Suárez Segarra Universitat Politecnica de Catalunya
Burcu Gürbüz Johannes Gutenberg University of Mainz
Miquel Barcelona Poza Universitat Autònoma de Barcelona
Carles Trullàs Fernàndez Universitat Autònoma de Barcelona
Lucas Esquenet Universitat de Barcelona
Pau Reig Centre de Recerca Matemàtica
Carlos Mejia-Monasterio Universidad Politécnica de Madrid
Jan Medina Pontificia Universidad Javeriana Cali
Dmitry Sinelshchikov Biofisika Institute (CSIC, UPV/EHU)
Pablo García Cuadrillero UPM
Tiago Simas U-TAD
Mar Angulo U-tad
Júlia Albero Universitat Autònoma de Barcelona
Mary Luz Mouronte-López Universidad Francisco de Vitoria
Harshali Chaudhari Indian Institute of Technology Bombay
Marcos Fernández Martínez CREAF
Ramon Prat Universitat Autònoma de Barcelona
Pau Costa Soriano Centre de Recerca Matemàtica
Borja Mercadal Neuroelectrics
Lorena Martínez España CSIC
Raul Mendez Universidad Autónoma Metropolitana
César Ulises Castillo González Universidad Autónoma Metropolitana Azcapotzalco
Martín de Muniategui Climente University of Cambridge
Jose Angel Vicente Gomez University of Bologna
Vizda Anam BCAM
Akhil Srivastav BCAM, Bilbao, Spain
Albert Ruiz Universitat Autònoma de Barcelona
Axel Maso-Puigdellosas Centre de Recerca Matemàtica
Stefano Pedarra Centre de Recerca Matemàtica
Lucía Arancibia Centre de Recerca Matemàtica
VICTOR ALBERTO CRUZ Universidad Autónoma Metropolitana
Gerard Sandiumenge Universitat Autònoma de Barcelona
Anna Wilson Ganzabal Centre de Recerca Matemàtica
Linzan Liu University of Malaya
Simon Syga Dresden University of Technology
Gerard Farré Universitat Politècnica de Catalunya
Carlos Llopis CSIC
Klaus Wimmer Centre de Recerca Matemàtica
Joan Llobera Querol Universitat de Les Illes Balears
Alexandre Garcia-Duran Centre de Recerca Matemàtica
Jose Alberto Aguilar Gonzalez Universitat de Les Illes Balears
Guillem Lleida Hidalgo University of L'Aquila


For inquiries about this event please contact the Scientific Events Coordinator Ms. Núria Hernández at​​