0
$\begingroup$

The formula for a single impulse of amplitude $1$ at $x=r$ is given by

$$\frac {\sin (\pi (x-r))}{\pi (x-r)}$$

(In MathJax because it's a math formula.)

Formally, at $x=r$, this function evaluates to $\frac {0}{0}$. As a result, understandably, Mathematica returns "Indeterminate". But analytically, the function should evaluate to $1$, as this is the limit of the function as $x$ approaches $r$ from either direction.

Is there a way to persuade Mathematica to evaluate the function to $1$ at this point?

(I'm only just learning Mathematica, so please be gentle!)

$\endgroup$
  • 2
    $\begingroup$ "In MathJax because it's a math formula": please also provide Mathematica code, because this is a Mathematica forum. $\endgroup$ – MarcoB Jul 6 '18 at 15:10
3
$\begingroup$

Use Sinc[Pi(x-r)]. Sinc[z] is defined as Sin[z]/z unlessz==0, in which case it is 1.

$\endgroup$
1
$\begingroup$

By defining the following function:

f[x_] := Piecewise[{{Sin[Pi (x - r)]/(Pi (x - r)), x != r}, {1, x == r}}]

the problem is solved, in fact f[r] = 1.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.