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. IMG_7244.jpg
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

采纳的回答

Cameron B
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 个评论
Finlay Brierton
Finlay Brierton 2020-1-7
Also I am not looking to solve the bending moment capacity for a portal frame of variables: w, L, h, theta.
Once I require Mr, will insert the values of Mr from the steel eurocodes and the program will suggest suitable steel section based on the calculated value.
thanks
Cameron B
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 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by