In this example we use the package IntroToSymmetry.m to work out the point group of the nonlinear Schröedinger equation

iWt+Wxx+W*Abs[W^2]=0. 
 
where i=Sqrt[-1]. This equation describes weakly nonlinear behavior in a wide variety of physical systems from light propagation to water waves. It is convenient to treat the two equations for the real and imaginary parts of W. Let 

W[x,t]=U[x,t]+iV[x,t].

So we consider

Ut+Vxx+V*U^2+V^3=0,
Vt-Uxx-U^3-U*V^2=0.

Clear all symbols in the current context.

ClearAll[Evaluate[Context[]<>"*"]]

First read in the package which is located in User Home Folder/Library/Mathematica/Applications/SymmetryAnalysis.

Needs["SymmetryAnalysis`IntroToSymmetry`"]

Enter the list of independent variables.

independentvariables={"x","y"};

Enter the list of dependent variables.

dependentvariables={"u","v"};

Enter the list of function and/or constant names that need to be preserved when the equations are expressed in terms of generic variables.

frozennames={};

Enter the maximum derivative order of the 
input equation(s).

p=2;

The maximum derivative order that the infinitesimals are assumed to depend on is specified by the input parameter r. This parameter is only nonzero when the user is looking for Lie contact groups or Lie-Backlund groups. For the usual case where one is searching for point groups set r=0.

r=0;

When searching for Lie-Backlund groups ie. r=1 or greater one can, without loss of generality, leave the independent variables untransformed. The corresponding infinitesimals (the xse's) are set to zero by setting xseon=0. If one is searching for point groups then set xseon=1. The choice xseon=1 is also an option when looking for Lie-Backlund groups and this can be useful when looking for contact symmetries.

xseon=1;

When searching for Lie-Backlund groups it is necessary to differentiate the input equations with respect to all independent variables producing derivatives of order p+r. 
These higher order differential consequences are appended to the set of rules applied to the invariance condition. This process is carried out automatically when internalrules=1. For point groups the equation or equation system is the only rule or set of rules needed and one sets internalrules=0.

internalrules=0;

Construct the array of rules to be applied to the invariance condition.

rulesarray=
{"D[u[x,y],y]->-D[v[x,y],x,x]-u[x,y]^2*v[x,y]-v[x,y]^3",
"D[v[x,y],y]->D[u[x,y],x,x]+u[x,y]^3+u[x,y]*v[x,y]^2"};

Enter the momentum equation as a string. The variables are as follows

inputequation1=
"D[u[x,y],y]+D[v[x,y],x,x]+u[x,y]^2*v[x,y]+v[x,y]^3";

Enter the pressure equation as a string. The variables are as follows

inputequation2=
"D[v[x,y],y]-D[u[x,y],x,x]-u[x,y]^3-u[x,y]*v[x,y]^2";

Now work out the determining equations of the Lie point group which leaves equation1 invariant.  The Mathematica function Timing outputs the time required for the FindDeterminingEquations function to execute.

Timing[FindDeterminingEquations[
independentvariables,dependentvariables,frozennames,p,r,xseon,
inputequation1,rulesarray,internalrules]]

The determining equations of equation1.

zdeterminingequations1=zdeterminingequations;

Now work out the determining equations of the Lie point group which leaves equation2 invariant.

Timing[FindDeterminingEquations[
independentvariables,dependentvariables,frozennames,p,r,xseon,
inputequation2,rulesarray,internalrules]]

The determiningequations of equation2.

zdeterminingequations2=zdeterminingequations;

Now collect all the determining equations together.

zdeterminingequations3=
Join[zdeterminingequations1,
zdeterminingequations2];

How many determining equations are there altogether?

Length[zdeterminingequations3]

Now solve the determining equations in terms of multivariable polynomials. The Mathematica function Solve uses Gaussian elimination to solve a large number of linear equations for the polynomial coefficients. The time roughly follows

time/timeref=((number of equations)/(number of equationsref))^n

where the exponent is between 2.4 and 2.7. The Mathematica  function Timing outputs the time required for the SolveDeterminingEquations function to execute.

Timing[SolveDeterminingEquations[
independentvariables,dependentvariables,r,xseon,zdeterminingequations3,order=3]]

Here are the infinitesimal transformation functions for the independent variables.

xsefunctions

and for the dependent variables.

etafunctions

infinitesimalgroupsxy=infinitesimalgroups/.{z1->x,z2->t,z3->u,z4->v};

Check the groups. xse's are on the left, eta's are on the right.

Column[infinitesimalgroupsxy]

Check the infinitesimals in the determining equations.

Simplify[ToExpression[zdeterminingequations]]

This is the five-dimensional Lie algebra of the nonlinear Schrödinger equation. Create the commutator table.

MakeCommutatorTable[
independentvariables,dependentvariables,infinitesimalgroupsxy]

MatrixForm[commutatortable]

MaxMemoryUsed[ ]