# How to solve a formal PDE

Introduction

A multivariate formal series $f\in\mathbb{Q}[[x_1,\ldots ,x_n]]$ can be written as $$f(x_1,\ldots ,x_n) = \sum_{i_1,\ldots ,i_n\geq 0}c(i_1,\ldots ,i_n)x_1^{i_1}\cdots x_n^{i_n} \quad .$$ When $1\leq k\leq n$ denote $f_k$ the partial derivative of $f$ with respect to the variable $x_k$, and when $1\leq k_1,\ldots k_t\leq n$ denote $f_{k_1\cdots k_t}$ the order $t$ partial derivative with respect to the variables $x_{k_1},\ldots ,x_{k_t}$. Since two formal power series are equal if all the coefficients of their monomials are equal, a partial differential equation for $f$ (formal PDE) is equivalent to a system of polynomial equations for the coefficients $c(i_1,\ldots ,i_n)$.

Example of mixed exponential type

Consider $n=2$ variables, and the formal power series $$f(x_1,x_2)=\sum_{d\geq 1}N(d)e^{dx_1}\frac{x_2^{3d-1}}{(3d-1)!} \quad .$$ This is an example of formal series of "mixed exponential type", because its presentation involves exponentials of some of the variables. By expanding the exponential and renaming indices, it can be written as above with $c(i_1,i_2)=(\frac{i_2+1}{3})^{i_1}N(\frac{i_2+1}{3})/(i_1!i_2!)$ if $i_2 \equiv 2 \; (\textrm{mod 3})$ and $c(i_1,i_2)=0$ otherwise. The PDE $$f_{222} = f_{112}^2 -f_{111}f_{122}$$ is equivalent to the polynomial equations for $d\geq 2$ $$N(d)=\sum_{d_1+d_2=d}N(d_1)N(d_2)\left( d_1^2d_2^2 \binom{3d-4}{3d_1-2} -d_1^3d_2\binom{3d-4}{3d_1-1}\right)$$ and this sequence is uniquely determined by the value of $N(1)$. As discovered by Kontsevich, if $N(1)=1$ then $N(d)$ is the number of rational curves of degree $d$ through $3d-1$ generic points in the complex projective plane.

Question

Can one use SageMath to solve formal PDEs? By solving I mean the following: given the formal PDE and a degree bound $b \in \mathbb{N}$, compute all numbers $c(i_1,\ldots ,i_n)\in\mathbb{Q}$ with $i_1+\ldots +i_n\leq b$ for the solution (assuming that it exists and is unique). In practice, it would be nice if the proposed method allowed to work with formal series of "mixed exponential type" too. A good test would be to see if in the example above the method computes, given $b\in\mathbb{N}$, all numbers $N(d)$ with $d \leq b$ as listed in OEIS A013587 (cannot post link due to low karma).

edit retag close merge delete

Do you mean a function like pdsolve/series in Maple?

( 2022-12-14 01:53:07 +0200 )edit

Sort by ยป oldest newest most voted

This functionality can be implemented via solving a system of polynomial equations:

L = 6        # number of terms to compute
R = PolynomialRing(QQ,L,'N')
N = R.gens()
K.<x1,x2> = PowerSeriesRing(R,default_prec=3*L)
f = sum(N[d]*((d+1)*x1).exp()*x2^(3*(d+1)-1)/factorial(3*(d+1)-1) for d in range(L))
p = f.polynomial()    # differentiation seems to be broken for power series
x = p.parent().gens()
eq = p.derivative( x[1], 3 ) - p.derivative( x[0], x[0], x[1] )^2 + p.derivative( x[0], x[0], x[0] )*p.derivative( x[0], x[1], x[1] )
J = R.ideal( list(eq.dict().values())+[N[0]-1] )
print( J.variety() )


Intermediate conversion to polynomial is needed here due to the bug https://trac.sagemath.org/ticket/34846

more

The last instruction gives the following error, and Sage quits automatically after it:

## (no backtrace available)

Unhandled SIGILL: An illegal instruction occurred. This probably occurred because a compiled module has a bug in it and is not properly wrapped with sig_on(), sig_off().

## Python will now terminate.

/Applications/SageMath/src/bin/sage-python: line 2: 2551 Illegal instruction: 4 sage -python "\$@"

( 2023-09-26 21:28:30 +0200 )edit

What's your Sage version? It may be worth it to update it to the latest one.

( 2023-09-26 21:49:26 +0200 )edit

It works with Sage 10.1. Thanks!

( 2023-10-05 15:28:02 +0200 )edit

## Stats

Seen: 258 times

Last updated: Dec 14 '22