how do I combine terms with a common power in a polynomial
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Howard Padmore
am 13 Jun. 2023
Kommentiert: Dyuman Joshi
am 16 Jun. 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 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 14 Jun. 2023
Bearbeitet: Dyuman Joshi
am 14 Jun. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!