Here is a part of an ingenious function for storing shear force on a beam, in an array.
- juamalavermo
- 30 sept 2020
- 1 Min. de lectura
Actualizado: 11 feb 2024
This is a code implemented in Matlab, it is part of a group of 15 functions that I created to solve a problem of calculation of beams, particularly solid and bored axes. This function is for the treatment of the vector of shear forces, through a numerical integration by the triangle method of the elastic equation with main inputs, the distributed loads and the point forces.
All the functions and the example program are in a toolbox available for download in Matlab.
Function definition:
function [Q, V] = cortante (l, f, q, qt, qt2)
k = 1000; % Number of sample points
Long = l(length(l))*k;
Q = zeros(1,Long+1); %vector of distributed loads
Qaux = zeros(1,Long+1); %vector of distributed load with slopes
i=0; j=0; last=0; % i: counter of pointst, j: counter of critical points, last: final valueCycle to fill the shear force vector:
while i<Long
if i==l(j+1)*k %Rutine to evaluate when program found a critical point
j = j+1;
last = Qaux(i+1);
end
if qt(j+1) < qt(j)
m = (qt(j+1)-qt(j))/(l(j+1)-l(j)); % slope of distributed load
Qaux(i+2) = m*((i/k)-l(j)); %Qaux is a rect line
elseif qt2(j+1) > qt2(j)
m2 = (qt2(j+1)-qt2(j))/(l(j+1)-l(j));
Qaux(i+2) = last + m2*((i/k)-l(j));
else
Qaux(i+2) = 0; %if there isn't slope, then save vector
end
Q(i+2) = q(j);
i = i+1;
end


Comentarios