-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholdeq.m
34 lines (33 loc) · 1.29 KB
/
oldeq.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function [max_M,BMD] = calc_BMD(left_sup, right_sup, loading, cur_pos, list_x)
% get SFD from given parameters; max shear is irrelevant here
[irrelevant, SFD]=calcSFD(left_sup, right_sup, loading, cur_pos, list_x);
% integrates SFD using trapezoid approx.
BMD=cumtrapz(SFD);
% create absolute value of BMD to find max moment
abs_BMD = abs(BMD);
max_M = max(abs_BMD);
end
function [max_V,SFD] = calc_SFD(left_sup, right_sup, loading, pos_list, list_x)
% set entire SFD to left_sup force
SFD = ones(1,length(list_x)).*left_sup;
% keeping track of current values
max_V = left_sup;
cur_V = left_sup;
load_num = 1;
% iterate through the positions of loading
for cur_pos = pos_list
% changes current shear from corresponding value in load list
cur_V = cur_V-loading(load_num);
% updates so next load is applied
load_num = load_num + 1;
% changes all SFD values after current position to new shear
SFD(cur_pos+1:length(SFD)) = cur_V;
% +1 to account for the zero; x=1200 has position of 1201 in vector
% checks for new max shear
if abs(cur_V) > abs(max_V)
max_V = cur_V;
end
end
% finishes SFD with the right support
SFD(length(SFD)) = SFD(length(SFD))+right_sup;
end