Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
me3255_finalproject_group29/plotter_1_a.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (33 sloc)
1008 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Problem 1, a | |
% Plot q vs the maximum deflection of the beam. | |
% Set text size for plotting. | |
clear | |
clc | |
setdefaults | |
% x is a vector of the length of the beam [meters]. | |
x = 0:0.01:1; | |
% Define load as a vector | |
q = 0:10000; | |
% Plot the deflection against the location when x is a vector from 0 to 1. | |
% This plot will be used to identify the x position of the maximum | |
% deflection. | |
w = shape_simple_support(x,100); | |
figure; | |
plot(x,w); | |
title('Beam Deflection vs. Horizontal Distance'); | |
xlabel('x [m]'); | |
ylabel('w [m]'); | |
% Looking at the previous plot, it is evident that the max deflection | |
% occurs in the center of the beam: | |
x_max = 0.5; | |
for i = 1:10001 | |
% The max deflection is a function of the position where the max | |
% deflection is located (middle of the beam) and the distributed load. | |
w_max(i) = shape_simple_support(x_max,q(i)); | |
end | |
% Plot q vs the maximum deflection. | |
figure; | |
plot(w_max,q); | |
title('Distributed Beam Loading vs. Maximum Deflection'); | |
xlabel('\delta_{x} [m]'); | |
ylabel('q [N/m]'); |