how do I combine terms with a common power in a polynomial
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Howard Padmore
le 13 Juin 2023
Commenté : Dyuman Joshi
le 16 Juin 2023
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 commentaires
Réponse acceptée
Dyuman Joshi
le 14 Juin 2023
Modifié(e) : Dyuman Joshi
le 14 Juin 2023
"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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!