GSoC 2015 Application Mihir Wadwekar: Lie Group Methods for Second Order Differential Equations. - paramsingh/sympy GitHub Wiki


#Introduction# ###Personal Details### Name: Mihir Wadwekar
Email: [email protected]
Github/Gitter: mihir-w
University: IIIT Hyderabad ###Background### Hello, I am a third year undergrad pursuing computer science and engineering at IIIT Hyderabad. My courses include Data Structures, Advanced Algorithms, Machine Learning, Advanced Databases, Differential calculus, Operating System. I have a good academic record (CGPA: 9/10). I have been programming in python, C and C++ for nearly 3 years now and am a competitive programming enthusiast. I have regularly participated in competitive programming contests at codeforces , codechef under handle mihir_w and my team has qualified for ACM-ICPC regionals twice. Through my contribution to Sympy, I have learned enough knowledge of git to accomplish this project. Currently I am using Mint 19 with vim as my default editor.
My ongoing semester ends in late-April and the next one starts by mid-July. I do not have any other commitment and am ready to work 40-50 hours per week throughout the summer. ###Contribution to Sympy### I started working with Sympy since early-Jan 2015 and have been working since. ####Merged PR's####

  • 8841: Overwriting of tuples in bkey()
    bkey() function was overwriting tuples in dictionary instead of adding to it. This led to dropping of factors in powsimp.
  • 8877: Returning real solutions for system of equations
    Solving a system of equations in one form caused real solutions to be missed. Same solutions were detected if a the equations were written in a different form. The problem was that checking of solutions was not proper. Added a final check for solutions at the end. Later improved by smichr in 8890.
  • 8925, 8934: Handling of matrices by cse function
    cse function accepeted expressions, matrices and lists of expressions. It did not act if a list of matrices and expressions was passed. Changed code to look for matrices in lists, break it down and then form them back again in the same format.
  • 8935: No case for Float(0) in as_mpmath()
    as_mpmath() overlooked the case of Float(0) after simplification. As a result nsimplify was raising TypError for certain integrals.
  • 9078: map(lambda()) expressions
    List compression/generators are much easier to read than map(lambda()) expresssions. Replaced all such expressions with list compression/generators.

####Unmerged PR's####

  • 8967: Diophantine equations miss trivial solutions
    Diophantine equations sometimes return None when no solution is found, despite tsesrivial solution being present. Have added a check for homogeneous solutions which returns trivial solution if no other solution is found.

####Closed PR####

  • 8907: Improving float comparison for insignificant differences
    Float comparisons fails for expressions such as Mod(1.3, 1) == .3 despite there being insignificant difference among them. I tried comparing floats through string comparisons but could not encompass all test cases. smichr later fixed it though comp() function ( 8939 ).

####Issues Reported ####

  • 9079: Replacing some lists with generators

#Project# ###Aim### Currently only first order differential equations are solvable through lie groups. This project aims to extend the solving of ODE's through lie groups to include second order differential equations. ###Motivation### Symmetry is the key to solving differential equations. Lie group methods can be applied on all types of differential equations. Currently only first order DEs can be solved using lie groups. For second order DEs there are only special cases; there is no generic method. Such special cases are relatively few. Even if a ODE belongs to a certain type, there is no guarantee that it will get detected. Simplification has it's limits. Lie groups method is much more generic and does not rely upon classification of ODE. Successful implementation would increase the scope of ODE module greatly. Module such as physics, quantum would also get enriched as better equations would be incorporated. Partial DEs, Higher-order DEs can also be solved generically using lie groups. There is great potential in expanding the work further. ###Current work and Theory### A symmetry of an object/curve is a transformation whose action leaves the object/curve unchanged.

An object can have many symmetries. Many objects have an infinite set of symmetries. Consider a circle. Rotation by any epsilon around the center results in the same circle.

Lie groups may be thought of as a group having smoothly varying families of symmetries. A curve that gets mapped to itself by a symmetry is said to be invariant under the symmetry.

Briefly, the aim is to convert the given differential equation from the given co-ordinate system into another co-ordinate system where it becomes invariant under the lie symmetries. The resultant ODE can be expressed as a quadrature which can be solved easily.

Algorithm for first order differential equations is as follows:

Assuming dy/dx = Phi(x,y).

  1. Get infinitesimials xi and eta that fit the linearized symmetry condition through different heruristics:

  1. Get cannonical co-ordinates r and s by solving the following equations:


  1. Substitute the cannonical co-ordinates into the following equation. Solve the variable separable differential formed.

  1. Substitute back the original co-ordinates to get the final solution.

For second order differential equations, the flow of algorithm remains same but the theory behind it changes.

  • The symmetry condition changes:

  • Heuristics change. The nature of xi and eta functions has changed. They are a function of 3 variables rather than 2. xi{x,y,y1} and eta{x,y,y1}. Heuristics of the first order have to be rewritten to accommodate additional variable and the changed symmetry condition.

  • Methods for solving ODE after getting infinitesimals are changed. No one method might guarantee a solution. Hence there are 3 following methods which I plan to implement ( Further detail in implementation and references ):

  • Differential Invariants
    To use infinitesimals in finding differential invariants of order 0 and order 1.

  • First Integrals
    To use 2 pairs of 2 infinitesimals to build 2 pairs of solutions.

  • Canonical Co-ordinates
    Same as the one in first order. Change ODE into a coordinate system which makes the curve invariant under the symmetries.

###Deliverables###

  1. Improved infinitesimals function that returns lie symmetries for first order and second order differential equations.
  2. Solution of 2nd order differential equations through generated infinitesimals by method of differential invariants, first integrals and canonical co-ordinates.

###Implementation### Current Process flow:

Proposed Process flow:

Heuristic guesses remain the same. However their implementation would change. In 2nd order differential equations there is an additional variable dx/dy in infinitesimals along with a new symmetry condition. Changes to implementation would be as follows.

  1. abaco1
    TODO

  2. abaco2
    TODO

  3. linear
    TODO

  4. function_sum
    TODO

  5. bivariate
    TODO

After generating infitesimals, unlike first order solution cannot be generated through a single method. A number of methods have to be tried before no solution can be returned. I plan to implement following 3 currently.

Canonical co-ordinates
TODO

First Integral Method
TODO

Differential Invariant Method
TODO

###Examples### TODO
###Timeline### TODO


#References#