× Go Back Go Back to Programming Section Menu Go Back to Home Page
CL325AASHTO_truck_going_over_simply _supported_26m_AASHTO_girder.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%               File Name: CL325AASHTO_truck_going_over_simply_supported_26m_AASHTO_girder               Written by: Koral Eren               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% CL-325 TRUCK (AASHTO) ON SINGLE BEAM L>(4.3+RearAxleSpacing or Rs), Lmax = 100 m %%%%%
 
close all;
clear all;
clc;
 
L = 26;
Rs = 4.3; % RearAxleSpacing between 4.3 m and 9 m
 
Reactions = zeros(10000, 2);
Moment = zeros(10000, 4);
Shear = zeros(10000, 5);
 
%%%%% INDEXING %%%%%
 
for i = 2:10000
    
	Moment(i, 4) = Moment(i - 1, 4) + 0.01;
	Shear(i, 5) = Shear(i - 1, 5) + 0.01;
    
end
 
%%%%% PEAK VALUES %%%%%
 
i = 1;
for x = 0:0.01:(L + 4.3 + Rs + 0.001)
    
	if (x > 0 && x <= 4.3)
    		Reactions(i, 1) = 35 * x / L;
    		Reactions(i, 2) = 35 - Reactions(i, 1);
    		Shear(i, 1) = Reactions(i, 1);
    		Shear(i, 2) = Reactions(i, 1) - 35;
    		Moment(i, 1) = Shear(i, 1) * (L - x);
	elseif (x > 4.3 && x < (4.3 + Rs + 0.001))
    		Reactions(i, 1) = 35 * x / L + 145 * (x - 4.3) / L;
    		Reactions(i, 2) = 180 - Reactions(i, 1);
    		Shear(i, 1) = Reactions(i, 1);
    		Shear(i, 2) = Reactions(i, 1) - 35;
    		Shear(i, 3) = Reactions(i, 1) - 180;
    		Moment(i, 1) = Shear(i, 1) * (L - x);
    		Moment(i, 2) = Moment(i, 1) + Shear(i, 2) * 4.3;
	elseif (x > (Rs + 4.3) && x < L)
    		Reactions(i, 1) = 35 * x / L + 145 * (x - 4.3) / L + 145 * (x - (4.3 + Rs)) / L;
    		Reactions(i, 2) = 325 - Reactions(i, 1);
    		Shear(i, 1) = Reactions(i, 1);
    		Shear(i, 2) = Reactions(i, 1) - 35;
    		Shear(i, 3) = Reactions(i, 1) - 180;
    		Shear(i, 4) = Reactions(i, 1) - 325;
    		Moment(i, 1) = Shear(i, 1) * (L - x);
    		Moment(i, 2) = Moment(i, 1) + Shear(i, 2) * 4.3;
    		Moment(i, 3) = Moment(i, 2) + Shear(i, 3) * Rs;
	elseif (x >= L && x < (L + 4.3))
    		Reactions(i, 1) = 145 * (x - 4.3) / L + 145 * (x - (4.3 + Rs)) / L;
    		Reactions(i, 2) = 290 - Reactions(i, 1);
    		Shear(i, 1) = Reactions(i, 1);
    		Shear(i, 2) = Reactions(i, 1) - 145;
    		Shear(i, 3) = Reactions(i, 1) - 290;
    		Moment(i, 1) = Shear(i, 1) * (L - x + 4.3);
    		Moment(i, 2) = Moment(i, 1) + Shear(i, 2) * Rs;
	elseif (x >= (L + 4.3) && x < (L + 4.3 + Rs))
    		Reactions(i, 1) = 145 * (x - (4.3 + Rs)) / L;
    		Reactions(i, 2) = 145 - Reactions(i, 1);
    		Shear(i, 1) = Reactions(i, 1);
    		Shear(i, 2) = Reactions(i, 1) - 145;
    		Moment(i, 1) = Shear(i, 1) * (L - x + 4.3 + Rs);
    	end
    
	i = i + 1;
    
end
 
v = zeros(L / 0.01 + 1, 1);
M = zeros(L / 0.01 + 1, 1);
y = 0:0.01:L;
 
Ve = zeros(L / 0.01 + 1, 1);
Me = zeros(L / 0.01 + 1, 1);
 
