0% found this document useful (0 votes)
2 views

Computer Project (2)

This report details the creation of a numerical integration and plotting routine for analyzing beam mechanics under distributed loading, focusing on shear force and bending moment diagrams. The program, developed using MatLab and the forward Euler method, calculates these values based on user-defined beam length and distributed load. The final output includes three plots visualizing the distributed load, shear force, and bending moment across the beam.

Uploaded by

peacekeeper2024
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer Project (2)

This report details the creation of a numerical integration and plotting routine for analyzing beam mechanics under distributed loading, focusing on shear force and bending moment diagrams. The program, developed using MatLab and the forward Euler method, calculates these values based on user-defined beam length and distributed load. The final output includes three plots visualizing the distributed load, shear force, and bending moment across the beam.

Uploaded by

peacekeeper2024
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Computer Project

EGR 246
12/1/2024
TCC

Edwin Martinez
This report documents the development and implementation of a
numerical integration and plotting routine tailored to analyze
beam mechanics under distributed loading. The main objectives
include calculating the shear force and bending moment
diagrams, which are essential for structural analysis.

To start, chatGPT was utilized to write the programming and


troubleshoot the MatLab code. This program uses matlab's
plotting functionality. First, the program prompts the user for
length and stores the value. Next, all arrays are defined. The
integration method used is called the forward euler method. In
simple terms it takes small steps using the current information to
figure out where to go next. This works really well because it's a
step by step numerical method and computers are amazing at
running a routine over and over. After that routine is done 3
plots are defined and filled with all data. Program end

A more in depth analysis of the integration method. The value V


and M are arrays that represent shear and bending respectively.
It then uses a differential equation that relates shear and
distributed. So the rate of change for the shear force is equal to
the negative of the distributed load. This also uses matlab's
integration function. This calculates shear force. The next
equation for bending relates bending and makes it equal to shear
force and integrates on an interval X/2.
%Edwin Martinez
%egr 246
%December 1st 2024
clc;
clear;
L = input('Enter the length of the beam (L) in meters: ');
% Define the distributed load function
x = linspace(0, L, 21); % Discretize x into 21 points (increments of L/20)
w = 60 * (1 + sin(pi * x / (1.2 * L))); % Distributed load in kN/m
V = zeros(1, length(x)); % Shear Force
M = zeros(1, length(x)); % Bending Moment
% Calculate Shear Force and Bending Moment
dx = x(2) - x(1); % Incremental step size
for i = 2:length(x)
% Integrate distributed load for Shear Force
V(i) = V(i-1) - w(i-1) * dx;
% Integrate Shear Force for Bending Moment
M(i) = M(i-1) - V(i-1) * dx;
end
Figure;
Z = M*-1
% (a) Distributed Load Profile
subplot(3, 1, 1);
plot(x, w, 'b', 'LineWidth', 1.5);
grid on;
title('Distributed Load Profile (w)');
xlabel('x (m)');
ylabel('w (kN/m)');
% (b) Shear Force Diagram
subplot(3, 1, 2);
plot(x, V, 'r', 'LineWidth', 1.5);
grid on;
title('Shear Force Diagram (V)');
xlabel('x (m)');
ylabel('V (kN)');
% (c) Bending Moment Diagram
subplot(3, 1, 3);
plot(x, Z, 'g', 'LineWidth', 1.5);
grid on;
title('Bending Moment Diagram (M)');
xlabel('x (m)');
ylabel('M (kN·m)');
disp('Plots for Distributed Load, Shear Force, and Bending Moment are
displayed.');
To conclude, finding the shear, load distribution, and bending
diagrams can be very simple using programs like matlab. With
useful integration techniques and plots you can get a very good
plot of data showing exactly the forces applied at different
lengths .

You might also like