how do I combine terms with a common power in a polynomial
Show older comments
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 Comments
Dyuman Joshi
on 13 Jun 2023
Edited: Dyuman Joshi
on 13 Jun 2023
They are combined in the output from taylor() (as sigma6)
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)
Howard Padmore
on 13 Jun 2023
Dyuman Joshi
on 16 Jun 2023
@Howard Padmore did you check my answer?
Howard Padmore
on 16 Jun 2023
Dyuman Joshi
on 16 Jun 2023
Glad to have helped!
Accepted Answer
More Answers (0)
Categories
Find more on Calculus 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!
