Burgers dataset

Dataset consisting of solutions to Burgers’ equation.

from __future__ import annotations

from gemseo import configure_logger
from gemseo import create_benchmark_dataset
from gemseo.post.dataset.curves import Curves

configure_logger()
<RootLogger root (INFO)>

Load Burgers’ dataset

We can easily load this dataset by means of the high-level function create_benchmark_dataset():

dataset = create_benchmark_dataset("BurgersDataset")
print(dataset)
GROUP        inputs       outputs            ...
VARIABLE          t           u_t            ...
COMPONENT       0             0         1    ...       498       499           500
0          0.000000 -8.610583e-43  0.012566  ... -0.025133 -0.012566  8.610583e-43
1          0.068966 -2.580645e-01 -0.246309  ... -0.281576 -0.269820 -2.580645e-01
2          0.137931 -4.848485e-01 -0.473805  ... -0.506935 -0.495892 -4.848485e-01
3          0.206897 -6.857143e-01 -0.675302  ... -0.706539 -0.696126 -6.857143e-01
4          0.275862 -8.648649e-01 -0.855016  ... -0.884563 -0.874714 -8.648649e-01
5          0.344828 -1.025641e+00 -1.016297  ... -1.044329 -1.034985 -1.025641e+00
6          0.413793 -1.170732e+00 -1.161843  ... -1.188509 -1.179620 -1.170732e+00
7          0.482759 -1.302326e+00 -1.293851  ... -1.319276 -1.310801 -1.302326e+00
8          0.551724 -1.422222e+00 -1.414124  ... -1.438419 -1.430321 -1.422222e+00
9          0.620690 -1.531915e+00 -1.524161  ... -1.547404 -1.539655 -1.531904e+00
10         0.689655 -1.632653e+00 -1.625216  ... -1.642738 -1.636298 -1.629650e+00
11         0.758621 -1.725490e+00 -1.718345  ... -1.068848 -1.175574 -1.266034e+00
12         0.827586 -1.811321e+00 -1.804445  ...  1.494420  1.473941  1.447486e+00
13         0.896552 -1.890909e+00 -1.884283  ...  1.407409  1.413715  1.419947e+00
14         0.965517 -1.964912e+00 -1.958519  ...  1.218988  1.225377  1.231764e+00
15         1.034483 -2.033898e+00 -2.027722  ...  1.042093  1.048270  1.054446e+00
16         1.103448 -2.098361e+00 -2.092386  ...  0.876779  0.882753  8.887274e-01
17         1.172414 -2.158730e+00 -2.152946  ...  0.721961  0.727745  7.335297e-01
18         1.241379 -2.215385e+00 -2.209778  ...  0.576670  0.582276  5.878827e-01
19         1.310345 -2.268657e+00 -2.263218  ...  0.440053  0.445492  4.509310e-01
20         1.379310 -2.318841e+00 -2.313559  ...  0.311355  0.316637  3.219185e-01
21         1.448276 -2.366197e+00 -2.361064  ...  0.189909  0.195042  2.001743e-01
22         1.517241 -2.410959e+00 -2.405967  ...  0.075117  0.080109  8.510101e-02
23         1.586207 -2.453333e+00 -2.448474  ... -0.033553 -0.028694 -2.383501e-02
24         1.655172 -2.493506e+00 -2.488774  ... -0.136578 -0.131845 -1.271120e-01
25         1.724138 -2.531646e+00 -2.527033  ... -0.234386 -0.229773 -2.251598e-01
26         1.793103 -2.567901e+00 -2.563402  ... -0.327364 -0.322865 -3.183658e-01
27         1.862069 -2.602410e+00 -2.598019  ... -0.415861 -0.411470 -4.070798e-01
28         1.931034 -2.635294e+00 -2.631007  ... -0.500194 -0.495906 -4.916191e-01
29         2.000000 -2.666667e+00 -2.662478  ... -0.580649 -0.576460 -5.722716e-01

[30 rows x 502 columns]

Show the input and output data

