Message Boards Message Boards

0
|
7580 Views
|
7 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Use Dirac Function

Posted 4 years ago

Hi, I'm still a beginner on Mathematica, I have a question please, I need the Dirac function which equals 1 on f 0 and 0 for the other values. the DiracDelta [.] function does not give 0 in 0 !!

POSTED BY: Lina Lili
7 Replies

Try using DiscreteDelta instead

POSTED BY: Jesse Sheinwald

Maybe you want:

  DIRAC[x_] := Piecewise[{{1, x == 0}}](*Defining a new function called DIRAC*)
  {DIRAC[0], DIRAC[1], DIRAC[-2]}

  (*{1, 0, 0}*)
POSTED BY: Mariusz Iwaniuk

thank you, that's it.

POSTED BY: Lina Lili
Posted 4 years ago

The value of the Dirac delta function at 0 is not 1. Check the WikiPedia page. From the documentation

DiracDelta stays unevaluated for x==0

Integrate[DiracDelta[x], {x, -Infinity, Infinity}]
(* 1 *)
POSTED BY: Rohit Namjoshi
Posted 4 years ago

The DiracDeta function is really not a function, it is a distribution. DiracDelta[0] does not have a value. It is defined by its effect under integration, which Mathematica performs correctly:

Integrate[f[x] DiracDelta[x - a], {x, -Infinity, Infinity}, 
 Assumptions -> a \[Element] Reals]

(* f[a] *)
POSTED BY: David Keith
Posted 4 years ago

Check the documentation for DiracDelta.

POSTED BY: Rohit Namjoshi

I already saw them, the DiracDelta function gives 0 in every point different from zero, but the problem is in 0 does not give 1 !!!

POSTED BY: Lina Lili
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract