Dirac Delta Question

Hey y'all, I'm very confused as to how to numerically incorporate dirac delta behaviour into my differential equation. Maybe I'm using a wrong approach? I keep getting error messages to no avail. Any advice would be greatly appreciated!

"Sam " <samnuzbrokh@yahoo.com> wrote in message <kd9r7h$38b$1@newscl01ah.mathworks.com>...
> Hey y'all, I'm very confused as to how to numerically incorporate dirac delta behaviour into my differential equation. Maybe I'm using a wrong approach? I keep getting error messages to no avail. Any advice would be greatly appreciated!
>
> function dirac
> close all
> clc; clear
>
> %Parameters:
> G=1.07;
> w=2*pi;
> w0=(1.5)*w;
> B=(w0)/4;
>
> % Initial Conditions
> y0 = [0,0];
>
> % Make a theta vs. time plot
> [t,y] = ode23(@f,[0 25],y0,[],G,w,w0,B);
>
> hold all
> plot(t,y(:,1))
>
> function dydt = f(t,y,G,w,w0,B)
> dydt = [y(2);-2*B*y(2)-(w0^2)*sin(y(1))+G*(w0^2)*cos(w*t)+dirac(t-5)];
- - - - - - - - - - -
You cannot actually do numerical computation using the dirac delta function directly. It is only numerically meaningful in its integrated form as a unit step function. That is, its integral from 0 to 0 is understood to be 1. That of course is impossible for ordinary numerical integration to accomplish. For that reason you have to treat it in special ways such as with the method Bruno has suggested. Some of the symbolic tools are also able to handle it properly but never, never try to compute numerically with it directly.

I have a question about Dirac delta (not as in a matlab function, my question is related to its theory)

Assume that you have a vector v. If the value of v is equal to zero then the result of the dirac delta of v is zero (so, it does not matter it is a vector or scalar) If the value of v is not zero then what is the result of the dirac delta function of the vector v? Is the result a vector or scalar value ?

"Roger Stafford" wrote in message <kda1pg$p98$1@newscl01ah.mathworks.com>...
> "Sam " <samnuzbrokh@yahoo.com> wrote in message <kd9r7h$38b$1@newscl01ah.mathworks.com>...
> > Hey y'all, I'm very confused as to how to numerically incorporate dirac delta behaviour into my differential equation. Maybe I'm using a wrong approach? I keep getting error messages to no avail. Any advice would be greatly appreciated!
> >
> > function dirac
> > close all
> > clc; clear
> >
> > %Parameters:
> > G=1.07;
> > w=2*pi;
> > w0=(1.5)*w;
> > B=(w0)/4;
> >
> > % Initial Conditions
> > y0 = [0,0];
> >
> > % Make a theta vs. time plot
> > [t,y] = ode23(@f,[0 25],y0,[],G,w,w0,B);
> >
> > hold all
> > plot(t,y(:,1))
> >
> > function dydt = f(t,y,G,w,w0,B)
> > dydt = [y(2);-2*B*y(2)-(w0^2)*sin(y(1))+G*(w0^2)*cos(w*t)+dirac(t-5)];
> - - - - - - - - - - -
> You cannot actually do numerical computation using the dirac delta function directly. It is only numerically meaningful in its integrated form as a unit step function. That is, its integral from 0 to 0 is understood to be 1. That of course is impossible for ordinary numerical integration to accomplish. For that reason you have to treat it in special ways such as with the method Bruno has suggested. Some of the symbolic tools are also able to handle it properly but never, never try to compute numerically with it directly.
>
> Roger Stafford

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ketnla$ki1$1@newscl01ah.mathworks.com>...
> "Carl S." wrote in message <ketmn8$gs9$1@newscl01ah.mathworks.com>...
> > ... the dirac delta of v ...
>
> The expression above alone does not make meaningful sense. A dirac is a function (to be more precise a distribution). There is no such thing as "the dirac of somethingelse".
>
> Bruno

Sorry Bruno, I mean that the result of the dirac delta function of the parameter v.
Here, v is a vector. What is the result of the function? A vector ? A scalar ?

"Carl S." wrote in message <ketohd$o93$1@newscl01ah.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message
>
> Sorry Bruno, I mean that the result of the dirac delta function of the parameter v.
> Here, v is a vector. What is the result of the function? A vector ? A scalar ?

The result is meaningless, since you ask something that does not make any sense to me. There is no such thing as "dirac of a vector".

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ketq40$1pr$1@newscl01ah.mathworks.com>...
> "Carl S." wrote in message <ketohd$o93$1@newscl01ah.mathworks.com>...
> > "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message
> >
> > Sorry Bruno, I mean that the result of the dirac delta function of the parameter v.
> > Here, v is a vector. What is the result of the function? A vector ? A scalar ?
>
> The result is meaningless, since you ask something that does not make any sense to me. There is no such thing as "dirac of a vector".
>
> I just repeat what I said earlier.
>
> Bruno

If v is a vector valued function, then ?

for example: C = [x(teta) y(teta)] and v(C, t). In this case, is the result of the dirac delta function of v meaningful ? If yes, what is its value ? a vector ?

>
> If v is a vector valued function, then ?
>
> for example: C = [x(teta) y(teta)] and v(C, t). In this case, is the result
>of the dirac delta function of v meaningful ? If yes, what is its value ? a vector ?
>

What is your defintion of "dirac delta function" ?

You really can't just use or apply something if you do not know what it is
you are using.

>
> for example: C = [x(teta) y(teta)] and v(C, t). In this case, is the result of the dirac delta function of v meaningful ? If yes, what is its value ? a vector ?

A Dirac "function" (x is variable) is a distribution. The standard mathematic notation is "delta(x)", and it has zero value every where excepted at x=0 (its "support"), and integral of dirac is 1.

When one notes f=delta(x - 4), it is a composition of a dirac function with the function (x -> y:=x-4). Meanig that that f is the standard delta that is shifted so that the support is at x=4 (since when x=4, y = x-4=0) .

Many be you want to know g = delta(v(C,t)) (dirac of V), that mean a 2D "function" that has support at the set of points S = { v(C,t) = 0 } (+ some integral property). g is a distribution (function if you like), but is certainly not scalar or vector.

"Carl S." wrote in message <ketohd$o93$1@newscl01ah.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ketnla$ki1$1@newscl01ah.mathworks.com>...
> > "Carl S." wrote in message <ketmn8$gs9$1@newscl01ah.mathworks.com>...
> > > ... the dirac delta of v ...
> >
> > The expression above alone does not make meaningful sense. A dirac is a function (to be more precise a distribution). There is no such thing as "the dirac of somethingelse".
> >
> > Bruno
>
> Sorry Bruno, I mean that the result of the dirac delta function of the parameter v.
> Here, v is a vector. What is the result of the function? A vector ? A scalar ?

In theoretical physics at least, one means with \delta(x), where x is a vector, the product \delta(x_1)\delta(x_2)\delta(x_3) .. and so on. So the result is a scalar.

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kgo84k$jt5$1@newscl01ah.mathworks.com>...
> "M Antola" <matti.antola@helsinki.fi> wrote in message <kgo5g8$amh$1@newscl01ah.mathworks.com>...
>
> > In theoretical physics at least, one means with \delta(x), where x is a vector, the product \delta(x_1)\delta(x_2)\delta(x_3) .. and so on.
>
> OK
>
> >So the result is a scalar.
>
> This statement does not make sense. A distribution is NOT a scalar.
>
> Bruno

I think the biggest mistake is to even mention the words "function" and "value" when dealing with someone who does not understand the basic concept of distribution theory.

Greg

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.