I get "empty syms" solution when solving inequalities
2 次查看(过去 30 天)
显示 更早的评论
I am trying to solve the following inequality. I have done similar inequality and they all worked out fine, could anyone tell me what is wrong with my setup?
syms s
ox = 2*s;
oy = -3*s;
txy = 4*s;
oxy = [ox; oy; txy];
%ultimate stresses, 1 is fiber direction 2 is matrix direction
ut1stress = 1500;
uc1stress = -1500;
ut2stress = 40;
uc2stress = -246;
ut12 = 68;
%layup angle
theta = deg2rad(60); %angle from x to 1, input degree value ,change to rad
%o1 = ox * cos(theta)^2 + oy * sin(theta)^2 + 2 * txy * sin(theta) * cos (theta)
%o2 = ox * sin(theta)^2 + oy * cos(theta)^2 - 2 * txy * sin(theta) * cos (theta)
c = cos(theta);
s = sin(theta);
%T is global to local stress
T = [c^2 s^2 2*s*c; s^2 c^2 -2*s*c; -1*s*c s*c c^2 - s^2];
o12 = T*oxy;
o1 = o12(1, 1);
o2 = o12(2, 1);
t12 = o12(3, 1);
%tsaihill needs to be less than 1
tsaihill = (o1/ut1stress)^2-((o1*o2)/(ut1stress^2))+(o2/ut2stress)^2+(t12/ut12)^2;
%check how to get less than 1
checkvalue = 1;
eqn1 = tsaihill < checkvalue;
solvetsaihill = solve(eqn1, s,'ReturnConditions',true)
solvetsaihill =
struct with fields:
s: [0×1 sym]
parameters: [1×0 sym]
conditions: [0×1 sym]
0 个评论
采纳的回答
Walter Roberson
2021-12-17
编辑:Walter Roberson
2021-12-17
syms s
ox = 2*s;
oy = -3*s;
txy = 4*s;
oxy = [ox; oy; txy];
%ultimate stresses, 1 is fiber direction 2 is matrix direction
ut1stress = 1500;
uc1stress = -1500;
ut2stress = 40;
uc2stress = -246;
ut12 = 68;
%layup angle
theta = deg2rad(60); %angle from x to 1, input degree value ,change to rad
%o1 = ox * cos(theta)^2 + oy * sin(theta)^2 + 2 * txy * sin(theta) * cos (theta)
%o2 = ox * sin(theta)^2 + oy * cos(theta)^2 - 2 * txy * sin(theta) * cos (theta)
c = cos(theta);
s = sin(theta);
%T is global to local stress
T = [c^2 s^2 2*s*c; s^2 c^2 -2*s*c; -1*s*c s*c c^2 - s^2];
o12 = T*oxy;
o1 = o12(1, 1);
o2 = o12(2, 1);
t12 = o12(3, 1);
%tsaihill needs to be less than 1
tsaihill = (o1/ut1stress)^2-((o1*o2)/(ut1stress^2))+(o2/ut2stress)^2+(t12/ut12)^2;
%check how to get less than 1
checkvalue = 1;
eqn1 = tsaihill < checkvalue;
string(eqn1(:))
%solvetsaihill = solve(eqn1, s,'ReturnConditions',true)
F = lhs(eqn1) - rhs(eqn1);
bounds = vpasolve(F, -10)
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!