필터 지우기
필터 지우기

I get "empty syms" solution when solving inequalities

조회 수: 2 (최근 30일)
JingChong Ning
JingChong Ning 2021년 12월 17일
댓글: Walter Roberson 2021년 12월 17일
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