-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heaviside function #14981
Comments
I suppose so, but I don't really see much use for Heaviside functions in numerical code. Any good examples of when you'd use it in practice? |
I don't have any good example. I have used the SymPy's to write some superpositions of planewaves. The real reason I was thinking of having one is beacuase I was writing a printing method in SymPy to generate the equivalent Julia form. I guess it makes more sense to have the function in SymPy.jl to allow the translation of symbolic expressions to fast Julia methods. |
The function is mostly used as distribution, where it does not matter which value it takes at zero. A symbolic integration package might define |
Of course, it is not needed as a real function. As I said, it was motivated from the idea to translate SymPy to Julia code and it probably makes more sense over SymPy.jl than in Base. I'll close this. |
In case this is still of interest to anyone, a numerical example where a library piecewise function would be nice (I'm fitting to this function today): https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2744968/ See equation 2. |
Would it be too much to have a
heaviside
function in base? Something likeThe text was updated successfully, but these errors were encountered: