## NOAI2025 Chemical Reaction Kinetics Simulation

### Reference time to solve: 1 hour – 2.5 hours

### I. Problem Overview

Chemical reactions are often extremely complex. A seemingly simple chemical reaction may involve many different steps. For example, the reaction of hydrogen and oxygen to form water:
$$
2H_{2} + O_2 = H_2O
$$
actually contains no fewer than 10 elementary reactions (Reactions). In other words, one “reaction” may include 10 different steps.

Studying the elementary reactions in a chemical reaction is crucial, because it provides information about the reaction mechanism. Such information is essential for synthesizing complex substances (e.g., pharmaceuticals) more economically and efficiently. For example, research on the mechanism of ammonia synthesis has been a hotspot for more than 30 years, and chemists are still studying it today in order to minimize the cost of producing ammonia.

One way to study the elementary reactions in a chemical reaction is to monitor the concentrations of substances participating in the reaction. Different elementary reactions lead to different patterns of how these concentrations change as the reaction proceeds. The method of obtaining information about elementary reactions in a chemical reaction by monitoring how the concentrations of key substances change over time is called kinetic study.

A typical organometallic reaction is:
$$
L_2M + D \leftrightharpoons L_2MD
$$
This reaction describes an organometallic complex $L_2M$ reacting with $D$ to form $L_2MD$, where $L_2M$ is a complex formed by a metal $M$ and two ligands $L$, and $L_2MD$ is also a complex of the metal $M$. In this complex, $D$ adds to $M$, while the metal $M$ still has two other ligands $L$.

When carefully observing this reaction, chemists found:

1. A byproduct $L_2M_s$ is also formed, where $s$ indicates that there are $s$ units of $M$ in the compound.
2. The concentration of $L_2M$ decreases over time, and its rate of decrease is proportional to the concentration of $D$ in the reaction system and inversely proportional to the concentration of $L$.

These observations prompted chemists to propose the following elementary reactions (Reactions) to describe the reaction:

Reaction 1.      $L_2M \leftrightharpoons LM + L$

Reaction 2.      $LM + D \rightarrow LMD$

Reaction 3.      $LMD + L \leftrightharpoons L_2MD$

Reaction 4.      $LM \rightarrow LM_s$

Reaction 5.      $LMs + L \leftrightharpoons L_2M_s$

Among these elementary reactions, Reaction 1 to Reaction 3 describe the process of forming the target product $L_2MD$ from $L_2M$ and $D$, while Reaction 4 and Reaction 5 describe the formation of the byproduct $L_2M_s$. Reactions 2 and 4 are irreversible (meaning the reaction proceeds only from left to right), while Reactions 1, 3, and 5 are reversible (meaning the reaction can proceed both from left to right and from right to left).

With these reactions, we can write the kinetic equations for the above five reactions:

Eq 1-1.         $r_{1+} = k_{1+}\times c(L_2M)$

Eq 1-2.         $r_{1-} = k_{1-} \times c(LM) \times c(L)$

Eq 2.            $r_{2+} = k_{2+} \times c(LM) \times c(D)$

Eq 3-1.         $r_{3+} = k_{3+} \times c(LMD) \times c(L)$

Eq 3-2.         $r_{3-} = k_{3-} \times c(L_2MD)$

Eq 4.            $r_{4+} = k_{4+} \times c(LM)$

Eq 5-1.         $r_{5+} = k_{5+} \times c(LMs) \times c(L)$

Eq 5-2.         $r_{5-} = k_{5-} \times c(L_2Ms)$

Here, $r_n$ denotes the reaction rate of Reaction $n$. The suffix “+” indicates that *r* describes the reaction rate proceeding from left to right, while “-” indicates the reaction rate proceeding from right to left. Note that because Reactions 2 and 4 are irreversible, $r_{2-}$ and $r_{4-}$ are zero, so they are not listed. In addition, $k_n$ denotes the rate constant of Reaction $n$ (which can be understood as a parameter affecting the rate), and it varies across reactions.

Based on the kinetic equations, we can write the difference equations describing how the concentration of each species changes over time, i.e., the concentration change of each species with time, as follows:

Eq c1.       $ {\Delta c(L_2M)\over \Delta t}=-r_{1+} + r_{1-}$

Eq c2.       $ {\Delta c(D)\over \Delta t}=-r_{2+}$

Eq c3.       $ {\Delta c(L) \over \Delta t}=r_{1+} - r_{1-} -r_{3+} + r_{3-} -r_{5+} + r_{5-}$

Eq c4.       $ {\Delta c(LM)\over \Delta t}=r_{1+} - r_{1-} - r_{2+} - r_{4+}$

