필터 지우기
필터 지우기

how do I combine terms with a common power in a polynomial

조회 수: 4 (최근 30일)
Howard Padmore
Howard Padmore 2023년 6월 13일
댓글: Dyuman Joshi 2023년 6월 16일
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
Howard Padmore
Howard Padmore 2023년 6월 16일
Perfect......many thanks!
Dyuman Joshi
Dyuman Joshi 2023년 6월 16일
Glad to have helped!

댓글을 달려면 로그인하십시오.

채택된 답변

Dyuman Joshi
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])
f4 = 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by