Dirac.mw
Functions with discontinuities. Dirac and continuous approximations.
Clara MASSE, John MASSE, François OLLIVIER
The derivative of the Heaviside function is the Dirac function
> |
 |
 |
(1) |
The numerical evaluation of this function using "piecewise" is the same, but its derivative different.
> |
 |
 |
(2) |
Using Heaviside, one may invert "int" and "diff" where the function is differentiable.
> |
 |
 |
(3) |
> |
 |
 |
(4) |
This no longer works with to successive integrations and derivations.
> |
 |
> |
 |
 |
(6) |
In a numerical environment, one may use some approximation of Heaviside, e.g. with "erf" function.
> |
 |

 |
(7) |
We see that one needs to play with the value of parameter "b" in order to obtained the best precision.
> |
![Digits := 10; 1; resu2 := dsolve([diff(Z(y), y) = diff(`*`(`+`(erf(`*`(`+`(y, `-`(a)), `*`(b))), 1), `/`(1, 2)), a, a), diff(Z1(y), y) = Z(y), Z(-1.) = 0., Z1(-1.) = 0.], [Z(y), Z1(y)], numeric, param...](images/Dirac_28.gif)
![Digits := 10; 1; resu2 := dsolve([diff(Z(y), y) = diff(`*`(`+`(erf(`*`(`+`(y, `-`(a)), `*`(b))), 1), `/`(1, 2)), a, a), diff(Z1(y), y) = Z(y), Z(-1.) = 0., Z1(-1.) = 0.], [Z(y), Z1(y)], numeric, param...](images/Dirac_29.gif) |
 |
 |
(9) |
The situation remains unchanged, even with the stiff option and a great number of digits.
We may observe the same behaviour with "arctan".