Skip to content

Conversation

@tcalderon-space
Copy link

@tcalderon-space tcalderon-space commented Apr 29, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • [x ] Example
  • Documentation

Description

Adding the example for KP-I (Kadomtsev–Petviashvili equation) in matlab.

Related Issues & Documents

QA Instructions, Screenshots, Recordings

Please replace this line with instructions on how to test your changes, a note
on the devices and browsers this has been tested on, as well as any relevant
images for UI changes.

Added/updated tests?

_We encourage you to test all code included with MOLE, including examples.

  • Yes
  • [x ] No, and this is why: Following the regular tests for MOLE, this PR is for an addition of an example.
  • I need help with writing tests

Read Contributing Guide and Code of Conduct

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@mdumett
Copy link
Collaborator

mdumett commented May 21, 2025

Kadomtsev-Petviashivili equation (KP) has exact solutions under different set of parameters. It also includes a spatial derivative of the time derivative term that complicates its numerical solution.

This code needs to be tested better before including it in MOLE.

For numerical accuracy and expected behavior to compare to https://arxiv.org/pdf/1605.03213, where one can find appropriates domain size, dx, dt, and time derivative schemes. Another paper where one could find relevant information for the numerical solution of KP is https://www.sciencedirect.com/science/article/pii/S0096300313004633.

In addition, the code requires several improvements. For example, line 5 refers to a non-existing directory in the MOLE repository. Line 22 sets up dt = dx, but give no reason for that. Both dx and dt seem to be large. In line 28, the total number of time steps is set to one. The matrix in line 80 does not depend on the iteration and should be before the time loop. Boundary conditions require special care. In some cases it is known that exact solutions develop lumps.

xgrid = [x_1, x_1+dx/2:dx:x_2-dx/2, x_2];
ygrid = [y_1, y_1+dy/2:dy:y_2-dy/2, y_2];

num_steps = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tcalderon-space , thank you so much for considering contributing to MOLE!

Perhaps here you meant to use this line for testing/debugging purposes, using only 1 time step? Thank you!

@tcalderon-space
Copy link
Author

Kadomtsev-Petviashivili equation (KP) has exact solutions under different set of parameters. It also includes a spatial derivative of the time derivative term that complicates its numerical solution.

This code needs to be tested better before including it in MOLE.

For numerical accuracy and expected behavior to compare to https://arxiv.org/pdf/1605.03213, where one can find appropriates domain size, dx, dt, and time derivative schemes. Another paper where one could find relevant information for the numerical solution of KP is https://www.sciencedirect.com/science/article/pii/S0096300313004633.

In addition, the code requires several improvements. For example, line 5 refers to a non-existing directory in the MOLE repository. Line 22 sets up dt = dx, but give no reason for that. Both dx and dt seem to be large. In line 28, the total number of time steps is set to one. The matrix in line 80 does not depend on the iteration and should be before the time loop. Boundary conditions require special care. In some cases it is known that exact solutions develop lumps.

Thank you for responding! I don't have access to the second article (even while using the school's account), but I will follow the values given in the first article. I did have a question though, if I follow the Zaitsev traveling wave solution (pg 6) the results don't seem to be the same as the one from this page http://scholarpedia.org/article/Kadomtsev-Petviashvili_equation#:~:text=Line%20solitonsThe%20one-soliton%20solution%20of. Under "Line Solitons" will this change anything? When I use the new domain values, my results end up stiffer..

@mdumett
Copy link
Collaborator

mdumett commented May 30, 2025

KP-I has different analytical solutions depending on the parameter values. What was suggested is to provide a similar plots and the tables provided by the authors of that paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants