Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Differentiation of a dirac function

Subject: Differentiation of a dirac function

From: KH

Date: 5 Aug, 2010 15:12:04

Message: 1 of 2

I want to find out the first derivative of Dirac delta function. I got the answer from the symbolic toolbox and then converted it into a function handle.

syms x
a = matlabFunction(diff(dirac(x-10)));

Matlab returns
a =
    @(x)dirac(x-10,1)

The answer is fine. Then, let's say if you evaluate a(10), the error says too many input arguments.
Error in ==> sym.matlabFunction>makeFhandle/@(x)dirac(x-10,1)

Can anyone tell me if it is an inherent error to evaluate the derivative of Dirac delta function in Matlab?

Thanks

Subject: Differentiation of a dirac function

From: Roger Stafford

Date: 5 Aug, 2010 18:42:04

Message: 2 of 2

"KH " <jambanova@hotmail.com> wrote in message <i3ekc4$fe4$1@fred.mathworks.com>...
> I want to find out the first derivative of Dirac delta function. I got the answer from the symbolic toolbox and then converted it into a function handle.
>
> syms x
> a = matlabFunction(diff(dirac(x-10)));
>
> Matlab returns
> a =
> @(x)dirac(x-10,1)
>
> The answer is fine. Then, let's say if you evaluate a(10), the error says too many input arguments.
> Error in ==> sym.matlabFunction>makeFhandle/@(x)dirac(x-10,1)
>
> Can anyone tell me if it is an inherent error to evaluate the derivative of Dirac delta function in Matlab?
>
> Thanks
- - - - - - - - - - -
  The Dirac delta function only becomes significant for non-Riemann type integrals where single points are allowed to have finite non-zero measure. If you say dirac(0) it will give inf as the answer but that does not reveal its true meaning. You could not put that value into an ordinary numerical integration and get a correct answer.

  In the case of the derivative of the dirac function, it would have to have the property that some kind of double integration of it would give a finite answer at the value x = 0. You cannot expect anything reasonable to come of trying to evaluate such a derivative at the point 0. If it were to issue an inf value, that would be very short of the reality.

  The error message you received is probably due to the symbolic toolbox creators never having expected anyone to make such a weird request. If they were to anticipate it, the message could well read something like this: "Never do that again!"

Roger Stafford

Tags for 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.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us