GSoC 2016 Application: Singularity Functions - sampadsaha5/sympy GitHub Wiki

About Me

Basic Information

Name: Sampad Kumar Saha
University: Indian Institute of Technology, Kharagpur
Major: Mathematics and Computing
Email: [email protected]
IRC: sampadsaha5
Github: sampadsaha5
Blog: TODO
Timezone: IST (UTC +5:30)

Personal Background

My name is Sampad Kumar Saha, a second year undergraduate student at IIT Kharagpur, India. I am pursuing a degree in Mathematics and Computing. I was very much interested in learning Mathematics since my high schools. After joining the university,I got the exposed towards the field of Computer Science. I have taken courses like Probability and Statistics, Discrete Mathematics, Advanced Engineering Mathematics, Numerical Methods ,Mechanics of Materials, Programming and Data Stuctures and Design and Analysis of algorithm.

Programming Details

Platform

I am using Ubuntu 14.04 LTS as an operating system and Sublime Text as my primary text editor with some really cool plugins such as DocBlockr, Emmet which really help me to write programs faster. Its multi-edit feature really assit me to search or edit anything quite easily. I am quite familiar with the concept of version control system and have been using Git and GitHub since quite some time and have enough knowledge to carry out the project successfully.

Experience

I started learning programming about two years ago with the C language. Then I got introduced to Web Development and have developed some basic web applications.

For nearly one year I have started learning object oriented programming and then I got to know about python for being the most widely used high-level, general-purpose scripting language. Its dynamic type system and its pretty cool syntax allows me to express concepts in fewer lines of code.

Contribution to Sympy

I was introduced to Sympy by Abinash Meher. I have started contributing to Sympy by fixing easy-to-fix bugs. I have been learning a lot from this great community. Sympy has smooth transition between symbolic and numeric world. Sympy objects can be easily used to create symbolic mathematical expressions to compute limits, integrals, derivatives and to solve equations very efficiently. Its large number of modules provides succor to tackle almost every mathematical problems.

Here is the link to all my contributions to Sympy.

The Project

Overview

Sympy is a pure python library which provides a full featured computer algebra system in a very comprehensible and easily extensible way. As mentioned in the idea page, Sympy currently lacks a stand-alone Singularity Function module.

We can use Piecewise for denoting a Singularity Function but it would be very complicated for the users to handle and perform complex operations using those functions.

For example :

  • Using Piecewise:-
In[0] : 3*Piecewise(((x-a)**n,x>=a),(0,x<a)) + 4*Piecewise(((x-k)**n,x>=b),(0,x<b)) - 5*Piecewise(((x-m)**n,x>=c),(0,x<c))  

            ⎛⎧       n            ⎞     ⎛⎧       n            ⎞     ⎛⎧       n            ⎞
            ⎜⎪(x - a)    for x ≥ a⎟     ⎜⎪(x - b)    for x ≥ b⎟     ⎜⎪(x - c)    for x ≥ c⎟
Out[0] :  3⋅⎜⎨                    ⎟ + 4⋅⎜⎨                    ⎟ - 5⋅⎜⎨                    ⎟
            ⎜⎪    0      for x < a⎟     ⎜⎪    0      for x < b⎟     ⎜⎪    0      for x < c⎟
            ⎝⎩                    ⎠     ⎝⎩                    ⎠     ⎝⎩                    ⎠

  • Using singularityFunc (Method to be implement in Singularity Function module) :-
In[1] : 3*singularityFunc(x, a, n)  + 4*singularityFunc(x, b, n) - 5*singularityFunc(x, c, n)

                  n            n            n
Out[1] : 3⋅<x - a>  + 4⋅<x - b>  - 5⋅<x - c> 

singularityFunc would be more handy and simpler to use than Piecewise.

My proposal aims to add a module to Sympy to represent a Singularity Function and implement different mathematical operations along with a documentation citing examples of using this module for solving beam bending problems.

Motivation

Singularity Functions are one of the most important functions which are used in many aspects of science. We use these functions to :

  • Solve beam bending problems in mechanics
  • Circuital analysis in electronic models
  • Synthesizing different waveforms in communication engineering.

But in all these engineering aspects the use of manual calculations is advocated which is very error prone. Sometimes people use small simple functions and many assumptions to promote manual calculations with ease but by this way the problems becomes an over-simplified models which cannot adequately portray physical systems.

The best way to tackle this issue would be by implementing a full fledged computer algebra system supporting all the mathematical functionality on Singularity Functions. In this way ,productivity would get significantly increased for solving problems that are more realistic and challenging, by giving more focus to the physical concepts rathen than delegating with the horrendous mathematics involved.

Theory

A function is said to be singular if either of the following statements is true:

  • The function is discontinous
  • The derivative of the function is discontinous.

Mathematically, we can represent it as:

             ⎧       n           
       n     ⎪(x - a)    for x ≥ a
<x - a>   =  ⎨                    
             ⎪   0       for x < a
             ⎩                    

The Singularity Functions lies in the class of Discontinuity Functions. Here, at point a discontinuity occurs.

The integer n in the left hand side is not an exponent in the usual sense but an index which depicts the singularity strength. It actually characterizes the kind of discontinuity. For example :-

  • Doublet Function
            -2
     <x - a>
  • Dirac Delta Function
            -1
     <x - a>
  • Step Function
            0
     <x - a>
  • Ramp Function
            1
     <x - a>
  • Parabolic Ramp Function
            2
     <x - a>
  • n-th Order Ramp Function (For n>=0)
            n
     <x - a>

The brackets used < > for the notation of a Singularity Function is known as Macauley bracket.

The Singularity Functions acts as a Mathematical Switch. For x >= a the Switch turns ON i.e. 1 and for x < a the Switch turns OFF i.e. 0 .

Singularity Functions are exposed to addition, substraction, integration and differentiation.

The Plan and Prototype

TODO

Timeline

TODO

References

Enhanced Student Learning in Engineering Courses with CAS Technology
Beam Deflections by Discontinuity Functions

⚠️ **GitHub.com Fallback** ⚠️