print(dataset.input_dataset)
print(dataset.output_dataset)
GROUP        inputs
VARIABLE          t
COMPONENT         0
0          0.000000
1          0.068966
2          0.137931
3          0.206897
4          0.275862
5          0.344828
6          0.413793
7          0.482759
8          0.551724
9          0.620690
10         0.689655
11         0.758621
12         0.827586
13         0.896552
14         0.965517
15         1.034483
16         1.103448
17         1.172414
18         1.241379
19         1.310345
20         1.379310
21         1.448276
22         1.517241
23         1.586207
24         1.655172
25         1.724138
26         1.793103
27         1.862069
28         1.931034
29         2.000000
GROUP           outputs                      ...
VARIABLE            u_t                      ...
COMPONENT           0         1         2    ...       498       499           500
0         -8.610583e-43  0.012566  0.025133  ... -0.025133 -0.012566  8.610583e-43
1         -2.580645e-01 -0.246309 -0.234553  ... -0.281576 -0.269820 -2.580645e-01
2         -4.848485e-01 -0.473805 -0.462762  ... -0.506935 -0.495892 -4.848485e-01
3         -6.857143e-01 -0.675302 -0.664890  ... -0.706539 -0.696126 -6.857143e-01
4         -8.648649e-01 -0.855016 -0.845166  ... -0.884563 -0.874714 -8.648649e-01
5         -1.025641e+00 -1.016297 -1.006953  ... -1.044329 -1.034985 -1.025641e+00
6         -1.170732e+00 -1.161843 -1.152955  ... -1.188509 -1.179620 -1.170732e+00
7         -1.302326e+00 -1.293851 -1.285376  ... -1.319276 -1.310801 -1.302326e+00
8         -1.422222e+00 -1.414124 -1.406026  ... -1.438419 -1.430321 -1.422222e+00
9         -1.531915e+00 -1.524161 -1.516407  ... -1.547404 -1.539655 -1.531904e+00
10        -1.632653e+00 -1.625216 -1.617779  ... -1.642738 -1.636298 -1.629650e+00
11        -1.725490e+00 -1.718345 -1.711199  ... -1.068848 -1.175574 -1.266034e+00
12        -1.811321e+00 -1.804445 -1.797569  ...  1.494420  1.473941  1.447486e+00
13        -1.890909e+00 -1.884283 -1.877657  ...  1.407409  1.413715  1.419947e+00
14        -1.964912e+00 -1.958519 -1.952125  ...  1.218988  1.225377  1.231764e+00
15        -2.033898e+00 -2.027722 -2.021545  ...  1.042093  1.048270  1.054446e+00
16        -2.098361e+00 -2.092386 -2.086412  ...  0.876779  0.882753  8.887274e-01
17        -2.158730e+00 -2.152946 -2.147161  ...  0.721961  0.727745  7.335297e-01
18        -2.215385e+00 -2.209778 -2.204172  ...  0.576670  0.582276  5.878827e-01
19        -2.268657e+00 -2.263218 -2.257778  ...  0.440053  0.445492  4.509310e-01
20        -2.318841e+00 -2.313559 -2.308278  ...  0.311355  0.316637  3.219185e-01
21        -2.366197e+00 -2.361064 -2.355932  ...  0.189909  0.195042  2.001743e-01
22        -2.410959e+00 -2.405967 -2.400975  ...  0.075117  0.080109  8.510101e-02
23        -2.453333e+00 -2.448474 -2.443615  ... -0.033553 -0.028694 -2.383501e-02
24        -2.493506e+00 -2.488774 -2.484041  ... -0.136578 -0.131845 -1.271120e-01
25        -2.531646e+00 -2.527033 -2.522420  ... -0.234386 -0.229773 -2.251598e-01
26        -2.567901e+00 -2.563402 -2.558903  ... -0.327364 -0.322865 -3.183658e-01
27        -2.602410e+00 -2.598019 -2.593628  ... -0.415861 -0.411470 -4.070798e-01
28        -2.635294e+00 -2.631007 -2.626719  ... -0.500194 -0.495906 -4.916191e-01
29        -2.666667e+00 -2.662478 -2.658289  ... -0.580649 -0.576460 -5.722716e-01

[30 rows x 501 columns]

Load customized dataset

Load the data with custom parameters and input-output naming.

dataset = create_benchmark_dataset(
    "BurgersDataset", n_samples=20, n_x=700, fluid_viscosity=0.03
)
print(dataset)
GROUP        inputs        outputs            ...
VARIABLE          t            u_t            ...
COMPONENT       0              0         1    ...       697       698            699
0          0.000000 -8.337238e-143  0.008989  ... -0.017978 -0.008989  8.337238e-143
1          0.105263  -3.809524e-01 -0.372820  ... -0.397218 -0.389085  -3.809524e-01
2          0.210526  -6.956522e-01 -0.688227  ... -0.710503 -0.703078  -6.956522e-01
3          0.315789  -9.600000e-01 -0.953168  ... -0.973663 -0.966832  -9.600000e-01
4          0.421053  -1.185185e+00 -1.178860  ... -1.197836 -1.191511  -1.185185e+00
5          0.526316  -1.379310e+00 -1.373421  ... -1.391089 -1.385200  -1.379310e+00
6          0.631579  -1.548387e+00 -1.542878  ... -1.559406 -1.553896  -1.548387e+00
7          0.736842  -1.696970e+00 -1.691794  ... -1.707233 -1.702094  -1.696940e+00
8          0.842105  -1.828571e+00 -1.823692  ...  1.572538  1.577416   1.582292e+00
9          0.947368  -1.945946e+00 -1.941330  ...  1.271323  1.275939   1.280555e+00
10         1.052632  -2.051282e+00 -2.046903  ...  1.000999  1.005378   1.009757e+00
11         1.157895  -2.146341e+00 -2.142176  ...  0.757047  0.761213   7.653786e-01
12         1.263158  -2.232558e+00 -2.228586  ...  0.535789  0.539761   5.437330e-01
13         1.368421  -2.311111e+00 -2.307316  ...  0.334199  0.337994   3.417894e-01
14         1.473684  -2.382979e+00 -2.379345  ...  0.149765  0.153399   1.570324e-01
15         1.578947  -2.448980e+00 -2.445494  ... -0.019613 -0.016128  -1.264243e-02
16         1.684211  -2.509804e+00 -2.506455  ... -0.175707 -0.172358  -1.690094e-01
17         1.789474  -2.566038e+00 -2.562815  ... -0.320020 -0.316797  -3.135751e-01
18         1.894737  -2.618182e+00 -2.615077  ... -0.453837 -0.450732  -4.476269e-01
19         2.000000  -2.666667e+00 -2.663670  ... -0.578264 -0.575268  -5.722716e-01

[20 rows x 701 columns]

Plot the data

Curves(dataset, "x", "u_t").execute(save=False, show=True)
plot burgers
[<Figure size 640x480 with 1 Axes>]

Total running time of the script: ( 0 minutes 0.623 seconds)

Gallery generated by Sphinx-Gallery