Does Symbolic int() Always Return Justifiable Results When the Integrand Includes a kroneckerDelta?

9 visualizzazioni (ultimi 30 giorni)
Integrating the kroneckerDelta sounds a bit weird, but it it it's allowe it should be consistent.
Define the Kronecker Delta and some test functions
syms x w real
K = kroneckerDelta(x);
y = [1;cos(x);exp(-x);exp(-1j*w*x)];
All of the test functions are equal to one at the origin, so I would expec that multiplying them by K(x) would return K(x).
Checking
isAlways(K.*y == K)
Warning: Unable to prove 'cos(x)*kroneckerDelta(x, 0) == kroneckerDelta(x, 0)'.
ans = 4x1 logical array
1 0 1 1
Why is the second entry not provable? Especially because
simplify(K.*y)
ans = 
I would expect that all integrals of K*y(i) would either be zero or unevaluated. The first three do return zero, but the last one is unevaluated. What is unique about the last case?
int(K.*y,x,-10,10)
ans = 
The anti-derivative yields a result in all four cases, though I don't understand what an anti-derivative of the Kronecker Delta would be. I'm very surprised that all of these were not returned as unevaluated. But, given that they are evaluated, and in light of the isAlways result above, why are the third and fourth entries different from the first and from each other?
A = int(K.*y,x)
A = 
  3 Commenti
Paul
Paul il 8 Apr 2025
Hi David,
An antiderivative of the dirac delta function is the heaviside function, and Matlab handles this case (to within a constant of integration)
syms t
int(dirac(t),t)
ans = 
But the kroneckerDelta function is a different function. In particular
kroneckerDelta(sym(0))
ans = 
1
In my limited experience, the Kronecker delta function is typically defined only over the integers; therefore it doesn't really make sense to integrate it in the first place. But I ran into a situation in Matlab the other day where a Kronecker delta showed up in a continuous-time expression, which got me investigating this situation.
David Goodmanson
David Goodmanson il 8 Apr 2025
Modificato: David Goodmanson il 8 Apr 2025
Hi Paul,
I should have noticed the the kronecker part, since I've used it enough in the past. Interesting that the function works for noninteger input. Might be better if it didn't.

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by