%%%%%%%%%%%%% SHEAR %%%%%%%%%%%%%%
 
i = 1;
for x = 0:0.01:0
    
    j = 1;    
    for a = 0:0.01:L
        
    	v(j) = 0;
        
        if (abs(v(j)) > abs(Ve(j)))
		Ve(j) = v(j);
        end
        
    	j = j + 1;
        
    end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end

for x = 0.01:0.01:4.3
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a <= x)
        		v(j) = - Shear(i, 2);
    		else
        		v(j) = - Shear(i, 1);
        	end
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end

for x = 4.31:0.01:(4.3 + Rs + 0.001)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a <= x - 4.3)
        		v(j) = - Shear(i, 3);
    		elseif (a <= x)
        		v(j) = - Shear(i, 2);
    		else
        		v(j) = - Shear(i, 1);
        	end
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end

for x = (4.3 + Rs + 0.01):0.01:(L - 0.01 + 0.001)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		v(j) = - Shear(i, 4);
    		elseif (a <= x - 4.3)
        		v(j) = - Shear(i, 3);
    		elseif (a <= x)
        		v(j) = - Shear(i, 2);
    		else
        		v(j) = - Shear(i, 1);
        	end
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end

for x = L:0.01:(L + 4.29)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		v(j) = - Shear(i, 3);
    		elseif (a <= x - 4.3)
        		v(j) = - Shear(i, 2);
    		else
        		v(j) = - Shear(i, 1);
        	end
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);

	i = i + 1;
    
end

for x = (L + 4.3):0.01:(L + 4.3 + Rs - 0.01 + 0.001)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		v(j) = - Shear(i, 2);
    		else
        		v(j) = - Shear(i, 1);
        	end
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end

for x = (L + 4.3 + Rs):0.01:(L + 4.3 + Rs)
    
	j = 1;
	for a = 0:0.01:L
        
    		v(j) = 0;
        
        	if (abs(v(j)) > abs(Ve(j)))
        		Ve(j) = v(j);
        	end
        
    		j = j + 1;
        
	end
    
	plot(y, v);
	xlim([0 L]);
	ylim([- 350 350]);
	axh = gca; % use current axes
	color = 'k'; % black, or [0 0 0]
	linestyle = '-'; % solid
	line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
	pause(0.01);
    
	i = i + 1;
    
end
 
%%%%%%%%%%%%%%% MOMENT %%%%%%%%%%%%%
 
