Problem with symbolic variables in dirac functions
4 次查看(过去 30 天)
显示 更早的评论
Hello,
Can anybody tell me whats wrong with this:
clear all;
syms x1 x2 x0 x 'positive';
syms L 'positive';
d1=dirac(x-x0)
d2=subs(d1,{x1,x2,x0},{0,L,L/2})
The answer to this should be: d1=dirac(x-x0) d2=dirac(x-L/2)
but the response I get from Matlab:
d1 =
dirac(x - x0)
d2 =
dirac(L/2 - x)
why are the arguments of the dirac function in d2 (L/2-x) instead of (x-x0)? In symbolic calculations is it possible to specify somewhere that x1<x<x2 ??
Abhishek
0 个评论
回答(1 个)
Walter Roberson
2011-11-19
Note: you should not be quoting anything in the syms command.
syms x1 x2 x0 x positive;
The Dirac delta function, dirac, has the value 0 for all x not equal to 0 and the value Inf for x = 0.
You can see from this description that the only important information is whether the value is 0 or not. Therefore the sign of the expression is irrelevant. dirac(x) is the same as dirac(-x)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!