Results 1 to 5 of 5

Math Help - Plotting Dirac delta function in Mathematica.

  1. #1
    Junior Member
    Joined
    Sep 2010
    Posts
    47

    Unhappy Plotting Dirac delta function in Mathematica.

    Hello,

    I'm trying to check my work, but having problems with plotting in Mathematica... Until now i just used Heaviside[ ] function and did ok... but I can't get to plot Dirac... i tried to do it and just can't... please someone help

    I'm trying to plot these signals....

    h(t) = \delta u (t+2) + 2\delta u(t+1)

    and

    h(t) = \delta u(t-1) -\delta (t-3)
    Last edited by mr fantastic; April 10th 2011 at 03:31 PM. Reason: Re-titled.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by sedam7 View Post
    Hello,

    I'm trying to check my work, but having problems with plotting in Mathematica... Until now i just used Heaviside[ ] function and did ok... but I can't get to plot Dirac... i tried to do it and just can't... please someone help

    I'm trying to plot these signals....

    h(t) = \delta u (t+2) + 2\delta u(t+1)

    and

    h(t) = \delta u(t-1) -\delta (t-3)
    What do you expect the plot to look like? You do know what the Dirac delta is?

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Note that in Mathematica,

    \delta(x)\leftrightarrow\text{DiracDelta}[x].
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Ackbeet View Post
    Note that in Mathematica,

    \delta(x)\leftrightarrow\text{DiracDelta}[x].
    But how will M. plot that (if at all), an upward pointing arrow at x=0? Wolfram Alpha certainly does not want to plot it!

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Mathematica just shows the axes. There's no line or arrow or anything. Here's a method for plotting the DiracDelta as an arrow:

    <<Graphics`Arrow`
    PlotOne=Plot[DiracDelta[x-1],{x,0,2}]
    PlotTwo=Show[Graphics[Arrow[{1,0},{1,1}]]]
    Show[PlotOne,PlotTwo]

    That will give you an arrow going from the point <1,0> to the point <1,1>, representing the delta function \delta(x-1), of "strength" 1.

    If you wanted to generalize, you could let

    MyDiracDelta[Strength_,a_]=Arrow[{a,0},{a,Strength}]

    after loading the arrow package as shown above.

    Then you could do

    PlotOne=Plot[Strength DiracDelta[x-a],{x,a-1,a+1}]
    PlotTwo=Show[Graphics[MyDiracDelta[Strength,a]]]
    Show[PlotOne,PlotTwo]

    and so on.

    Hope that helps.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Dirac delta function
    Posted in the Differential Geometry Forum
    Replies: 4
    Last Post: September 14th 2011, 11:24 AM
  2. Dirac Delta Function Integral
    Posted in the Calculus Forum
    Replies: 1
    Last Post: April 29th 2010, 08:58 AM
  3. Dirac delta function
    Posted in the Differential Geometry Forum
    Replies: 4
    Last Post: March 10th 2010, 02:15 PM
  4. dirac delta function
    Posted in the Calculus Forum
    Replies: 2
    Last Post: December 26th 2008, 11:05 AM
  5. Solving DE involving dirac delta function
    Posted in the Calculus Forum
    Replies: 5
    Last Post: September 7th 2008, 10:38 PM

Search Tags


/mathhelpforum @mathhelpforum