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]

采纳的回答

Walter Roberson
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(:))
ans = "(((3*s)/4 - 2*3^(1/2)*s)*((7*s)/4 - 2*3^(1/2)*s))/2250000 + ((3*s)/160 - (3^(1/2)*s)/20)^2 + (s/34 + (5*3^(1/2)*s)/272)^2 + ((7*s)/6000 - (3^(1/2)*s)/750)^2 < 1"
%solvetsaihill = solve(eqn1, s,'ReturnConditions',true)
F = lhs(eqn1) - rhs(eqn1);
bounds = vpasolve(F, -10)
bounds = 
  2 个评论
JingChong Ning
JingChong Ning 2021-12-17
Thank you for answering my question. But this requires me to know that -10 is a value close to my guess, right? Could you help me find a way to solve this if the value of all input parameter changes?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Equation Solving 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by