Inputting known values and being able to select them depending on calculated value

2 ビュー (過去 30 日間)
Hi,
Sorry I worded this question badly beforehand.
As you can see from my screenshot and code, I have calculated the Mr (max bending moment) for a steel portal frame of dimensions (w,L,h).
Having calculated this moment I would like the programme to suggest a steel section with a suitable max bending moment resistance. A made a small example list at bottom of my coding, but I will be putting in all the sections and their corresponding bending moment resistance so I can get suggested sections for when I change the frame variables.
How can I get the program to suggest suitable section sizes for the calculated Mr?
Thanks
% program code equivalent to the graphical design method %
% as far as rafter selection %
w = 10; % w is the udl on the fram
L = 30; % L is the span of the frame
h = 6.5; % h is the height to eaves of the frame
theta = 12; % theta is the roof pitch of the frame
N = L/2 + h/tand(theta); % N is the distance from stanchion to base of reactant line where it meets the ground level
syms m
eqn = m^2/(2*w) + m*(5*N/3 - L/3) + w*L^2/8; % the derived equation from the graphical method to find gradient
M = solve(eqn,m); % solving the equation
m1 = max(double(M)); % choosing the smaller negative negative gradient (so smaller number)
Y = -(w/2)*(-m1/w).^2 + w*L^2/8; % the equation for the parabola at max bending moment (at x-bar)
R = -(m1.^2/w) - m1.*N; % the equation for the reactant at max bending moment (at x-bar)
Mr = Y - R; % (KNm) the differce in y values at x-bar gives the max bending moment in the rafter
steel sections: 406x178x67, 406x178x74, 406x178x85 % dimensions of specific steel sections (taken from steel design book)
section moment: 370, 413, 459 % Bending moment resistance for the sections labelled above (taken from steel design book)

採用された回答

Sylvain Lacaze
Sylvain Lacaze 2020 年 1 月 8 日
Hi Finlay,
You could turn pproject into a function:
Say:
function Mr = pproject(w, L, h)
% Your stuff
end
Then compute the Mr for all your cross sections:
w = [..., ..., ...];
L = [..., ..., ...];
h = [..., ..., ...];
Mr = zeros( 1, numel( w ) );
for i = 1:numel( w )
Mr(i) = pproject( w(i), L(i), h(i) );
end
And rank best on closest to target Mr:
[~, rank] = sort( abs( Mr - MrTarget ) );
disp( 'Best cross section' )
disp( rank )
You could also consider vectorizing pproject:
HTH,
Sylvain
  2 件のコメント
Finlay Brierton
Finlay Brierton 2020 年 1 月 8 日
Hi Sylvain,
Thank you very much for your answer, I have updated the question as I dont think I worded it very well intitially. I think I was asking something slightly different to what you answered.
Thanks
Sylvain Lacaze
Sylvain Lacaze 2020 年 1 月 9 日
Hi Finlay,
OK, I think I see.
So let's say you have Mr, your computed max bending moment.
Then, let's say you have a table like this:
Name = ["crossSection1"; "crossSection2"; "crossSection3"];
Resistance = [370; 413; 459];
crossSectionInfo = table( Name, Resistance );
First, sort by Resistance, to make sure you go from weakest to strongest:
crossSectionInfo = sortrows( crossSectionInfo, 'Resistance' );
Then find the find cross section with a Resistance higher than the max bending moment Mr:
bestCrossSectionIndex = find( crossSectionInfo.Resistance > Mr, 1, 'first' );
That's your cross-section:
disp( crossSectionInfo(bestCrossSectionIndex,:) )
HTH,
Sylvain

サインインしてコメントする。

その他の回答 (1 件)

Finlay Brierton
Finlay Brierton 2020 年 1 月 10 日
Sylvain,
This is exactly what I was looking for, thank you so much.
Finlay

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by