Problem with symbolic variables in dirac functions

4 ビュー (過去 30 日間)
Abhishek
Abhishek 2011 年 11 月 19 日
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

回答 (1 件)

Walter Roberson
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)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by