Solving an equation and using the answer for other equations
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am trying to write some code for my thesis and am struggling to convert an equation I derived into matlab. The code relates to steel member selection for varyingnd portal fram dimensions. Y - R is the target bending capacity of the beam. I have attached my written work and attempted coding, thanks.
w = 8.37;
L = 30;
h = 6.5;
theta = 12;
N = L/2 + h/tand(theta);
syms m
eqn = m^2/2*w + m*(5*N/3 - L/3) + w*L^2/8 == 0
M = solve(eqn,m)
Y = -(w/2)*(-m/w)^2 + w*L^2/8;
R = -(m^2/w) - m*N;
Mr = Y - R
댓글 수: 0
채택된 답변
Cameron B
2020년 1월 7일
w = 8.37;
L = 30;
h = 6.5;
theta = 12;
N = L/2 + h/tand(theta);
syms m
eqn = m^2/(2*w) + m*(5*N/3 - L/3) + w*L^2/8;
M = solve(eqn,m);
m1 = double(M);
Y = -(w/2)*(-m1/w).^2 + w*L^2/8;
R = -(m1.^2/w) - m1.*N;
Mr = Y - R
This gives both roots of m and gives Mr = 294.8667 and 22178.87.
댓글 수: 3
Cameron B
2020년 1월 7일
format longG %formats your answer how you want it
If you want the smallest room of m, then there are two ways of thinking about it. The first is picking the smallest of the two numbers which would be:
m1 = min(double(M));
However, the above line is biased towards negative values. If you wanted the smallest absolute value of the two, you would do this:
m1 = min(abs(double(M)));
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!