Eq c5.       $ {\Delta c(LMD)\over \Delta t}=r_{2+} - r_{3+} + r_{3-}$

Eq c6.       $ {\Delta c(L_2MD)\over \Delta t}=r_{3+} - r_{3-}$

Eq c7.       $ {\Delta c(LMs)\over \Delta t}=r_{4+} - r_{5+}+ r_{5-}$

Eq c8.       $ {\Delta c(L_2Ms)\over \Delta t}=r_{5+} - r_{5-}$

Take equation c1 as an example. Note that $L_2M$ is consumed at a rate of $r_{1+}$ when Reaction 1 proceeds from left to right, and is produced at a rate of $r_{1-}$ when Reaction 1 proceeds from right to left. Therefore, its rate of concentration change over time can be written as $\Delta c(L_2M)/\Delta t = -r_{1+} + r_{1-}$. The same logic applies to other species.

In practical kinetic studies, typically only the concentrations of starting materials and products are monitored, and these data are recorded once every $\Delta t$. In this task, $c(L_2M)$, $c(D)$, $c(L)$, $c(L_2MD)$, and $c(L_2M_s)$ are recorded every 10.0 seconds. In an experiment where the initial concentrations of $L_2M$, $D$, and $L$ are 1.0 mol/L, 1.0 mol/L, and 0.0 mol/L respectively, the concentration–time curves of each species are shown in the figure below:

