COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### how we plot two dimensional dirac delta function

• Email
• Follow

```hi.....
i am trying to plot a dirac delta function in a meshgrid of x,y.
i want a delta function at (x=1,y=2)&(x=-3,y=1) then what is command for it.
i can plot delta function at x=1(ie. one dimension),but not in two dimension.
please give me suggestion respected to this.
thanks.
```
 0

See related articles to this posting

```On 10-09-07 12:49 PM, BRIJESH SINGH wrote:

> i am trying to plot a dirac delta function in a meshgrid of x,y.
> i want a delta function at (x=1,y=2)&(x=-3,y=1) then what is command for
> it.
> i can plot delta function at x=1(ie. one dimension),but not in two
> dimension.
> please give me suggestion respected to this.

You cannot do it. The Dirac Delta function cannot be plotted on any finite
computer. It has the property that it is everywhere 0 except at x=0 and is
infinite there, and also has the property of the integral of it from -infinity
to +infinity is 1, which requirement is incompatible with any "function" that
is defined as anything other than the limit of another series of functions,
with the understanding that the limit is unreachable.

If you attempt to modify the standard diract delta distribution by shifting it
upwards to y=2 instead of y=1, then taking into account that infinity plus 2
is still infinity, this can be characterized as 2 + the standard dirac delta.
If, though, you attempt to integrate this over t = -infinity to +infinity
because you can separate out the parts, this would be the standard integral of
dirac delta from -infinity to +infinity (which quantity is defined as 1), plus
the integral of 2 from t=-infinity to +infinity... the the +2 would integrate
to (2*t) at +infinity minus (2*t) at -infinity, which would give 2*infinity -
2*(-infinity) or 4 * infinity which would be infinity. Add the 1 for the
regular dirac integration and you get infinity. Therefore if you shift the
dirac delta by any finite constant amount, the integral of the result becomes
infinite and it ceases to be a dirac delta.
```
 0

```On Sep 8, 5:49=A0am, "BRIJESH SINGH" <brijeshsingh...@gmail.com> wrote:
> hi.....
> =A0i am trying to plot a dirac delta function in a meshgrid of x,y.
> i want a delta function at (x=3D1,y=3D2)&(x=3D-3,y=3D1) then what is comm=
and for it.
> i can plot delta function at x=3D1(ie. one dimension),but not in two dime=
nsion.
> please give me suggestion respected to this.
> =A0thanks.

plot(x,y,'b+')
hold on
plot(1,2,'ro')
plot(-3,1,'ro')
hold off

This is a down-looking plot of the grid with red circles at the
locations of the delta functions.

Walter: notice this plot makes no assumption about the magnitude of
the delta functions, just their locations.
```
 0
Reply mulgor (3011) 9/7/2010 10:01:21 PM

```On 10-09-07 05:01 PM, TideMan wrote:
> On Sep 8, 5:49 am, "BRIJESH SINGH"<brijeshsingh...@gmail.com>  wrote:
>> hi.....
>>   i am trying to plot a dirac delta function in a meshgrid of x,y.
>> i want a delta function at (x=1,y=2)&(x=-3,y=1) then what is command for it.
>> i can plot delta function at x=1(ie. one dimension),but not in two dimension.
>> please give me suggestion respected to this.
>>   thanks.
>
> plot(x,y,'b+')
> hold on
> plot(1,2,'ro')
> plot(-3,1,'ro')
> hold off
>
> This is a down-looking plot of the grid with red circles at the
> locations of the delta functions.
>
> Walter: notice this plot makes no assumption about the magnitude of
> the delta functions, just their locations.

A dirac function cannot possibly appear at anywhere other than y = 0, not
unless it is rotated away from the axis of y being a constant. As I
demonstrated in my earlier post, if you attempt to construct such a function
that goes through y = u where u is non-zero and non-infinite and the line is
flat (as is expected for a dirac function), then you end up with an integral
of 2*u*infinity + 1 rather than an integral of +1 as is requires for a dirac
function.

You could move the delta point anywhere along the axis and still have the
integration requirement statisfied, but if you attempt to use that property to
move a dirac delta to pass through x=1, y=2 then because of the integral
problem I described, you would have to approximate by having the shift be +1
in the x direction and having the delta go "through" y=2 on its way from y=0
to y=infinity. That works on any series of approximations of the delta
function that narrow around the spike point: each of the finite spikes would
go through y=2. However, in the limiting case of the true dirac delta, the
function does not pass _through_ y=2, it simply has a discontinuity that jumps
immediately to y=infinity without going through any intermediate point.

Thus it is meaningless to have a dirac delta "at" or "passing through" any
non-zero y value (other than y=infinity.) Unless, that is, you are willing to
consider the dirac delta distributions that can have non-zero components
outside of the spike location, such as would be the case for the limit of
sinc(x/a)/a as a approaches 0.
```
 0

```On Sep 8, 11:27=A0am, Walter Roberson <rober...@hushmail.com> wrote:
> On 10-09-07 05:01 PM, TideMan wrote:
>
>
>
> > On Sep 8, 5:49 am, "BRIJESH SINGH"<brijeshsingh...@gmail.com> =A0wrote:
> >> hi.....
> >> =A0 i am trying to plot a dirac delta function in a meshgrid of x,y.
> >> i want a delta function at (x=3D1,y=3D2)&(x=3D-3,y=3D1) then what is c=
ommand for it.
> >> i can plot delta function at x=3D1(ie. one dimension),but not in two d=
imension.
> >> please give me suggestion respected to this.
> >> =A0 thanks.
>
> > plot(x,y,'b+')
> > hold on
> > plot(1,2,'ro')
> > plot(-3,1,'ro')
> > hold off
>
> > This is a down-looking plot of the grid with red circles at the
> > locations of the delta functions.
>
> > Walter: notice this plot makes no assumption about the magnitude of
> > the delta functions, just their locations.
>
> A dirac function cannot possibly appear at anywhere other than y =3D 0, n=
ot
> unless it is rotated away from the axis of y being a constant. As I
> demonstrated in my earlier post, if you attempt to construct such a funct=
ion
> that goes through y =3D u where u is non-zero and non-infinite and the li=
ne is
> flat (as is expected for a dirac function), then you end up with an integ=
ral
> of 2*u*infinity + 1 rather than an integral of +1 as is requires for a di=
rac
> function.
>
> You could move the delta point anywhere along the axis and still have the
> integration requirement statisfied, but if you attempt to use that proper=
ty to
> move a dirac delta to pass through x=3D1, y=3D2 then because of the integ=
ral
> problem I described, you would have to approximate by having the shift be=
+1
> in the x direction and having the delta go "through" y=3D2 on its way fro=
m y=3D0
> to y=3Dinfinity. That works on any series of approximations of the delta
> function that narrow around the spike point: each of the finite spikes wo=
uld
> go through y=3D2. However, in the limiting case of the true dirac delta, =
the
> function does not pass _through_ y=3D2, it simply has a discontinuity tha=
t jumps
> immediately to y=3Dinfinity without going through any intermediate point.
>
> Thus it is meaningless to have a dirac delta "at" or "passing through" an=
y
> non-zero y value (other than y=3Dinfinity.) Unless, that is, you are will=
ing to
> consider the dirac delta distributions that can have non-zero components
> outside of the spike location, such as would be the case for the limit of
> sinc(x/a)/a as a approaches 0.

Walter:
I think you've got the wrong end of the stick.
The OP has a 2-D field x-y in which there are delta functions in the
3rd dimension (time, space, whatever).
So if you look down on this field from any height, you'll see zero
values everywhere except for the locations of the delta functions.
At least, that's how I interpret it................
```
 0
Reply mulgor (3011) 9/8/2010 12:38:55 AM

```On 10-09-07 07:38 PM, TideMan wrote:

> Walter:
> I think you've got the wrong end of the stick.
> The OP has a 2-D field x-y in which there are delta functions in the
> 3rd dimension (time, space, whatever).
> So if you look down on this field from any height, you'll see zero
> values everywhere except for the locations of the delta functions.
> At least, that's how I interpret it................

Hmmm, could be. I don't see any reference to the third dimension in the
original posting, but it wouldn't be the first time someone has missed a point
such at this.

Dirac deltas are traditionally defined as being 0 except at the intersection
of two axes, and in particular the traditional (but not only possible) 2D case
requires one of the dimensions to be strictly 0 (except at one point) in order
for the integral to work out properly -- any non-zero component must be
balanced by sufficient non-zero with other sign in order for the integral
outside the singularity to be 0.

When we take the 3D extension of Dirac Deltas, the function would need to
integrate to 1 over the surface, not just over a line. If one of the axes has
a non-zero constant (that is separable from any effect of the other variable),
then you get the same kind of problem I explored before. Even if you don't,
you pick up a constant in integration from the first integral and that's going
to provoke an infinite sum along the second variable, which I am not happy
with unless there is good reason for us to say that the circumstances demand
boundary conditions under which that constant of integration is 0.

I would need to think more about the possibility there are no separable terms
that lead to non-vanishing constants and yet the delta just happens to be
defined at a particular point. I really haven't decided yet... I'm proving and
disproving both possibilities several times between words I type here ;-)
```
 0