Hostname: page-component-74656f9884-6grmk Total loading time: 0 Render date: 2026-11-06T09:57:08.326Z Has data issue: false hasContentIssue false

Soliton solutions to KdV and KP equations using physics-informed neural networks

Published online by Cambridge University Press:  15 October 2026

Karnav Raval
Affiliation:
Department of Physics and Astronomy, Western University, London, ON, Canada
Nadia Aiaseh
Affiliation:
Department of Physics and Astronomy, Western University, London, ON, Canada
Nima Hosseini Dashtbayaz
Affiliation:
Department of Computer Science, Western University, London, ON, Canada
Olga Trichtchenko*
Affiliation:
Department of Physics and Astronomy, Western University, London, ON, Canada
Boyu Wang
Affiliation:
Department of Computer Science, Western University, London, ON, Canada
*
Corresponding author: Olga Trichtchenko; Email: otrichtc@uwo.ca
Rights & Permissions [Opens in a new window]

Abstract

Partial differential equations (PDEs) model a wide range of physical phenomena but are often difficult to solve analytically or numerically, particularly when they are nonlinear and contain high-order derivative terms, as in water-wave problems. Although many numerical methods exist, they are typically tailored to specific equations. Physics-informed neural networks (PINNs) have recently emerged as a flexible alternative by incorporating the governing PDE, together with initial and boundary conditions, directly into the network’s loss function. In this work, we systematically investigate the ability of PINNs to capture the nonlinear dynamics of the Korteweg–de Vries (KdV) equation and its two-dimensional generalization, the Kadomtsev–Petviashvili (KP) equation. Recovering nonlinear soliton interactions from the governing PDE alone therefore provides a stringent test of whether the network has learned the underlying dynamics rather than simply reproducing training data. We examine increasingly complex interacting-soliton configurations for KdV and analogous line-soliton and junction solutions for KP, evaluating how accuracy, training time and network complexity scale with problem difficulty. We also compare network architectures, activation functions and optimization strategies while benchmarking PINN performance against analytic solutions.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2026. Published by Cambridge University Press.
Figure 0

Figure 1. $u(x,t)$u(x,t) denotes the surface of the wave from its undisturbed level at $u=0$u=0 with depth $h$h.

Figure 1

Table 1. Parameters used for ICsTable 1 long description.

Figure 2

Table 2. Optimizer parameters used, common to all training cases and runsTable 2 long description.

Figure 3

Table 3. A summary of architecture size, training data counts and loss weights used for PINNs trained to solve the KdV and KP equations for various solution casesTable 3 long description.

Figure 4

Table 4. A summary of the performance (max normalized absolute error $||e||_\infty$||e||∞, final training loss and training time) of PINNs, trained and tested for various solution cases of the KdV and KP equationsTable 4 long description.

Figure 5

Figure 2. Solutions to the KdV equation for the single-soliton IC computed by a PINN over a test set of points within the training domain. Plots (top to bottom) show profiles at the initial, middle and final training time. The soliton is seen travelling at a constant speed while maintaining its shape, as expected.

Figure 6

Figure 3. Total loss during training of a PINN that solves the KdV equation for the single soliton IC. The blue solid line shows the training history of the PINN giving solutions seen in Figure 2; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The dashed vertical line represents where the optimizer was switched from Adam to L-BFGS.

Figure 7

Figure 4. Space-time portraits of the one-soliton solutions to the KdV equation (2.1) (left) and the log of normalized absolute error (right) given by (4.1) between the approximate and analytic solution evaluated on the test set of points, for the solutions seen in Figure 2. The largest error is for later times, near the location of the largest part of the soliton.Figure 4 long description.

Figure 8

Figure 5. The absolute point-wise normalized error (4.1) averaged over (top) $t$t and (bottom) $x$x, of the one-soliton solution for the KdV equation (2.1) computed by the PINN over the test domain. The blue line represents the PINN giving solutions seen in Figure 2; the black line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The error is smallest at the boundaries and for the initial time, as expected from the form of the loss given by (3.1).

Figure 9

Figure 6. Solutions to the KdV equation for the two-soliton IC computed by a PINN and shown at various times (as labelled), with topmost and bottom-most panels corresponding to initial and final training times, respectively. The solid line represents the nonlinear solution approximated by the PINN, and the dashed blue line is the linear combination of single soliton solutions. This highlights that the two solitons of the approximated solution emerge from the nonlinear interaction while maintaining their shape and amplitude but each with a phase shift.Figure 6 long description.

Figure 10

Figure 7. Total loss during training of a PINN that solves the KdV equation (2.1) for the two-soliton IC. The blue solid line shows the training history of the PINN giving solutions seen in Figure 2; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The dashed vertical line represents where the optimizer was switched from Adam to L-BFGS.

Figure 11