i = 1;
for x = 0:0.01:0
    
	j = 1;
	for a = 0:0.01:L
        
    		M(j) = 0;
        
        	if (M(j) > Me(j))
        		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = 0.01:0.01:4.3
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a <= x)
        		M(j) = (a / x) * Moment(i, 1);
    		else
        		M(j) = (L - a) / (L - x) * Moment(i, 1);
        	end
        
        	if (M(j) > Me(j))
        		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = 4.31:0.01:(4.3 + Rs)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a <= x - 4.3)
        		M(j) = (a / (x - 4.3)) * Moment(i, 2);
    		elseif (a <= x)
        		if (Moment(i, 2) > Moment(i, 1))
            			M(j) = ((x - a) / 4.3) * (Moment(i, 2) - Moment(i, 1)) + Moment(i, 1);
        		else
            			M(j) = ((a - (x - 4.3)) / 4.3) * (Moment(i, 1) - Moment(i, 2)) + Moment(i, 2);
        		end
    		else
        		M(j) = (L - a) / (L - x) * Moment(i, 1);
        	end
        
		if (M(j) > Me(j))
			Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = (4.3 + Rs + 0.01):0.01:(L - 0.01)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		M(j) = (a / (x - (4.3 + Rs))) * Moment(i, 3);
    		elseif (a <= x - 4.3)
        		if (Moment(i, 3) > Moment(i, 2))
            			M(j) = (Rs - (a - (x - (4.3 + Rs)))) / Rs * (Moment(i, 3) - Moment(i, 2)) + Moment(i, 2);
        		else
            			M(j) = (a - (x - (4.3 + Rs))) / Rs * (Moment(i, 2) - Moment(i, 3)) + Moment(i, 3);
        		end
    		elseif (a <= x)
        		if (Moment(i, 2) > Moment(i, 1))
            			M(j) = (4.3 - (a - (x - (4.3 + Rs) + Rs))) / 4.3 * (Moment(i, 2) - Moment(i, 1)) + Moment(i, 1);
        		else
            			M(j) = (a - (x - (4.3 + Rs) + Rs)) / 4.3 * (Moment(i, 1) - Moment(i, 2)) + Moment(i, 2);
        		end
    		else
        		M(j) = (L - a) / (L - x) * Moment(i, 1);
        	end
        
        	if (M(j) > Me(j))
        		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = L:0.01:(L + 4.29)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		M(j) = (a / (x - (4.3 + Rs))) * Moment(i, 2);
    		elseif (a <= x - 4.3)
        		if (Moment(i, 2) > Moment(i, 1))
            			M(j) = (Rs - (a - (x - (4.3 + Rs)))) / Rs * (Moment(i, 2) - Moment(i, 1)) + Moment(i, 1);
        		else
            			M(j) = (a - (x - (4.3 + Rs))) / Rs * (Moment(i, 1) - Moment(i, 2)) + Moment(i, 2);
        		end
    		else
        		M(j) = ((L - (Rs + (x - (4.3 + Rs)))) - (a - (Rs + (x - (4.3 + Rs))))) / (L - (Rs + (x - (4.3 + Rs)))) * Moment(i, 1);
        	end
        
        	if (M(j) > Me(j))
        		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = (L + 4.3):0.01:(L + 4.3 + Rs - 0.01)
    
	j = 1;
	for a = 0:0.01:L
        
        	if (a < x - (4.3 + Rs + 0.001))
        		M(j) = (a / (x - (4.3 + Rs))) * Moment(i, 1);
    		else
        		M(j) = ((L - (x - (4.3 + Rs))) - (a - (x - (4.3 + Rs)))) / (L - (x - (4.3 + Rs))) * Moment(i, 1);
        	end
        
        	if (M(j) > Me(j))
        		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end

for x = (L + 4.3 + Rs):0.01:(L + 4.3 + Rs)
    
	j = 1;
	for a = 0:0.01:L
        
    		M(j) = 0;
        
        	if (M(j) > Me(j))
      	  		Me(j) = M(j);
        	end
        
    		j = j + 1;
        
    	end
    
	plot(y, M);
	xlim([0 L]);
	ylim([0 1750]);
	pause(0.01);
    
	i = i + 1;
    
end
 
subplot(2, 1, 1);
plot(y, Ve);
axh = gca; % use current axes
color = 'k'; % black, or [0 0 0]
linestyle = '-'; % solid
line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
 
subplot(2, 1, 2);
plot(y, Me);
pause(5);
 
%%%%% TRUCK MOVING FROM RIGHT TO LEFT %%%%%
 
temp1 = zeros((L / 0.01 + 1), 1);
temp2 = zeros((L / 0.01 + 1), 1);
 
for i = 1:(L / 0.01 + 1)
    
	temp1(i) = Ve(i);
	temp2(i) = Me(i);
    
end

for i = 1:(L / 0.01 + 1)
    
	Ve(i) = temp1((L / 0.01 + 1) - i + 1);
	Me(i) = temp2((L / 0.01 + 1) - i + 1);
    
end
 
subplot(2, 1, 1);
plot(y, Ve);
axh = gca; % use current axes
color = 'k'; % black, or [0 0 0]
linestyle = '-'; % solid
line(get(axh, 'XLim'), [0 0], 'Color', color, 'LineStyle', linestyle);
 
subplot(2, 1, 2);
plot(y, Me);
pause(5);
 
%%%%% COMBINED %%%%%
 
for i = 1:(L / 0.01 + 1)
    
	if (abs(temp1(i)) > abs(Ve(i)))
    		Ve(i) = abs(temp1(i));
	else
    		Ve(i) = abs(Ve(i));
    	end
    
    	if (abs(temp2(i)) > abs(Me(i)))
    		Me(i) = abs(temp2(i));
	else
    		Me(i) = abs(Me(i));
    	end
    
end
 
subplot(2, 1, 1);
plot(y, Ve);
 
subplot(2, 1, 2);
plot(y, Me);
pause(5);