vpa, simplify, solve, etc don't fully simplify symbolic function.

I am doing integration using MATLAB's symbolic toolbox. I have many functions of my independent variable, z. This is my code, with numbers changed and the problem simplified. I have F1 print at the end just so I can see what the function resolves to.
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z - 2.5*z^2;
R = - int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = simplify(- int(Q(z), [0 z]) - R,"IgnoreAnalyticConstraints",true);
F1
F1(z) = 
Even with simplify and "IgnoreAnalyticConstraints" being set to true, F1 is in the form "73900/3 - (z*(- 5*z^2 + 168*z + 7200))/6" instead of az^3/b + cz^2/d + ez/f + g, the fully simplified method. vpa just puts all fractions in numeric form, and eval doesn't really do anything. What am I missing, as I know that there should be some method to this simple operation of simplifying a polynomial.

Antworten (2)

Paul
Paul am 31 Jan. 2025
Bearbeitet: Paul am 1 Feb. 2025
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z - 2.5*z^2;
R = - int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = simplify(- int(Q(z), [0 z]) - R,"IgnoreAnalyticConstraints",true)
F1(z) = 
[c,t] = coeffs(F1(z),z,'all')
c = 
t = 
F1(z) = sum(c.*t)
F1(z) = 
Walter Roberson
Walter Roberson am 31 Jan. 2025
Verschoben: Walter Roberson am 31 Jan. 2025
l = 50;
a = 10;
W = 1200;
syms Q(z);
Q(z) = 1200 + 56*z - 2.5*z^2;
R = - int(Q(z), [0 l]) + W;
syms F1(z) F2(z) F3(z);
F1(z) = expand(- int(Q(z), [0 z]) - R)
F1(z) = 

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2023b

Gefragt:

am 31 Jan. 2025

Bearbeitet:

am 1 Feb. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by