Figure 8. The absolute point-wise normalized error (4.1) averaged over $t$t (top) and $x$x (bottom), of the two-soliton solution for the KdV equation (2.1) computed by the PINN over the test domain. The blue line represents the PINN giving solutions seen in Figure 6; the black line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The error is smallest at the boundaries and for the initial time, as expected from the form of the loss given by (3.1).Figure 8 long description.

Figure 12

Figure 9. Space-time portraits of the two-soliton solutions to the KdV equation (2.1) (left) and the log of normalized absolute error (right) given by (4.1) between the approximate and analytic solution evaluated on the test set of points, for the solutions seen in Figure 6. The largest error is for later times, at the location of the largest part of the soliton.Figure 9 long description.

Figure 13

Figure 10. Solutions to the KPII equation (2.2) for the single line soliton case computed by a PINN over a test set of points and shown at various times (as labelled) spanning the training domain. The set of parameters used for the soliton is given in Table 3, as in [1].Figure 10 long description.

Figure 14

Figure 11. The absolute point-wise normalized error (4.1) averaged over $y$y and $t$t (top), $x$x and $t$t (middle), and $x$x and $y$y (bottom), of the single line soliton solution for the KPII equation (2.2) computed by the PINN over the test domain. The blue solid line represents the PINN giving solutions seen in Figure 10; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. We note that the error is smallest at the boundaries and for the initial time, as expected from the form of the loss given by (3.1).Figure 11 long description.

Figure 15

Figure 12. Total loss during training of a PINN that solves the KPII equation (2.2) for the single line soliton IC. The blue solid line shows the training history of the PINN giving solutions seen in Figure 2; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The dashed vertical line represents where the optimizer was switched from Adam to L-BFGS.

Figure 16

Figure 13. Solutions to the KPII equation (2.2) for the case of two-line solitons interacting in an x-junction, computed by a PINN over a test set of points and shown at various times (as labelled) spanning the training domain. The set of parameters used for the soliton is given in Table 3, as in [1].Figure 13 long description.

Figure 17

Figure 14. The absolute point-wise normalized error (4.1) averaged over $y$y and $t$t (top), $x$x and $t$t (middle), and $x$x and $y$y (bottom), of the x-junction solution for the KPII equation (2.2) computed by the PINN over the test domain. The blue solid line represents the PINN giving solutions seen in Figure 13; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. We note that the error is smallest at the boundaries and for the initial time, as expected from the form of the loss given by (3.1).Figure 14 long description.

Figure 18

Figure 15. Total loss during training of a PINN that solves the KPII equation (2.2) for the x-junction IC. The blue solid line shows the training history of the PINN giving solutions seen in Figure 2; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The dashed vertical line represents where the optimizer was switched from Adam to L-BFGS.

Figure 19

Figure 16. Solutions to the KPII equation (2.2) for the case of two-line solitons interacting in a y-junction, computed by a PINN over a test set of points and shown at various times (as labelled) spanning the training domain. The set of parameters used for the soliton is given in Table 3, as in [1].Figure 16 long description.

Figure 20

Figure 17. The absolute point-wise normalized error (4.1) averaged over $y$y and $t$t (top), $x$x and $t$t (middle), and $x$x and $y$y (bottom), of the y-junction solution for the KPII equation (2.2) computed by the PINN over the test domain. The blue solid line represents the PINN giving solutions seen in Figure 16; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. We note that the error is smallest at the boundaries and for the initial time, as expected from the form of the loss given by (3.1).Figure 17 long description.

Figure 21

Figure 18. Total loss during training of a PINN that solves the KPII equation (2.2) for the y-junction IC. The blue solid line shows the training history of the PINN giving solutions seen in Figure 2; the black solid line represents the mean, with the grey region representing the 0.02–0.98 inter-quantile range. The dashed vertical line represents where the optimizer was switched from Adam to L-BFGS.

Figure 22

Figure 19. KdV solutions for three-soliton IC. The black line shows the PINN-predicted solution, the orange dot-dash line shows the exact analytical solution and the blue dotted line shows the linear combination of individual solitons.Figure 19 long description.

Figure 23

Table 5. KP and KdV 3-soliton parameters and training dataTable 5 long description.

Figure 24

Table 6. KP 2-in-3 out and KdV 2- and 3-soliton performance corresponding to PINNs from Table 5Table 6 long description.

Figure 25

Figure 20. KdV 3-soliton: space-time portrait (left) and normalized absolute error (right).Figure 20 long description.

Figure 26

Figure 21. KP 2-in-3 out interaction.Figure 21 long description.

Figure 27

Figure 22. KP three-soliton error.Figure 22 long description.

Figure 28

Figure 23. KP three-soliton loss.

Figure 29

Figure A1. Average final loss for a variety of PINNs trained to solve the KdV and KP equations for various ICs. For each architecture, $n = 10$n=10 replications were trained and tested.Figure A1 long description.

Figure 30

