How to simplify a symbolic expression in matlab

108 Views Asked by At

I solve a system of differential equations in matlab:

syms x1(t)  x2(t) x3(t);
f = 0.5;
u = @(t)(sin(2.5*t + f));
X1 = - 3*x1 + 0.2*x2 + 2*x3 + u;
X2 = -1*x1 - 1.2*x2 + 1.4*x3;
X3 = -0.4*x1 - 0.3*x3;
start_cond = [x1(0) == 0; x2(0) == 0; x3(0) == 0]; % нулевые началальные условия
eqns = [diff(x1, t) == X1, diff(x2, t) == X2, diff(x3, t) == X3];
[x1, x2, x3] = dsolve(eqns, start_cond); % - структура с решениями
s1 = simplify(expand(x1))

Outputs like this:

s1 = (2475*cos((5*t)/2)*cos(1/2))/(27280*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 3)^2 + 75984*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 3) + 46579) - (900*cos((5*t)/2)*cos(1/2))/(27280*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 2)^2 + 75984*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 2) + 46579) - (900*cos((5*t)/2)*cos(1/2))/(27280*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 1)^2 + 75984*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 1) + 46579) + (2212*cos((5*t)/2)*sin(1/2))/(27280*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 1)^2 + 75984*root(z^3 + (9*z^2)/2 + (293*z)/50 + 553/250, z, 1) + 46579) + ...

How can I simplify so that the root function disappears and the expression is very simplified? Maybe I need to solve the system in some other way? Can you please tell me

0

There are 0 best solutions below