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_group5/montecarlo_model.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20 lines (19 sloc)
773 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
%The Monte Carlo model is used in this function to determine the mean and | |
%standard deviation of the maximum beam deflection if the height and width | |
%of the beam are normally distibuted with 0.1% std deviations at a dist. load of | |
%50N/m | |
function [avg,stdev]=montecarlo_model(Load) | |
q=50; %Distributed load of 50 N/m | |
E=7*10^9; %Young's Modulus (Pa) | |
L=1; %Length (m) | |
x=0.5; %Location where max deflection occurs | |
%For loop that iterates load inputs into deflection equation | |
for i=1:Load | |
b = normrnd(0.1,0.01); | |
h = normrnd(0.01,0.001); | |
I = (b*h^3)/12; | |
w(i) =(((q*L*(x^3))/(12*E*I)))-(((q*(x^4))/(24*E*I)))-((q*(L^3)*x)/(24*E*I)); | |
end | |
avg = mean(w); %Function to find mean deflection | |
stdev = std(w); %Function to find standard deviation of deflection | |
end | |