Figure A2. Distribution of final loss for a variety of PINN architectures trained to solve the KdV and KP equations with various ICs. Boxes show the inter-quartile range (IQR, Q1–Q3), with the blue line and dots indicating the median and mean, respectively. Whiskers extend to (Q1 $-$− 1.5 $\times$× IQR) and (Q3 $+$+ 1.5 $\times$× IQR), with hollow circles indicating outliers beyond this range. For each architecture, $n = 10$n=10 replications were trained and tested.Figure A2 long description.

Figure 31

Figure A3. Average max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINNs trained to solve the KdV and KP equations for various ICs. For each architecture, $n = 10$n=10 replications were trained and tested.Figure A3 long description.

Figure 32

Figure A4. Distribution of max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINN architectures trained to solve the KdV and KP equations with various ICs. Boxes show the inter-quartile range (IQR, Q1–Q3), with the blue line and dots indicating the median and mean, respectively. Whiskers extend to (Q1 $-$− 1.5 $\times$× IQR) and (Q3 $+$+ 1.5 $\times$× IQR), with hollow circles indicating outliers beyond this range. For each architecture, $n = 10$n=10 replications were trained and tested.Figure A4 long description.

Figure 33

Table A1. Average max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINNs trained to solve the KdV equation with a one-soliton ICTable A1 long description.

Figure 34

Table A2. Average max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINNs trained to solve the KdV equation with a two-soliton ICTable A2 long description.

Figure 35

Table A3. Average max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINNs trained to solve the KP equation with a single line-soliton ICTable A3 long description.

Figure 36

Table A4. Average max normalized absolute error $||e||_\infty$||e||∞ for a variety of PINNs trained to solve the KP equation with a two-line-soliton y-junction ICTable A4 long description.

Figure 37

Figure B1. Component-wise loss during training of PINNs that solve the KdV equation for (left) single-soliton and (right) two-soliton ICs.

Figure 38

Figure B2. Component-wise loss during training of a PINN that solves the KPII equation for a single line-soliton IC.

Figure 39

Figure B3. Component-wise loss during training of PINNs that solve the KPII equation for two-line-soliton solutions, for the (left) x-junction and (right) y-junction ICs.

Figure 40

Figure C1. Solutions to the KdV equation for the two-soliton IC computed by a PINN trained with residual-based adaptive sampling, shown at various times (as labelled), with topmost and bottom-most panels corresponding to initial and final training time. The solid line represents the nonlinear solution approximated by the PINN, and the dashed blue line is the linear combination of single soliton solutions. Compared to Figure 6, computed with static (non-adaptive) sampling.Figure C1 long description.

Figure 41

Figure C2. Ensemble-averaged point-wise normalized error (4.1), averaged over $x$x, as a function of $t$t, comparing adaptive (residual-based) against non-adaptive (static) collocation sampling for the KdV two-soliton case. The adaptive scheme reduces the mean error across the full time range shown and substantially narrows the inter-quantile spread relative to non-adaptive sampling, indicating more consistent convergence across replications rather than only a lower typical error.

Figure 42

Figure C3. Ensemble-averaged point-wise normalized error (4.1), averaged over $t$t, as a function of $x$x, comparing adaptive against non-adaptive collocation sampling for the KdV two-soliton case (logarithmic error axis). Both strategies show the same qualitative pattern – error smallest near the domain edges, where initial and boundary data directly supervise the loss, and largest in the interior – but adaptive sampling visibly compresses this interior error peak, directly reducing the mid-domain error concentrated in the unlabelled collocation points rather than at the IC/BC.

Figure 43

Figure C4. Distribution of the maximum point-wise normalized error (4.1) $\|e\|_\infty$‖e‖∞ across random seeds, for adaptive versus non-adaptive (‘regular seed’) sampling, for the KdV two-soliton case. Non-adaptive seeds span a wide range of maximum error, while adaptive seeds cluster towards substantially lower maximum error, indicating improved worst-case reliability across random initializations.

Figure 44

Figure C5. Distribution of the mean point-wise normalized error (4.1) across random seeds, for adaptive versus non-adaptive (‘regular seed’) sampling, for the KdV two-soliton case. Adaptive sampling shifts this distribution sharply towards lower mean error and away from the broader, right-shifted distribution seen for non-adaptive sampling, indicating a reduction in both typical error and its variability across seeds.

Figure 45

Figure D1. Distribution of training times for a variety of activation functions.

Figure 46

Table D1. Summary of training times for the KdV one-soliton activation function studyTable D1 long description.

Figure 47

Figure D2. Average max normalized absolute error $\|e\|_\infty$‖e‖∞ for KdV one-soliton PINNs across a grid of architectures, trained with each of eight activation functions. For each architecture, $n = 10$n=10 replications were trained and tested.Figure D2 long description.

Figure 48

Figure D3. Average final training loss for KdV one-soliton PINNs across a grid of architectures, trained with each of eight activation functions. For each architecture, $n = 10$n=10 replications were trained and tested.Figure D3 long description.