Matlab Symbolic Toolbox: assumptions not considered for expand function
2 views (last 30 days)
Show older comments
I have encountered the following inconsistency while programming with the Matlab Symbolic Toolbox.
From trigonometry we know that cos(a*x) = a*cos(x) if 'a' is a variable that can assume only values +1 and -1 (the same holds for 'sin' function). However, this equivalence is not considered by function 'expand', being values of variable 'a' properly constrained. Here is the example:
____________________________
syms a x
assume(a, 'integer'); assumeAlso(a == +1 | a == -1);
s = cos(a*x);
expand(s)
ans =
cos(a*x)
____________________________
How can I include such "rule" in developing symbolic mathematical expressions?
0 Comments
Answers (0)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!