Algebraic Equation Solver with Unwanted Solutions

1 次查看(过去 30 天)
Im trying to solve this 2 equations but I get an output with 4 diferents solutions when I need just 1 for each variable
m = 14.8; % mass of solar panel in Kg
t = 5; % time of deployment in seconds
Theta = 1.5708; % displacement of mechanism in radians
r = 0.909; % radius of the rotational trajectory
I = (1/3)*m*(r^2); % mass moment of inertia
Alpha = (2*Theta)/t^2;
T = Alpha*I; % torque
E = 207000000000; % N/m^2
Di = (0.007*1.1);
n = 0.25;
N = 4.25;
k = T/n;
syms Dm d
eqn1 = Dm == Di + d;
eqn2 = k == (d^4*E)/(10.8*N*Dm);
solution = solve([eqn1,eqn2] , [Dm,d]);
DmSol = double((solution.Dm))
dSol = double((solution.d))
Can someone explain me the error?

回答(1 个)

Walter Roberson
Walter Roberson 2021-3-21
eqn2 = k == (d^4*E)/(10.8*N*Dm);
You have a polynomial in d^4. It is going to have 4 solutions.
You can filter out complex values by adding 'real', true option to solve(). But that will still give you an even number of solutions.

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by