GSoC 2016: Singularity Functions

458 views
Skip to first unread message

SAMPAD SAHA

unread,
Feb 26, 2016, 6:24:59 AM2/26/16
to sympy, moore...@gmail.com

Hi,

I am Sampad Kumar Saha , an Undergraduate Mathematics and Computing Student at I.I.T. Kharagpur.

I have gone through the idea page and I am interested in working on the project named Singularity Function.

By going through the Idea, I understood that we want to add a package to Sympy which can be used for for solving beam bending stress and deflection problems using singularity function. Am I correct?

We can by this way:-
While solving we will be having the moment function as an input which we can arrange in the form of singularity functions and then integrate it twice to get the deflection curve and we can give the plot or the equation obtained of deflection curve as an output. 

I have gone through some documents available on internet which have brief studies on solving beam bending stress and deflection problems using singularity functions.

References:- 
Since there is just a brief idea given in the idea page, I have a doubt that what are the things other than solving beam bending stress and deflection problems to be implemented in the project?

Any type of suggestions are welcome.

==========================================================================================================================================
Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Feb 26, 2016, 10:41:03 AM2/26/16
to SAMPAD SAHA, sympy
Sampad,

Yes the primary use case for these singularity functions will be beam bending problems. But the singularity functions themselves should be implemented in a purely mathematical way without reference to beams. So there should be a module for these functions that allows you to work with them independently and can be used for any work you may want to do with singularity functions. The second part would be to create examples that use them to solve beam problems or create a special module with a Beam object or some other abstractions that can make it very easy to solve beam bending problems.

I hope that helps.

Jason

SAMPAD SAHA

unread,
Feb 26, 2016, 4:29:43 PM2/26/16
to sympy, moore...@gmail.com
Hi Jason,

Thank you for the explanation. It really helped me.

So, basically we want to start it, firstly, by creating a module which would deal with the mathematical operations performed on Singularity Functions. After this whole module is prepared, we would focus on how to use this module for solving beam problems. Am I correct? 

Can you please explain me in brief that what are the mathematical operations we wanted to implement on that module?

Tim Lahey

unread,
Feb 29, 2016, 3:40:00 AM2/29/16
to SymPy
Hi,

Singularity functions are actually extremely easy to implement given that we have a Dirac delta and Heaviside functions. Assuming that the Dirac delta and Heaviside functions properly handle calculus, it’s trivial to wrap them for use as singularity functions. The only thing that will need to be added is the derivative of the Dirac delta (assuming it’s not already there). I implemented singularity functions in Maple in less than an afternoon.

I was a TA for a Mechanics of Deformable Solids course about 11 or 12 times and wrote it to help the students (as we have a site license for Maple). I also wrote a set of lecture notes on the topic.

Cheers,

Tim.
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/7cbe2101-fd59-484b-9e25-f563636d6366%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jason Moore

unread,
Feb 29, 2016, 11:47:57 AM2/29/16
to sy...@googlegroups.com
Tim,

I wouldn't say that they are "extremely easy" to implement. If we want a nice thorough package that does this, there will be plenty of work for the summer for a undergraduate GSoC student. If you'd like to share with us your implementation in a form that doesn't require owning Maple to understand it, I'm sure it would be helpful.

Thanks,

Jason

Tim Lahey

unread,
Feb 29, 2016, 12:02:37 PM2/29/16
to SymPy
Hi,

Singularity functions are just Dirac deltas, Heaviside functions, and polynomials multiplying a Heaviside function with an offset. I seriously wrote something to do it in less than an hour. The Maple code to do it is,

sFunc := proc(n,a)
if (n = -1) then
return diff(Heaviside(x-a),x);
else
if (n = -2) then
return diff(Heaviside(x-a),x$2);
else
return (x-a)^n*Heaviside(x-a);
end if;
end if;
end proc:

So, one just calls sFunc(n,a) where n is the power of singularity function and a is the offset from x=0. It’s worked for every problem I’ve tried (which is quite a few). Note that this requires good handling of Dirac deltas and Heaviside functions in the calculus code.

Now that’s just a crude version, if one wants it to look better then it’s a bit more work, but not a lot.

Cheers,

Tim.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AgRjgrOSAaWqDY5wmwBVn4K2A0gON0FJJv5qryFRHQu1Q%40mail.gmail.com.

SAMPAD SAHA

unread,
Feb 29, 2016, 12:49:00 PM2/29/16
to sympy, moore...@gmail.com
Hi Tim,

Thank you for your suggestions.

I have also thought of implementing the operations on singularity functions in this way only.
I would first try to implement the basic operations such as addition , substraction, etc. then i will move on integrating and differentiating the singularity funcations.

Later on I would prepare a documentation mentioning how to use this prepared module for solving beam bending problems along with giving examples.


On Friday, February 26, 2016 at 4:54:59 PM UTC+5:30, SAMPAD SAHA wrote:

SAMPAD SAHA

unread,
Mar 2, 2016, 2:06:30 PM3/2/16
to Jason Moore, sy...@googlegroups.com
Jason,

I had fixed an issue earlier . This was my PR.
Do I need to send any more patch file?

-------------------
With Regards
Sampad


Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Sun, Feb 28, 2016 at 9:59 PM, Jason Moore <moore...@gmail.com> wrote:
You, as the designer, will get to choose whatever names you want. We will discuss the naming of functions during deeper discussions. For now just pick whatever you think is appropriate.


On Sun, Feb 28, 2016 at 1:53 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
Jason,

Thank you for giving me a direction to think over this project.

Would it be fine if we name the module as Singularity?

As you said, I will now focus on creating object which would help us to use standard operators on different types of singularity functions.
I will also focus on creating a timeline to implement different functionalities . I will let you know shortly about what i am upto.





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Sun, Feb 28, 2016 at 12:11 AM, Jason Moore <moore...@gmail.com> wrote:
Sampad,

You will likely need to create objects that represent different types of singularity functions. These objects should be able to be assembled into full expressions using standard operators: plus, minus, etc. Additionally you'll need some methods that can convert these expressions into the continuous piecewise forms and allow evaluation with .evalf(). The integrate and Integral objects should be able to integrate them.

I'd suggest writing up some psuedo code that would give an idea of what a sympy session might look like to solve some beam problems. Maybe something like:

>>> from sympy import SingularityFunction as f
>>> w = -3 * f(x - 0)**(-1) + 6 * f(x - 2)**0 - 9 * f(x - 4)**-1
>>> pprint(w)
-3 * f<x - 0>**(-1) + 6 * <x - 2>**0 - 9 * <x - 4>**-1
>>> integrate(w)
-3 * <x - 0>**0 + 6 * <x - 2>**1 - 9 * <x - 4>**0

Do some beam bending problems by hand and then think about how you'd like it to work if you could do it all with SymPy. For every example problem you do, write out pseudo code like above.

I could also imagine a higher level abstraction where you could do something like:

from sympy import Beam, DistributedLoad, PointLoad
b = Beam(length=l)
b.apply(DistrubutedLoad(start=l/2, end=l, value=w)
b.apply(PointLoad(location=l/3, value=p)
b.moment() # finds the moment vs x using singularity funcs in the background
b.shear_moment_diagram() # uses the plot module to plot the piecewise functoin
b.moment_sing_func() # returns the singularity funcs

But you'll need to implement the singularity function stuff first before the later.

Jason

Jason Moore

unread,
Mar 2, 2016, 2:14:36 PM3/2/16
to SAMPAD SAHA, sy...@googlegroups.com
Sampad,

Only one patch is required along with the proposal. But if you have a look at the winning proposals from previous years, I think you'll see that people with more patches and higher engagement with the community are much more likely to get accepted. I'd recommend doing as much as you can to make your proposal stand out from the rest.

Jason

SAMPAD SAHA

unread,
Mar 2, 2016, 2:35:53 PM3/2/16
to Jason Moore, sy...@googlegroups.com
Jason,

Thank You. I would try my level best to follow your suggestions. I would try to send more patches to make my proposal more better.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 2, 2016, 2:47:06 PM3/2/16
to SAMPAD SAHA, sy...@googlegroups.com
Sampad, please try to keep conversations on list so that everyone can benefit.

Please draft your proposal on the SymPy wiki.
On Wed, Mar 2, 2016 at 11:44 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
Jason,

I have started working on my proposal. After adding some ideas on how to proceed with this project from myside , I will send you the link.

Can you please suggest me , where should I write my proposal so that I can send it to you for reviewing?




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 2, 2016, 2:59:43 PM3/2/16
to Jason Moore, sy...@googlegroups.com
Jason ,

Sorry, actually I didn't notice that I haven't added the list in cc. It was mistaken.

I will let you know about my status of my proposal soon.

Thank You.


--------------------
Sampad






Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 3, 2016, 11:55:48 AM3/3/16
to Jason Moore, sy...@googlegroups.com
Jason ,
                                                                                          
Suppose I want to print <x-2>**2 in isympy as   <x-2> raised to 2 . How we can do it?
   




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 3, 2016, 12:31:39 PM3/3/16
to SAMPAD SAHA, sy...@googlegroups.com
After you create some objects that represent the functions you will need to add functionality to the various printers that we have. See the sympy printing packages for examples.

SAMPAD SAHA

unread,
Mar 3, 2016, 5:28:12 PM3/3/16
to Jason Moore, sy...@googlegroups.com
Jason,

Thanks. I will go through the printing packages. 

Will it be ok if we add the module for singularity function in sympy/functions/special ? 

And I am thinking to do like this:

There will be class which will be taking power and offset as argument e.g.  f = singularityFunc(power , offset , variable) and it would be printed as <variable - offset> raised to "power" .

Like this:

In [1] : singularityFunc(n , a , x)
Out [1] : <x-a>^n 



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 3, 2016, 5:42:46 PM3/3/16
to SAMPAD SAHA, sy...@googlegroups.com
Seems reasonable. I recommend drafting up a python session like you have there showing the desired functionality. You can make this part of your proposal on the wiki. Once you have a reasonable amount of material we can discuss further.

SAMPAD SAHA

unread,
Mar 3, 2016, 6:01:56 PM3/3/16
to Jason Moore, sy...@googlegroups.com
Jason,

Yah, That would be great. After drafting my proposal on wiki, I will let you know.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Fri, Mar 4, 2016 at 4:31 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:

Yah, That would be great. After drafting my proposal on wiki, I will let you know.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 8, 2016, 12:51:08 PM3/8/16
to Jason Moore, sy...@googlegroups.com
Hello Jason,

I have drafted some portions of my proposal here .

I haven't completed it yet. I am on my first phase of preparing the proposal. After completing "The Plan and Prototype" section I will Draft my proposal on Sympy's wiki. 

Can you please review it ?  

I need your suggestion.



--------------------
With Regards,

Sampad








Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 8, 2016, 2:18:03 PM3/8/16
to SAMPAD SAHA, sy...@googlegroups.com
I like what you have written so far. You should think about how the DiracDelta and Heaviside functions that are already in SymPy should be used. Think about the different methods and attributes that the singularily function would need. I'd recommend showing an example of how you will use this to solve a specific beam problem. You can use an example to show off the types of methods the objects will have.

Keep up the good work.

Tim Lahey

unread,
Mar 8, 2016, 2:40:33 PM3/8/16
to SymPy
For an example, you might want to try a triangular load that ramps up to the middle and then ramps down to the end. That will give you a point loads at the ends of the beam (reaction forces), two ramps and a constant load along with offsets.

Cheers,

Tim.

SAMPAD SAHA

unread,
Mar 8, 2016, 4:27:39 PM3/8/16
to sy...@googlegroups.com, Jason Moore

Thank You Tim and Jason for your suggestions.

Yah, I also think that depicting an example of how to use this module to solve a particular beam problem would be a good idea. I would also think about the methods and attributes that I will be creating for this modules.

I will let you know after I am done with these tasks..


Your suggestions really gave me some new points to think over..


---------------------
With Regards 

Sampad





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.

Aaron Meurer

unread,
Mar 8, 2016, 4:41:55 PM3/8/16
to sy...@googlegroups.com
DiracDelta(x, k) gives the k-th derivative of DiracDelta(x) (or you
can write DiracDelta(x).diff(x, k)).

It does look like the delta integrate routines could be improved here, though:

In [2]: integrate(f(x)*DiracDelta(x), (x, -oo, oo))
Out[2]: f(0)

In [3]: integrate(f(x)*DiracDelta(x, 1), (x, -oo, oo))
Out[3]:


⎮ f(x)⋅DiracDelta(x, 1) dx

-∞

Since the integration rules for derivatives of delta functions are
simple extensions of the rules for the delta function itself, this is
probably not difficult to fix.

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/1795A385-4AEA-44FD-BEE8-8115D53DA14B%40gmail.com.

SAMPAD SAHA

unread,
Mar 11, 2016, 9:00:52 AM3/11/16
to sy...@googlegroups.com
Hi Aaron,

I have a doubt .

Do we want:


 integrate(f(x)*DiracDelta(x, n), (x, -oo, oo)) would output as

Inline image 1




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Aaron Meurer

unread,
Mar 12, 2016, 1:20:28 AM3/12/16
to sy...@googlegroups.com
It should give (-1)**n*f^(n)(0) (that is, (-1)**n*diff(f(x), x, n).subs(x, 0)), if I remember the formula correctly.

Aaron Meurer

SAMPAD SAHA

unread,
Mar 13, 2016, 5:25:46 PM3/13/16
to sy...@googlegroups.com
Hi Jason,

I have a confusion regarding the user inputs for the beam problems.

I think that we should take only the Bending Moment Function (in the form of singularity functions) and the boundary conditions as inputs.

I mean to say that generally in a given beam bending problem, a diagram of a beam and distributed loads are provided. So it is not possible to get these data as an user input. Rather we can expect that the user would formulate the bending moment function, in the form of Singularity function, and then provide that function as an input for getting the elastic curve equation.

Note:- Values of  E , I , Boundary Conditions are also expected as an input.    
 
I need your suggestions.



-----------------
Regards,
Sampad




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 14, 2016, 3:16:50 AM3/14/16
to Jason Moore, sy...@googlegroups.com
--

SAMPAD SAHA

unread,
Mar 15, 2016, 11:27:59 AM3/15/16
to Jason Moore, sy...@googlegroups.com
Jason,

Do we expect `simplify` ( a method under SingularityFunction class) to give output like this:

In [ ] : F = singularityFunc(x, 0, 1) +  singularityFunc(x, 3, 2)

In [ ] : F

                                  2                   
Out [ ] :  <x> + <x - 3>


In [ ] : simplify(F)

Out [ ] : 

0                   for x < 0
x                   for 0 <= x < 3
x + (x-3)^2    for x  >= 3


I think this would be cool implementation.

--------------------
Regards
Sampad




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 15, 2016, 4:40:13 PM3/15/16
to Jason Moore, sy...@googlegroups.com
Jason,

I was googling about the Singularity Functions with exponents less than -2 , but I found out that there is no significance of <x - a>^n for  n <-2. It also doesn't signifies anything while solving beam bending problem.

So, do we need to implement anything for these functions?


-----------------
Regards,
Sampad

 




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Tim Lahey

unread,
Mar 15, 2016, 4:52:12 PM3/15/16
to SymPy
While I’m not Jason, there is no physical significance to n < -2 at least in beam bending. It’s possible they might be used in another context that I don’t know about, though. Since n=-2 is the limit of two Dirac delta functions of opposing directions a distance epsilon apart as epsilon goes to zero (which is a force couple and why it can represent a moment), I’m not sure if there’s even a convenient way to think about n<-2.

Personally, I don’t think there’s any real need to handle the n<-2 case. I’d raise an error if an operation was performed that gave it. If there’s a use for singularity functions in another context that requires that case it can be added. Plus, raising an error is useful in the event someone does an operation they shouldn’t for pure beam bending.

Cheers,

Tim.

> On Mar 15, 2016, at 4:40 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
> Jason,
>
> I was googling about the Singularity Functions with exponents less than -2 , but I found out that there is no significance of <x - a>^n for n <-2. It also doesn't signifies anything while solving beam bending problem.
>
> So, do we need to implement anything for these functions?
>
>
> -----------------
> Regards,
> Sampad
>
>
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Tue, Mar 15, 2016 at 8:57 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Jason,
>
> Do we expect `simplify` ( a method under SingularityFunction class) to give output like this:
>
> In [ ] : F = singularityFunc(x, 0, 1) + singularityFunc(x, 3, 2)
>
> In [ ] : F
>
> 2
> Out [ ] : <x> + <x - 3>
>
>
> In [ ] : simplify(F)
>
> Out [ ] :
>
> 0 for x < 0
> x for 0 <= x < 3
> x + (x-3)^2 for x >= 3
>
>
> I think this would be cool implementation.
>
> --------------------
> Regards
> Sampad
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Mon, Mar 14, 2016 at 12:46 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
>
> ---------- Forwarded message ----------
> From: SAMPAD SAHA <sampa...@gmail.com>
> Date: Monday, March 14, 2016
> Subject: [sympy] GSoC 2016: Singularity Functions
> To: sy...@googlegroups.com
>
>
> Hi Jason,
>
> I have a confusion regarding the user inputs for the beam problems.
>
> I think that we should take only the Bending Moment Function (in the form of singularity functions) and the boundary conditions as inputs.
>
> I mean to say that generally in a given beam bending problem, a diagram of a beam and distributed loads are provided. So it is not possible to get these data as an user input. Rather we can expect that the user would formulate the bending moment function, in the form of Singularity function, and then provide that function as an input for getting the elastic curve equation.
>
> Note:- Values of E , I , Boundary Conditions are also expected as an input.
>
> I need your suggestions.
>
>
>
> -----------------
> Regards,
> Sampad
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Sat, Mar 12, 2016 at 11:50 AM, Aaron Meurer <asme...@gmail.com> wrote:
> It should give (-1)**n*f^(n)(0) (that is, (-1)**n*diff(f(x), x, n).subs(x, 0)), if I remember the formula correctly.
>
> Aaron Meurer
>
> On Fri, Mar 11, 2016 at 9:00 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Hi Aaron,
>
> I have a doubt .
>
> Do we want:
>
>
> integrate(f(x)*DiracDelta(x, n), (x, -oo, oo)) would output as
>
> <image.png>
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CANzav4EjYQ-uX4J%3DjqkNn21XiaX8y617bgiCp-HosxdL8ke7tQ%40mail.gmail.com.

Jason Moore

unread,
Mar 15, 2016, 4:53:36 PM3/15/16
to sy...@googlegroups.com
I think you'd want the user to input the loads on the beam as singularity functions or some higher level abstraction. If you require them to manually compute the bending moment then you are defeating the purpose of having a CAS do it for you.

Jason Moore

unread,
Mar 15, 2016, 4:54:11 PM3/15/16
to sy...@googlegroups.com
Yes, it would be nice if simplify worked with singularity funcs.

Tim Lahey

unread,
Mar 15, 2016, 5:15:25 PM3/15/16
to SymPy
I agree. One should start directly from the loading function q(x). The general steps are:

1. Start with the loading function q(x)
2. Integrate to get the shear function V(x).
3. Integrate again to get the bending moment function M(x).
4. Integrate to get the slope function E*I*v’(x).
5. Integrate to get the displacement function E*I*v(x).

Note that the singularity functions can be multiplied by arbitrary functions of x as well. This allows for varied loads and cases where E and I vary too. To be strictly correct one should include the integration constants as well and then solve for the reaction forces and the constants.

You’ll need to carefully consider how you handle evaluating at transition points, especially the beam boundaries.

Cheers,

Tim.

> On Mar 15, 2016, at 4:53 PM, Jason Moore <moore...@gmail.com> wrote:
>
> I think you'd want the user to input the loads on the beam as singularity functions or some higher level abstraction. If you require them to manually compute the bending moment then you are defeating the purpose of having a CAS do it for you.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Sun, Mar 13, 2016 at 2:25 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Hi Jason,
>
> I have a confusion regarding the user inputs for the beam problems.
>
> I think that we should take only the Bending Moment Function (in the form of singularity functions) and the boundary conditions as inputs.
>
> I mean to say that generally in a given beam bending problem, a diagram of a beam and distributed loads are provided. So it is not possible to get these data as an user input. Rather we can expect that the user would formulate the bending moment function, in the form of Singularity function, and then provide that function as an input for getting the elastic curve equation.
>
> Note:- Values of E , I , Boundary Conditions are also expected as an input.
>
> I need your suggestions.
>
>
>
> -----------------
> Regards,
> Sampad
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Sat, Mar 12, 2016 at 11:50 AM, Aaron Meurer <asme...@gmail.com> wrote:
> It should give (-1)**n*f^(n)(0) (that is, (-1)**n*diff(f(x), x, n).subs(x, 0)), if I remember the formula correctly.
>
> Aaron Meurer
>
> On Fri, Mar 11, 2016 at 9:00 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Hi Aaron,
>
> I have a doubt .
>
> Do we want:
>
>
> integrate(f(x)*DiracDelta(x, n), (x, -oo, oo)) would output as
>
> <image.png>
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AjHOvGfvxRfOTy2RhRm3YnNc_eJ9OpjBOain6iK15chMA%40mail.gmail.com.

SAMPAD SAHA

unread,
Mar 15, 2016, 6:26:20 PM3/15/16
to sy...@googlegroups.com, tim....@gmail.com, Jason Moore
Thank You Tim and Jason for your suggestions and clearing my doubts.

We can also have an another module for solving beam problems. As Jason Have suggested earlier.

Some of its classes would be Beam, DistributedLoad, PointLoad, Moment.

We can have the API as:-

from sympy import SingularityFunction,Beam,DistributedLoad,PointLoad,Moment
b = Beam(length = 1, E = 1.87, I = 12)
Load1 = DistrubutedLoad(start=l/2, end=l, value= 50)
Load2 = PointLoad(location=l/3, value=60)
Load3 = Moment(locaton = 1, value = 40, anticlockwise = True)
b.apply(Load1,Load2,Load3)
b.loadDistribution    # Outputs the loading function in the form of singularity function
b.shearForce          # Outputs the Shear Force  Function
b.bendingMoment       # Outputs the bending Moment Function
b.slope               # Outputs the Slope Function
b.deflection          # Outputs the deflection Function

b.plotLoadDistribution   # Outputs the plot of load Distribution Curve
b.plotBendingMoment      # Outputs the plot of Bending Moment Curve 
b.plotDeflection         # Outputs the plot of Deflection Curve 




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 15, 2016, 7:36:29 PM3/15/16
to sy...@googlegroups.com, Jason Moore
Hi Jason,

As I am thinking to create a another module for solving especially beam problems (suppose beambending.py) , what will be its file location?
Similarly for Singularity Functions (suppose singularity_function.py), What will be its location?

And what about the names of methods and classes, Can I give any name or we will be discussing it at the time of developing them?



---------------------
Regards, 
Sampad





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 15, 2016, 7:41:20 PM3/15/16
to SAMPAD SAHA, sy...@googlegroups.com
The file locations and method class names are just fine details that can be worked out later. They are generally not important for your proposal. Just focus on describing what the future modules should do.

SAMPAD SAHA

unread,
Mar 15, 2016, 7:46:53 PM3/15/16
to Jason Moore, sy...@googlegroups.com
Ok Jason,

And what about the API I have posted just before the earlier post?

Any suggestions




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 15, 2016, 7:53:12 PM3/15/16
to SAMPAD SAHA, sy...@googlegroups.com
I think it is a good start. You will need to follow PEP8 for the method and class names. But I just want to see desired functionality. The more you can think up, the better. I would suggest doing a beam problem by hand and then translating that to a desired API. You can mock up what you think the inputs and outputs should be for that example problem.

SAMPAD SAHA

unread,
Mar 15, 2016, 8:08:03 PM3/15/16
to Jason Moore, sy...@googlegroups.com
Jason 

Pardon please. I couldn't get you by "You will need to follow PEP8 for the method and class names". 

and yah, i also felt that it would be better if i use the input and output values of the example problem done by hand. 

So , what do you suggest, Would it be better if we create a different module ,other than the singularity function module, for solving beam problems?  That module would import the singularity function module for using them.





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 15, 2016, 8:15:19 PM3/15/16
to SAMPAD SAHA, sy...@googlegroups.com
I think you will need a pure singularity function module and then you will need a beam module that utlizes the singularity function module. You will also likely need to improve the discontinuous functions that are already in sympy. There are at least three layers to this in my eyes.

SAMPAD SAHA

unread,
Mar 15, 2016, 8:25:10 PM3/15/16
to Jason Moore, sy...@googlegroups.com
You are right. delta_function.py needs to be improved. I will to be using only DiracDelta and Heaviside for generating almost all the Singularity Functions.

I was also thinking to complete this project in four phases:
  1. Improving existiing Functions.
  2. Creating Singularity Functions module
  3. Creating beam Module
  4. Documentation




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 15, 2016, 8:49:09 PM3/15/16
to SAMPAD SAHA, sy...@googlegroups.com
Looks good. I think you should have plenty of examples in the docs. People tend to use software more if the docs are top notch. So plenty of examples and tutorials will really help.

SAMPAD SAHA

unread,
Mar 16, 2016, 12:11:28 PM3/16/16
to Jason Moore, sy...@googlegroups.com
Yah , You are right . A software having good documentations about all the functionality is preffered more over the others by the users. I will be spending a good amount of time in preparing the documentation citing plenty of examples and tutorials. 

Here is link to my proposal. I have almost added all the things which we have disscussed. I still need to add the example and many more "TODO"s are left. I am working on those.


Suggestions are welcomed.





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 17, 2016, 4:29:31 PM3/17/16
to Jason Moore, Tim Lahey, sy...@googlegroups.com

I was thinking about multiplication of two singularity functions. It is possible and it is mathematically significant. We can implement this too in Sympy. Similarly with powers.

I need your suggestions.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 17, 2016, 4:34:45 PM3/17/16
to Jason Moore, sy...@googlegroups.com

Jason,

For implementing Additon , Multiplication Do we need to over ride __mul__ , __add__  these methods inside the class SingularityFunction or we can just use simplify for getting the results.

I am really confused.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 17, 2016, 5:45:17 PM3/17/16
to SAMPAD SAHA, sy...@googlegroups.com
I think you need to override the operators. I'm not sure if multiplying singularity functions is needed (at least for beam problems), even if it is mathematically correct, you don't have to implement it. If it is easy to implement then, sure, do so.

SAMPAD SAHA

unread,
Mar 18, 2016, 8:06:35 AM3/18/16
to Jason Moore, sy...@googlegroups.com
Yah, you are right multiplication of singularity functions are not needed for solving beam problems. Mathematically, it is also not used that much. So lets leave this multiplication and powers part.

I was thinking about the integrate and diff methods. I feel that we should define instance methods diff and  integrate  in the singularity function module which would internally use the existing diff and integrate function for Differentiation and Integration respectively.

I need your suggestions.






Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 18, 2016, 8:17:25 AM3/18/16
to Jason Moore, sy...@googlegroups.com, Tim Lahey
I am also confused about implementing the boundary conditions for getting the deflection curve.

Any suggestions on how to implement it.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 18, 2016, 10:12:59 AM3/18/16
to Tim Lahey, Jason Moore, sy...@googlegroups.com
Thanks TIm,

Integration and Differentiation are really very straight forward that is why i am thinking to add diff and integrate method to the Singularity function class itself.

For integrate the pseuesocode will be :-

if(n<0)
    return SingularityFunction(x , a, n+1)
else 
    return (1/n+1 * SingularityFunction(x , a, n+1))

Similarly for differentiation:

if (n>0)
   return n * SingularityFunction(x , a, n - 1)
else 
   Error message


My doubt regarding Boundary condition was actually was that since sympy don't provide constant of integration while performing indefinite integration on any expression, how to use the boundary conditions to find the exact values of constant of integration?




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Fri, Mar 18, 2016 at 6:09 PM, Tim Lahey <tim....@gmail.com> wrote:
Hi,

Do you know the integration and differentiation rules for singularity functions? They’re pretty straightforward.

As for boundary conditions, the beam will have supports (or a free end) at each end of the beam and as part of the beam creation each end type is specified. Each type corresponds to a specific set of conditions on that end (either at x=0 or x=L). You substitute those conditions in the appropriate equation and solve for the integration constant as necessary. All of the conditions should be in any decent mechanics of deformable solids text book.

You’ll want to do sums of forces and moments as well to solve for reaction forces as well.

The only trick is making sure you don’t double count things. If you have a step function due to a reaction force at the start of the beam and assume it’s zero at x=0 (effectively the limit at x=0^-) you can get a non-zero integration constant that can be double counting that reaction since at x=0^+ that reaction force is non-zero. Note that you can get a non-zero integration constant (even when including reaction forces in the loading function) for shear and moment equations if you have non-polynomial loads (e.g., sine and cosine). You’ll also have to think about the other end as well. I leave it up to you to reason that out. Make sure you completely document how you’ve implemented it for the user (and why).

Beam coordinate systems must start at the left end and increase to the right. The definition of the singularity functions require this.

I hope this helps.

Cheers,

Tim.


> On Mar 18, 2016, at 8:17 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
> I am also confused about implementing the boundary conditions for getting the deflection curve.
>
> Any suggestions on how to implement it.
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Fri, Mar 18, 2016 at 5:36 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Yah, you are right multiplication of singularity functions are not needed for solving beam problems. Mathematically, it is also not used that much. So lets leave this multiplication and powers part.
>
> I was thinking about the integrate and diff methods. I feel that we should define instance methods diff and  integrate  in the singularity function module which would internally use the existing diff and integrate function for Differentiation and Integration respectively.
>
> I need your suggestions.
>
>
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Fri, Mar 18, 2016 at 3:14 AM, Jason Moore <moore...@gmail.com> wrote:
> I think you need to override the operators. I'm not sure if multiplying singularity functions is needed (at least for beam problems), even if it is mathematically correct, you don't have to implement it. If it is easy to implement then, sure, do so.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Thu, Mar 17, 2016 at 1:34 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
> Jason,
>
> For implementing Additon , Multiplication Do we need to over ride __mul__ , __add__  these methods inside the class SingularityFunction or we can just use simplify for getting the results.
>
> I am really confused.
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Fri, Mar 18, 2016 at 1:59 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
> I was thinking about multiplication of two singularity functions. It is possible and it is mathematically significant. We can implement this too in Sympy. Similarly with powers.
>
> I need your suggestions.
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 9:41 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Yah , You are right . A software having good documentations about all the functionality is preffered more over the others by the users. I will be spending a good amount of time in preparing the documentation citing plenty of examples and tutorials.
>
> Here is link to my proposal. I have almost added all the things which we have disscussed. I still need to add the example and many more "TODO"s are left. I am working on those.
>
>
> Suggestions are welcomed.
>
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 6:18 AM, Jason Moore <moore...@gmail.com> wrote:
> Looks good. I think you should have plenty of examples in the docs. People tend to use software more if the docs are top notch. So plenty of examples and tutorials will really help.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Tue, Mar 15, 2016 at 5:25 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> You are right. delta_function.py needs to be improved. I will to be using only DiracDelta and Heaviside for generating almost all the Singularity Functions.
>
> I was also thinking to complete this project in four phases:
>       • Improving existiing Functions.
>       • Creating Singularity Functions module
>       • Creating beam Module
>       • Documentation
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 5:44 AM, Jason Moore <moore...@gmail.com> wrote:
> https://www.python.org/dev/peps/pep-0008/
>
> I think you will need a pure singularity function module and then you will need a beam module that utlizes the singularity function module. You will also likely need to improve the discontinuous functions that are already in sympy. There are at least three layers to this in my eyes.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Tue, Mar 15, 2016 at 5:07 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Jason
>
> Pardon please. I couldn't get you by "You will need to follow PEP8 for the method and class names".
>
> and yah, i also felt that it would be better if i use the input and output values of the example problem done by hand.
>
> So , what do you suggest, Would it be better if we create a different module ,other than the singularity function module, for solving beam problems?  That module would import the singularity function module for using them.
>
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 5:22 AM, Jason Moore <moore...@gmail.com> wrote:
> I think it is a good start. You will need to follow PEP8 for the method and class names. But I just want to see desired functionality. The more you can think up, the better. I would suggest doing a beam problem by hand and then translating that to a desired API. You can mock up what you think the inputs and outputs should be for that example problem.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Tue, Mar 15, 2016 at 4:46 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Ok Jason,
>
> And what about the API I have posted just before the earlier post?
>
> Any suggestions
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 5:10 AM, Jason Moore <moore...@gmail.com> wrote:
> The file locations and method class names are just fine details that can be worked out later. They are generally not important for your proposal. Just focus on describing what the future modules should do.
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Tue, Mar 15, 2016 at 4:36 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Hi Jason,
>
> As I am thinking to create a another module for solving especially beam problems (suppose beambending.py) , what will be its file location?
> Similarly for Singularity Functions (suppose singularity_function.py), What will be its location?
>
> And what about the names of methods and classes, Can I give any name or we will be discussing it at the time of developing them?
>
>
>
> ---------------------
> Regards,
> Sampad
>
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Wed, Mar 16, 2016 at 3:56 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Thank You Tim and Jason for your suggestions and clearing my doubts.
>
> We can also have an another module for solving beam problems. As Jason Have suggested earlier.
>
> Some of its classes would be Beam, DistributedLoad, PointLoad, Moment.
>
> We can have the API as:-
>
> from sympy import SingularityFunction,Beam,DistributedLoad,PointLoad,Moment
> b = Beam(length = 1, E = 1.87, I = 12)
> Load1 = DistrubutedLoad(start=l/2, end=l, value= 50)
> Load2 = PointLoad(location=l/3, value=60)
> Load3 = Moment(locaton = 1, value = 40, anticlockwise = True)
> b.apply(Load1,Load2,Load3)
> b.loadDistribution    # Outputs the loading function in the form of singularity function
> b.shearForce          # Outputs the Shear Force  Function
> b.bendingMoment       # Outputs the bending Moment Function
> b.slope               # Outputs the Slope Function
> b.deflection          # Outputs the deflection Function
>
> b.plotLoadDistribution   # Outputs the plot of load Distribution Curve
> b.plotBendingMoment      # Outputs the plot of Bending Moment Curve
> b.plotDeflection         # Outputs the plot of Deflection Curve
>
>
>
>
>

SAMPAD SAHA

unread,
Mar 18, 2016, 1:27:15 PM3/18/16
to sy...@googlegroups.com, Jason Moore
Jason,

I have thought of implementing Addition, Substraction, Integration, Differentiation, Simplify on Singularity Functions.

What are the other functionalities we should implement? 




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Fri, Mar 18, 2016 at 8:16 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
Yah you are correct. Differentiation of heaviside and diracdelta also exists.

It was my mistake. Thanks for rectifying me.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Fri, Mar 18, 2016 at 8:02 PM, Tim Lahey <tim....@gmail.com> wrote:
For differentiation you’re missing a case,

if n = 0 or n = -1
   return Singularity(x, a, n-1)
else if n < -1
   return error

In other words, you can still differentiate for the n = 0 and n = -1 cases.

Cheers,

Tim.

> On Mar 18, 2016, at 10:22 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
> And what about the pseudocode of integration and differentiation i have posted earlier , is it alright?
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Fri, Mar 18, 2016 at 7:51 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:
> Thanks Tim,
>
> It is really a nice and effective solution.
>
>
>
>
>
> Regards
> Sampad Kumar Saha
> Mathematics and Computing
> I.I.T. Kharagpur
>
> On Fri, Mar 18, 2016 at 7:46 PM, Tim Lahey <tim....@gmail.com> wrote:
> Add the constants when you integrate in your beam class.

>
>
> On 2016-03-18, at 10:12 AM, SAMPAD SAHA <sampa...@gmail.com> wrote:
>
>> Thanks TIm,
>>
>> Integration and Differentiation are really very straight forward that is why i am thinking to add diff and integrate method to the Singularity function class itself.
>>
>> For integrate the pseuesocode will be :-
>>
>> if(n<0)
>>     return SingularityFunction(x , a, n+1)
>> else
>>     return (1/n+1 * SingularityFunction(x , a, n+1))
>>
>> Similarly for differentiation:
>>
>> if (n>0)
>>    return n * SingularityFunction(x , a, n - 1)
>> else
>>    Error message
>>
>>
>> My doubt regarding Boundary condition was actually was that since sympy don't provide constant of integration while performing indefinite integration on any expression, how to use the boundary conditions to find the exact values of constant of integration?
>>
>>
>>
>>
>>

Jason Moore

unread,
Mar 18, 2016, 6:37:32 PM3/18/16
to SAMPAD SAHA, sy...@googlegroups.com
Sounds like a good start. How about a method to convert to continuous piecewise?

Like I said earlier, you should pick some examples that you want the software to be able to solve and then implement methods and functionality based on those examples. It's hard to think of all the needed functionality and API without motivating examples first.

SAMPAD SAHA

unread,
Mar 18, 2016, 7:04:14 PM3/18/16
to Jason Moore, sy...@googlegroups.com
Thank You Jason for the appreciation.

Yah, that Simplify   method would convert  into continous piecewise. Like this :- 

In    [ ] : F = singularityFunc(x, 0, 1) +  singularityFunc(x, 3, 2)

In    [ ] : F
Out [ ] : 
                    2
<x> + <x - 3>

In [ ] : F.simplify()
Out [ ] : 

0                   for x < 0
x                   for 0 <= x < 3
x + (x-3)^2    for x  >= 3


As you have suggested earlier, I have solved some examples by hand and then tried to implement a desired api. From that I came to this conclusion that if we implement Addition, Substraction, Integration, Differentiation, Simplify on Singularity Functions then we can successfully solve out the beam problems.

But i got doubt while implementing the boundary constants. I mean to say that sympy dont gives constant of integration while doing indefinite integration. We can take boundary conditions as input from users that is not a problem, but we cant use it since there will be no constant of integration.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 18, 2016, 9:38:25 PM3/18/16
to SAMPAD SAHA, sy...@googlegroups.com
Simplification means something very specific in SymPy, see the simplify() function. I think you need to choose a different method name for converting to piecewise continuous. Maybe: .to_piecewise()?

You will need to implement some method for dealing with the constants of integration and boundary conditions. Maybe you should have a look at the ordinary differential equations package in SymPy to get some ideas about that.

SAMPAD SAHA

unread,
Mar 18, 2016, 9:48:03 PM3/18/16
to Jason Moore, sy...@googlegroups.com
Yah, you are right . We should not have the name simplify() as a method since it have already created some issues in  #7716 and #8798. So i will keep it as  to_piecewise()  . it would be fine then.

As you suggested I will be look at ode package for this constant of integration thing.

Thank You... 




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 19, 2016, 11:27:54 AM3/19/16
to Jason Moore, sy...@googlegroups.com
Jason, 

I went through the ode package. I felt that it would be difficult to use boundary condition to solve for the constants of integration using the exisiting dsolve() method. It seems that it is still under development. 

So I thought of implementing that functionality explicitly for solving beam problems.

I would be taking Boundary conditions as input as:

bcs = Beam.BoundaryCondition( {f(0) : 5, f.diff(0) : 4 } ) and so on.

If nothing is provided then  f(0) !=  0 , f.diff(0) = 0 or something like this would be assumed.

Depending on this boundary condition I would add the required constants by myself while finding the slope and deflection function and output the value by solving for those constants.

By this way, the hack would be easier. What do you suggests? 






Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 19, 2016, 11:44:42 AM3/19/16
to SAMPAD SAHA, sy...@googlegroups.com
I don't think we should do "a hack". If we follow the patterns in the integration code, we should leave the constants of integration off. But in the Beam classes you can have them manage the constants of integration. What you show above looks fine.

I didn't mean to use dsolve in any way. I just meant to have a look at that code because they include constants of integration when you solve the ode. You can also set the boundary conditions in the constructor. It can give you ideas of how to design your api.

SAMPAD SAHA

unread,
Mar 19, 2016, 1:58:17 PM3/19/16
to Jason Moore, sy...@googlegroups.com
Jason,

Actually I have misunderstood earlier. 

I have updated my proposal here . Can you please review it and suggest me to improve it.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 20, 2016, 4:59:10 PM3/20/16
to Jason Moore, sy...@googlegroups.com
Hi,

I might not be able to code for the full time form 25 May  - 29 May (max 4 days) as I have to go for a family vacation . I will be compensating the work during the commmunity bonding period as well as in the other weeks, since I will be free for the whole summer break and I will not have any commitments other than GSoC.

Would it be fine?


---------------------------
Regards,
Sampad




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 20, 2016, 5:35:47 PM3/20/16
to Jason Moore, sy...@googlegroups.com, Tim Lahey, asme...@gmail.com
Is there any thing called DirectDelta ?

Or here is this a typo?




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 21, 2016, 4:44:46 PM3/21/16
to SAMPAD SAHA, sy...@googlegroups.com
Sampad,

Please explain in you proposal what days you want to miss and how you will make up for them. Something usually can be worked out, but no promises.

Jason Moore

unread,
Mar 21, 2016, 4:45:35 PM3/21/16
to SAMPAD SAHA, sy...@googlegroups.com, Tim Lahey, Aaron Meurer
Looks like a typo. You can use the grep command to search the code base for this word.

Jason Moore

unread,
Mar 21, 2016, 5:03:55 PM3/21/16
to SAMPAD SAHA, sy...@googlegroups.com
I've put some comments in your proposal.

SAMPAD SAHA

unread,
Mar 21, 2016, 5:52:07 PM3/21/16
to Jason Moore, sy...@googlegroups.com
Thank You Jason for the suggestions in my proposal. I will work on those and let you know as soon as possible.

I have mentioned in my proposal about the days of the vacation and how can I compensate the work. If this vacation raises any problem, I can cancel it . That will not be a problem for me. I don't want to let anything ruin the progess of the project as this Summer of Code will become an integral part of all my learning throughout the summer.

----------------
Regards
Sampad


Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 21, 2016, 6:43:52 PM3/21/16
to SAMPAD SAHA, sy...@googlegroups.com
No need to cancel your vacation. Just give a plan for how you will make up the days.

SAMPAD SAHA

unread,
Mar 22, 2016, 10:32:46 AM3/22/16
to Jason Moore, sy...@googlegroups.com
I will start coding along with community bonding. I will spend 3-4 hours extra in the last week of the community bonding period in order to achieve the proposed target in my proposal. I will have no problem managing with those extra hours since I will be having Summer break at that time and along with that I have no other commitments. And I will also have fun working those extra hours.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 22, 2016, 10:38:26 AM3/22/16
to SAMPAD SAHA, sy...@googlegroups.com
Sounds good, just put it in your proposal.

SAMPAD SAHA

unread,
Mar 22, 2016, 10:43:42 AM3/22/16
to Jason Moore, sy...@googlegroups.com
Thank You Jason. I will put it.

I have a doubt about this comment in my proposal : 

"Comment from Jason: It would be more informative to show what a beam equation would look like in Piecewise form. This is a little abstract."  
  
Can you explain it a little more?  

I have also added some comment next to yours, I am still working on some of your comments.

Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 22, 2016, 11:23:43 AM3/22/16
to SAMPAD SAHA, sy...@googlegroups.com
The example you show doesn't seem to reflect what we may actually see when using this for beams. I'd suggest picking a simple beam problem and showing what all of your code will look like. You did that pretty well for the later examples, but this one with the random polynomials wasn't that clear.

SAMPAD SAHA

unread,
Mar 22, 2016, 6:38:24 PM3/22/16
to Jason Moore, sy...@googlegroups.com
Thanks Jason, I have made some changes. Can you please review those? I have also added some comments along with yours.

I didn't get you in this comment. Can you please elaborate it?
"Comment from Jason: You will need to make sure everything is backwards compatible. See the wiki for our policy."  




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 22, 2016, 7:18:20 PM3/22/16
to Jason Moore, sy...@googlegroups.com

Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 23, 2016, 7:25:55 AM3/23/16
to Jason Moore, sy...@googlegroups.com
I am having a big confusion over this.

There is no integrate() method defined in DiracDelta and Heaviside. But still how can this happen.

In    [ ] : DiracDelta(x).integrate()
Out [ ] : Heaviside(x)

In    [ ] : Heaviside(x).integrate()
Out [ ] : x*Heaviside(x)

I feel like this should raise error as AttributeError: 'DiracDelta' object has no attribute 'integrate'.

Please explain how this is happenning.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Sartaj Singh

unread,
Mar 23, 2016, 7:28:05 AM3/23/16
to sy...@googlegroups.com, Jason Moore
Hi,

This comes from Expr class.


For more options, visit https://groups.google.com/d/optout.



--
Regards
Sartaj Singh

Mathematics and Computing,
Indian Institute of Technology,
Varanasi - 221 005 INDIA

SAMPAD SAHA

unread,
Mar 23, 2016, 7:41:52 AM3/23/16
to sy...@googlegroups.com, singhs...@gmail.com

Thanks Sartaj.

I went through the Expr class and it cleared all my doubts. I actually forgot that Function class is inheriting Expr class.



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 23, 2016, 8:14:20 AM3/23/16
to sy...@googlegroups.com, Jason Moore
Jason ,

I have almost made all the changes that you have suggested. Here is the link

Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 24, 2016, 10:31:10 AM3/24/16
to sy...@googlegroups.com, Jason Moore
While submitting the final pdf, are we supposed to remove the comments?




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 24, 2016, 10:44:10 AM3/24/16
to SAMPAD SAHA, sy...@googlegroups.com
There shouldn't be any external comments in your final submission.

SAMPAD SAHA

unread,
Mar 24, 2016, 10:54:42 AM3/24/16
to Jason Moore, sy...@googlegroups.com


Can you please give a final review.. and i didn't get you by this comment "Comment from Jason: You will need to make sure everything is backwards compatible. See the wiki for our policy."  


Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

On Thu, Mar 24, 2016 at 8:16 PM, SAMPAD SAHA <sampa...@gmail.com> wrote:


Can you please give a final review.. and i didn't get you by this comment "Comment from Jason: You will need to make sure everything is backwards compatible. See the wiki for our policy."  


Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Jason Moore

unread,
Mar 24, 2016, 11:52:17 AM3/24/16
to SAMPAD SAHA, sy...@googlegroups.com
You just need to account for deprecating things properly, see: https://github.com/sympy/sympy/wiki/Deprecating-policy

SAMPAD SAHA

unread,
Mar 24, 2016, 1:03:24 PM3/24/16
to Jason Moore, sy...@googlegroups.com
Thanks Jason, 

I went through the link. I will add a statement according to that. I am going to submit the final pdf.

Thanks for the comments and reviews.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Aaron Meurer

unread,
Mar 24, 2016, 2:30:52 PM3/24/16
to sy...@googlegroups.com, SAMPAD SAHA
You should call the method _eval_rewrite_Piecewise. Then you can call it with expr.rewrite(Piecewise). The advantage here is that this will automatically work even if it's a subexpression of some larger expression.

Aaron Meurer

SAMPAD SAHA

unread,
Mar 24, 2016, 4:30:09 PM3/24/16
to Aaron Meurer, sy...@googlegroups.com
Hi Aaron,  

Pardon Please. I am bit confused. Are you taking about the "Piecewise Representation" that I have mentioned in Phase I ?





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

SAMPAD SAHA

unread,
Mar 24, 2016, 4:45:34 PM3/24/16
to Aaron Meurer, Jason Moore, sy...@googlegroups.com

We have this _eval_rewrite_as_Piecewise()  method defined in Heaviside Class.
But How can we call it or use this implemented functionality from terminal?



Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Sartaj Singh

unread,
Mar 24, 2016, 5:12:14 PM3/24/16
to sympy, asme...@gmail.com, moore...@gmail.com
In [20]: x = Symbol('x', nonnegative=True)

In [21]: Heaviside(x).rewrite(Piecewise)    
Out[21]: 
⎧ 1   for x > 0
⎪              
⎨1/2  for x = 0
⎪              
⎩ 0   otherwise

...

SAMPAD SAHA

unread,
Mar 24, 2016, 5:24:40 PM3/24/16
to sy...@googlegroups.com, Sartaj Singh
Thank you Sartaj for the explanation. 

But why is it so that only after appling : x = Symbol('x', nonnegative=True) the above statement works.

If we dont use x = Symbol('x', nonnegative=True) it gives :

In [35]: Heaviside(x).rewrite(Piecewise)
Out[35]: Heaviside(x)





Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.

Sartaj Singh

unread,
Mar 24, 2016, 5:29:47 PM3/24/16
to SAMPAD SAHA, sy...@googlegroups.com
Sorry, for not being clear the first time. x needs to be real. Symbol('x', real=True) should also work.

SAMPAD SAHA

unread,
Mar 24, 2016, 5:35:20 PM3/24/16
to Sartaj Singh, sy...@googlegroups.com
Yah, It works. Thanks.




Regards
Sampad Kumar Saha
Mathematics and Computing
I.I.T. Kharagpur

Reply all
Reply to author
Forward
0 new messages