Left hand limits and Right hand limits

67 views
Skip to first unread message

SAMPAD SAHA

unread,
Aug 13, 2016, 8:25:22 AM8/13/16
to Aaron Meurer, sy...@googlegroups.com, Jason K. Moore, Sartaj Singh
Suppose I want to find the value of f(x) for 
f(x) = DiracDelta(x - 30) + Heaviside(x) at x = 30+ in sympy. How can we do this?

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



Aaron Meurer

unread,
Aug 13, 2016, 2:47:43 PM8/13/16
to SAMPAD SAHA, sy...@googlegroups.com, Jason K. Moore, Sartaj Singh
Use limit(expr, x, '-') or limit(expr, x, 30, '+').

Aaron Meurer

Richard Fateman

unread,
Aug 13, 2016, 8:34:54 PM8/13/16
to sympy, asme...@gmail.com, jason...@ucdavis.edu, singhs...@gmail.com
Since DiracDelta is a distribution, not a function, and presumably the
limit program is oriented toward finding limits of analytic functions,
it would be fairly reasonable for the limit program to not work on
this kind of expression.  The mathematical context in which DiracDelta is
understood and useful is under an integral sign. 

I have not tried sympy on this example, but it seems to me
that expecting sympy to answer a poorly formulated question
"correctly"  is not going to reveal a bug in the program.  It
is "user error".

RJF

Aaron Meurer

unread,
Aug 14, 2016, 2:57:52 AM8/14/16
to Richard Fateman, sympy, Jason K. Moore, Sartaj Singh
I agree that DiracDelta doesn't make sense except under an integral sign. But as a function that is 0 everywhere except for one point, in a limit, it can be replaced with 0, which is what SymPy's limit() appears to be doing.  I am curious how you are ending up with an expression with a DiracDelta that you need to take a limit of, though. 

Aaron Meurer

SAMPAD SAHA

unread,
Aug 14, 2016, 6:12:29 AM8/14/16
to sy...@googlegroups.com, Richard Fateman, Jason K. Moore, Sartaj Singh

In Mechanics, while solving beam bending problems, we need to find out the reaction force at first. There is a trick I have learned from Jason. Suppose there is beam of length l, then we at first find the load distribution using variables multiplied by dirac deltas in place of reaction forces. After finding shear force curve and bending moment curve in terms of those variables, we equates them to 0 for x = l+

Now for tthis case we have to use the limit.

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+unsubscribe@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/CAKgW%3D6JAO7i1f-X6uw-WiiztsV%3DXh2Tt74crv3ULhFKr1oz2Bg%40mail.gmail.com.

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

Richard Fateman

unread,
Aug 14, 2016, 9:58:12 AM8/14/16
to sympy, fat...@gmail.com, jason...@ucdavis.edu, singhs...@gmail.com
I am not familiar with this trick, but just because engineers
in some area hack together some method that is mathematically
dubious, doesn't mean it should be introduced as a default in sympy.
(Maybe it should, maybe it is harmless?)   An example that
also involves context that sympy would not know about is
how to deal with certain expressions involving infinity.  E.g.
is 0*oo  equal to 0  or "indeterminate" ?  what about oo  = oo ?

One way of looking at this may be to build some "mechanics"
toolkit with such tricks.

RJF
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,
Aug 15, 2016, 3:01:03 PM8/15/16
to sy...@googlegroups.com, Richard Fateman, Jason K. Moore, Sartaj Singh
There is a special toolkit, sympy.physics.mechanics (and for beam bending specifically, the new sympy.physics.continuum_mechanics). 

This trick seems mostly harmless, since SymPy treats DiracDelta outside of integration symbolically (i.e., DiracDelta(x) = 0 if x != 0 and oo if x = 0). As I noted before, by that symbolic definition (a function that is 0 except at a single point), the limit is 0, so things work out. The problem with treating something like DiracDelta like a normal expression is that you can't just put it anywhere in an expression and expect it to make sense (what is sin(DiracDelta(x))?). But for a specialised mechanics toolkit, it is only going to create expressions that make physical sense (and hence, mathematical sense with the "shaky" definitions). 

Aaron Meurer

To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
Reply all
Reply to author
Forward
0 new messages