how do I combine terms with a common power in a polynomial
조회 수: 4 (최근 30일)
이전 댓글 표시
I am using the symbolic toolbox and am new to it. I have taylor expanded an expression that is a function of x and y. Part of the expansion is
y^2/(2*R) + x^2/(2*R*cos(t)^2) + (A*y^3)/(2*R) + (B*y^4)/(8*R) + (A^2*y^4)/(2*R) + (A^3*y^5)/(2*R)
1st 3 terms in y^2, x^2 and y^3 are fine, but y^4 is split into two terms that should be combined. Anyone know how to do this? Code is
syms z x y t R A B
T=taylor(((x^2*(sec(t))^2+y^2)/((R*((1-A*y)+((1-A*y)^2-B*(x^2*(sec(t))^2+y^2))^0.5)))),[x,y],'Order',6)
T1=collect(T,[x y])
T2=combine(T1,'IgnoreAnalyticConstraints',true)
T3=expand(T2)
댓글 수: 5
채택된 답변
Dyuman Joshi
2023년 6월 14일
편집: Dyuman Joshi
2023년 6월 14일
"What I really want is to not have the sigmas at all, ie. just mutiply them out. Is this possible?"
It is possible.
From the documentation page Abbreviate Common Terms in Long Expressions - By default, live scripts display symbolic expressions in abbreviated output format.
You can turn off abbreviated output format by setting the 'AbbreviateOutput' preference to false.
syms z x y t R A B
%Change the setting
sympref('AbbreviateOutput',false);
f=taylor(((x^2*(sec(t))^2+y^2)/((R*((1-A*y)+((1-A*y)^2-B*(x^2*(sec(t))^2+y^2))^0.5)))),[x,y],'Order',7);
f1=collect(f,[x y]);
f2=combine(f1,'IgnoreAnalyticConstraints',true);
f3=expand(f2);
f4=collect(f3,[x y])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!