Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello.
I came upon an interesting case: singularity function defined in my particular case as < r - r_o >^0
It is also said that if r < r_o then the whole function is equal to zero.
Do we have any means of evaluating this function in Mathcad, such that, if I plug inn any values of "r" and "r_o" into the function, it will return to zero (of course if r < r_o)? Otherwise this function is always 1 (if r > r_o and if we ommit the case when r = r_o).
Best regards,
Sergey
Solved! Go to Solution.
OK. I looked up the singularity functions in WikiPedia. It states that <r - r0>^0 is The Heaviside step function for r-R0, so:
This function is 'simple' in the sense that its output is 1 when r>r0, 0 when r<r0 (and the result for r=r0 is debatable, sometimes given as 0, other times as 1 and 1/2 also occurs.
Mathcad 11, numeric and symbolic:
I like the symbolic answer for F0(0,0).
Prime 11 gives:
I'm on express so can't evaluate it symbolically.
You don't get negative values for <r - r0>^n . Not when n=0, see above, but also not when n>0, because the term (r-r0) get multiplied by F0(r-r0) which is 0 whenever r<r0. So wherever you thought it would become negative, it becomes 0.
Success!
Luc
Thank you.
Do you mean this function?:
Numerically it evaluates to 1 for any values of r and r0, so I don't see 0 as a result.
Interestingly it also evaluates to 1 when r=r0=0 (or any other value).
But the symbolic processor of Mathcad 11 for the r=r0 case: it says it's undefined.
I wonder what Prime 11 gives...
Success!
Luc
I tried it out. Mathcad evaluates function to 1 when r < r0, which is strange. Shouldn't it be -1?
I reffer to this regarding the zero value of the sigular function when r < r0. Any thoughts?
OK. I looked up the singularity functions in WikiPedia. It states that <r - r0>^0 is The Heaviside step function for r-R0, so:
This function is 'simple' in the sense that its output is 1 when r>r0, 0 when r<r0 (and the result for r=r0 is debatable, sometimes given as 0, other times as 1 and 1/2 also occurs.
Mathcad 11, numeric and symbolic:
I like the symbolic answer for F0(0,0).
Prime 11 gives:
I'm on express so can't evaluate it symbolically.
You don't get negative values for <r - r0>^n . Not when n=0, see above, but also not when n>0, because the term (r-r0) get multiplied by F0(r-r0) which is 0 whenever r<r0. So wherever you thought it would become negative, it becomes 0.
Success!
Luc
So is the way of writing < r - r_o >^0 in Mathcad?
I would say that r=r0 is a removable discontinuity and (r-r0)^0 can be defined(!) as being 1 to make it continuous.
I see no reason defining it as 1/2 (which is the value for the Heaviside function at 0 which Mathcad settled at).
In Prime10 both the numeric as well as the symbolics seems to automatically apply this definition
> It is also said that if r < r_o then the whole function is equal to zero.
WHO is saying so? Thats not true, of course as (-3)^0 = 1 as well. There is only a point of singularity at r=r0 which can be coped with by defining the result being 1 as well.
Or did you mean that you would like to define a function which returns 1 for r>=r0 and zero otherwise?
You may use a boolean expression to do so
or you may use the if function to do so (if you don't need symbolic evaluation with symbolic arguments
The difference from the definition with the Heaviside function is the result for r=r0, because in Mathcad and Prime, the Heaviside function is implemented so that its value at the point is 1/2. As Luc already wrote, this is not standardized and may be implemented elsewhere with 0 or 1. For example, the result of the Heaviside function at 0 in Wolfram Alpha is 1. Depending on the specific application, one or the other definition may have advantages. We have to accept the way its implemented in Prime.
I like the symbolic answer for F0(0,0).
Prime 11 gives:
I'm on express so can't evaluate it symbolically.
Like the answer Phi(0), too 😉
Both MC15 and Prime 10 symbolically evaluate Phi(0) to 1/2 - in agreement with the numerical implementation.