![alt](https://bohrium.oss-cn-zhangjiakou.aliyuncs.com/article/161804/43bb2cc13b6a41ba97b9c7616523048f/e23a4b19-73e5-45f1-b6b2-a693ab6eca37.png)
*Figure 1*

When the initial concentrations of $L_2M$ and $D$ remain unchanged, but the initial concentration of $L$ becomes 2.5 mol/L, the curves become as shown below:

![![](exp1_trace.png)](https://bohrium.oss-cn-zhangjiakou.aliyuncs.com/article/161804/43bb2cc13b6a41ba97b9c7616523048f/3b8f1a91-231d-423b-b03e-79f2928da900.png)
*Figure 2*

From the figures, it can be seen that a higher concentration of $L$ causes a significant extension of the reaction time, i.e., the overall reaction rate becomes slower. The overall rate can be evaluated by the reactant half-life $t_{1/2}$.

**The half-life of a reactant is defined as the time required for the concentration of that reactant to decrease by half. In this problem, we can use the $t_{1/2}$ of $L_2M$ to represent the overall reaction rate.**
$$
c(L_2M)(t = t_{1/2}) = 1/2\times c(L_2M)(t = 0)
$$
Taking Figure 1 as an example, $c(L_2M)$ reaches $0.5\,\text{mol/L}$ between 40 s and 50 s. At this time, the reactant has decreased by half from the initial value of $1\,\text{mol/L}$, so the reactant half-life lies between 40 s and 50 s. Combined with the final $t_{1/2}$ answer label of **Figure 1** in *training_data*, we know that the true half-life of $c(L_2M)$ is $43.650\,\text{s}$.

### II. Dataset

This problem includes a training set, a validation set, and a test set.

**1. Training set**: Provides concentration–time data from 1000 independent experiments, stored in the `data_train` folder. The data are stored in `.dat` files, with filenames from `"exp0_trace.dat"` to `"exp999_trace.dat"`.

These `.dat` files are stored in tabular form, showing the time (in seconds, s) at which the concentrations of key species are recorded, and the corresponding concentration data (in mol/L). All data are stored in scientific notation with 4 decimal places:

|    *t*     |  c(L~2~M)  |    c(D)    |    c(L)    |  c(L2MD)   |  c(L2Ms)   |
| :--------: | :--------: | :--------: | :--------: | :--------: | :--------: |
| 0.0000e+00 | 1.0000e+00 | 1.0000e+00 | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 |
| 1.0000e+01 | 8.0644e-01 | 8.9306e-01 | 9.5117e-02 | 7.7999e-02 | 2.0449e-0  |
| 2.0000e+01 | 6.9319e-01 | 8.0034e-01 | 9.5125e-02 | 1.6584e-01 | 4.5845e-02 |
|    ...     |    ...     |    ...     |    ...     |    ...     |    ...     |

Additional data for each experiment are stored in a file named `training_data.dat`, which lists other relevant information for each experiment in tabular form.

| Experiment Number | c(L2M) (t = 0) / (mol/L) | c(D)(t = 0) / (mol/L) | c(L)(t = 0) / (mol/L) | Monitoring time / s |  t12 / s   | Reaction Extent / % | Product Yield / % | Side Product Yield / % |
| :---------------: | :----------------------: | :-------------------: | :-------------------: | :-----------------: | :--------: | :-----------------: | :---------------: | :--------------------: |
|         0         |        1.0000e+00        |      1.0000e+00       |      0.0000e+00       |     7.0266e+02      | 4.3650e+01 |     9.9900e+01      |    6.3200e+01     |       2.7100e+01       |
|         1         |        1.0000e+00        |      1.0000e+00       |      2.5000e+00       |     7.2996e+03      | 8.5969e+02 |     9.7970e+01      |    6.8500e+01     |       2.9000e+01       |
|         2         |        1.0000e+00        |      1.0000e+00       |      5.0000e+00       |     1.1584e+04      | 1.7058e+03 |     9.6100e+01      |    6.7600e+01     |       2.8300e+01       |
|        ...        |           ...            |          ...          |          ...          |         ...         |    ...     |         ...         |        ...        |          ...           |

The experiment number is in the first column and corresponds to the “###” in the filename (e.g., “exp###_trace.dat”). The column **t12/s** records the value of the half-life of the reaction, showing the true half-life of $L_2M$ under those reaction conditions. Reaction Extent indicates how much $L_2M$ has participated in the reaction when monitoring stops. The other data do not need further explanation.

**2. Validation set**: Contains the initial data of $c(L_2M)$, $c(D)$, and $c(L)$ for 100 experiments. This validation set will be displayed on the A leaderboard, and contestants can see it to test whether their proposed solution method is generalizable. An example is shown below:

| Experiment Number | c(L2M)(t = 0) / (mol/L) | c(D)(t = 0) / (mol/L) | c(L)(t = 0) / (mol/L) |
| :---------------: | :---------------------: | :-------------------: | :-------------------: |
|         0         |       3.2779e+00        |      2.2379e+01       |      1.0562e+01       |
|         1         |       6.7345e+00        |      1.8483e+01       |      1.9717e+01       |
|         2         |       7.1102e+00        |      1.6918e+01       |      2.7257e+01       |
|        ...        |           ...           |          ...          |          ...          |

**3. Test set**: Contains the initial data of $c(L_2M)$, $c(D)$, and $c(L)$ for 412 experiments. This test set will serve as the B leaderboard and as the final competition evaluation score. The data format is the same as the validation set.

In the competition, contestants can access the training set through [training set link](). Contestants cannot obtain the test set and validation set, and can only read them via environment variables as described in [baseline.ipynb](https://www.bohrium.com/en/notebooks/87572239178).

### III. Task

Contestants need to develop a method to predict the half-life $t_{1/2}$ of $L_2M$ based on the initial data of $c(L_2M)$, $c(D)$, and $c(L)$ in each experiment, and store the experiment number and the predicted $t_{1/2}$ value into a table for output.

Hint: In this task, the more thoroughly you analyze the chemical reaction itself, the more accurate your solution may be. The reference solution method is to use the given concentrations to redefine some “features”, and then feed these “features” into a model for training. Since the number of “features” in this task is relatively small, it is not recommended to use overly complex models. Improvements in accuracy still rely on understanding the problem itself.

### IV. Submission

Please submit a file named `submission.ipynb`. This file should be able to predict the half-life $t12$ of $L_2M$ in the validation and test sets based on the initial data of $c(L_2M)$, $c(D)$, and $c(L)$. In this task, you may submit a model without submitting the training process.

The output should be a zip file named `submission.zip`, which contains two tables `submission_val.csv` and `submission_test.csv`, corresponding to the prediction results for the validation set and the test set, respectively. Each table should contain two columns: the first column is the experiment number “Experiment Number”, and the second column is the half-life “t12”. The reference format is shown below. All floating-point numbers should be stored in scientific notation with 4 decimal places.

**Note:** The output tables should have headers. The data in the table are not actual computed results and are only an example of the submission format.

The submission format reference can be found in [baseline.ipynb]().

| Experiment Number |    t12     |
| :---------------: | :--------: |
|         0         | 4.0000e+01 |
|         1         | 9.6000e+02 |
|         2         | 1.7100e+03 |
|        ...        |    ...     |

### V. Scoring

The scoring method is as follows:

For the $i$-th experiment, the score is computed as:
$$
Score_{i} = \max\left(0, 1 - \frac{\ln(1+0.1\times \lvert t_{1/2, predicted,i}-t_{1/2, target,i}\rvert)}{5}\right)
$$
For the overall score, suppose there are *n* experiments in the test set. The overall score is:
$$
Score = \frac{\sum_{i = 1}^{n} Score_i}{n}
$$