This Mathematica program may help you finding the bilinear form of certain equation, or quickly verifying your calculation result.
Four kinds of different definition of Hirota D-operator are defined in HirotaD.m
These four different definitions have different calling methods. You can choose the one you like.
Just copy the definition of function into your project and run it.
The use of these functions is described below
Let's place some equations here for late use.
(1)
(2)
(3)
(4)
(5)
HirotaD[P(x, t, ...)][f, g] gives the multiple derivative
Eq. (1)-(5) defined above can be written as
(* 1 *)
HirotaD[x][f[x], g[x]]
(* 2 *)
HirotaD[x^2][f[x], g[x]]
or
HirotaD[x x][f[x], g[x]]
(* 3 *)
HirotaD[x t^2][f[x, t], g[x, t]]
(* 4 *)
HirotaD[x t y][f[x, t, y], g[x, t, y]]
(* 5 *)
HirotaD[x + t + 1][f[x, t], g[x, t]]
- Inside the function, variables (e.g.
x) have intermediate form with argument (e.gx[1]). So when input function contain variable and it's function calling form (e.g.xandx[1]),HirotaDmay cause miscalculation. - Argument
Pwill try to differentiate all symbols it have. So whenPcontains constant$C$ , make sure$C$ has a value or change the definition to execlude specific symbol.
(I know that this function name isn't good, you can rename it by yourself.)
HirotaD[P][f, g][x1, x2, ...], where
-
f,gare functions that differentiated by$\mathrm{D}$ , -
x1, x2, ...are independent variables and -
Pis a pure function consisting of a polynomial with anonymous parameters representing the order of independent variables.
NOTE: f and g need to be functions in Mathematica and should have same arguments.
Eq. (1)-(5) defined above can be written as
(* 1 *)
HirotaDD[#1 &][f, g][x]
(* 2 *)
HirotaDD[#1^2 &][f, g][x]
or
HirotaDD[#1 #1 &][f, g][x]
(* 3 *)
HirotaDD[#1 #2^2 &][f, g][x, t]
(* 4 *)
HirotaDD[#1 #2 #3 &][f, g][x, t, y]
(* 5 *)
HirotaDD[#1 + #2 + 1 &][f, g][x, t]
Dop[x, y, ...][n, m, ...][f, g] gives the multiple derivative
Eq. (1)-(5) defined above can be written as
(* 1 *)
Dop[x][1][f[x], g[x]]
(* 2 *)
Dop[x][2][f[x], g[x]]
(* 3 *)
Dop[x, t][1, 2][f[x], g[x]]
(* 4 *)
Dop[x, t, y][1, 1, 1][f[x, t, y], g[x, t, y]]
(* 5 *)
Dop[x][1][f[x, t], g[x, t]] + Dop[t][1][f[x, t], g[x, t]] + 1
The definition of HD is rely on Dop, so to use it, you have to define Dop first.
HD[f, g, {x, n}, {y, m}, ...] gives the multiple derivative
{x, n} can be wrtten as x if n=1.
Eq. (1)-(5) defined above can be written as
(* 1 *)
HD[f[x], g[x], x]
or
HD[f[x], g[x], {x, 1}]
(* 2 *)
HD[f[x], g[x], {x, 2}]
(* 3 *)
HD[f[x], g[x], x, {t, 2}]
(* 4 *)
Dop[f[x, t, y], g[x, t, y], x, t, y]
(* 5 *)
HD[f[x, t], g[x, t], x] + HD[f[x, t], g[x, t], t] + 1
Warning
There is not guarantee that all functions will give the correct result all the time. (Though I believe they should be right.)
If you encounter any problems, feel free to create a issue.