Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I really need some help with this MATLAB assignment. Problem 1 (Cantilever beam with point-load): The deflection of a cantilevered beam with a point load

image text in transcribedimage text in transcribed

I really need some help with this MATLAB assignment.

Problem 1 (Cantilever beam with point-load): The deflection of a cantilevered beam with a point load is y=-x (3a x) , 0sxsa =-Wa (3x-a) , asxsl where E = Young's Modulus (psi) I= moment of inertia (in 4) L = Length (in) a = location of point load (in) W = load (lbf) Objectives We wish to study the deflection as function of x for a given set of system parameters. To accomplish this task, we will create three separate M-files (one main program and two functions). M-file 1 This function M-file should generate a plot of y versus x for a single loading. Indicate the location of the point load on your graph with a triangular symbol (*v). The function plots y from x=0 to a first and then plots y from x=a to L. In other words, there should be two calls for fplot and a single call for ploto (indicating the location of the loading). Hint: Declare two anonymous functions y_1 and y_2 and plot for x=0 to a, and x=a to L respectively. function BeamCant Point a (E,I,L, a,W) M-file 2 This function M-file should generate a plot of y versus x for a single loading. Indicate the location of the point load on your graph with a triangular symbol (*v*). The function plots y from x=0 to L using a single call of fploto. In other words, there should be one call for fplot() and a single call for plot (indicating the location of the loading). Hint: Declare two anonymous functions y_1 and y_2. Using the heaviside built-in function, declare an anonymous function y based on y_1, y_2 and heaviside(). This function y gives the beam displacement x=0 to L. function BeamCant Point (E,I,L, a,W) M-file 3 This script M-file is a driver (main) program that performs the following tasks: 1. Specify the input parameters E, I,L,W, and the loading position a. 2. Repeatedly call the function BeamCantPoint_a' to create a single graph for a = 0 to 10 in with increments of 2 in. Use a for loop (hint: the built-in function length() might be useful). Plot to figure 1. 3. Repeatedly call the function 'BeamCant Point b' to create a single graph for a = 0 to 10 in with increments of 2 in. Use a "for" loop and plot to figure 2. Use the following parameters This M-file should be named 'BeamCantPointStudy'. E = 30*10^6; & psi I = 0.163; % in 4 L = 10; & in W = 1000; 8 lb Problem 2 (Flow speed in inclined pipe-revisted) Manning's equation gives the flow speed U (m/s) of water in a rectangular downward sloping pipe: VS U= BH 2/3 nB + 2H) 10 where S is the pipe slope, n is the pipe roughness, B(m) is the pipe width and H(m) is the pipe height. S B(m) H(m) 0.036 0.0001 0.020 0.0002 0.015 0.0012 0.030 0.0007 0.022 0.0003 2.6 8 1.5 a) Enter the above data into an excel spread-sheet (include column headers). b) Using xlsread, load the data into an array n SBH U. c) Write and call a function (M-file #1) in your main program (M-file #2) which calculates the flow speed via Manning's equation. This function should be one line of executable and not contain any loops! The function (M-file #1) must be declared via: function (U_vector]=manning_flow_speed (n_S_B_H_U_matrix) d) Store the calculated speed in the last column of the array n_S_B_H_U and print the resulting array to the command line in tabular form using fprintf(). Note, the printed table must include a header followed by a single line, data then followed by a single line. Hint: A similar type header might be created via fprintf(1, 'y(m) \t\t t(s) ') followed by fprintf(1,' '). e) Create a text-file (using Notepad) containing only the numerical data, read the data using load and repeat the above. You will have two programs, one using xlsread() and the other using load. Hint: In Notepad columns are created by using a tab between data values. Problem 1 (Cantilever beam with point-load): The deflection of a cantilevered beam with a point load is y=-x (3a x) , 0sxsa =-Wa (3x-a) , asxsl where E = Young's Modulus (psi) I= moment of inertia (in 4) L = Length (in) a = location of point load (in) W = load (lbf) Objectives We wish to study the deflection as function of x for a given set of system parameters. To accomplish this task, we will create three separate M-files (one main program and two functions). M-file 1 This function M-file should generate a plot of y versus x for a single loading. Indicate the location of the point load on your graph with a triangular symbol (*v). The function plots y from x=0 to a first and then plots y from x=a to L. In other words, there should be two calls for fplot and a single call for ploto (indicating the location of the loading). Hint: Declare two anonymous functions y_1 and y_2 and plot for x=0 to a, and x=a to L respectively. function BeamCant Point a (E,I,L, a,W) M-file 2 This function M-file should generate a plot of y versus x for a single loading. Indicate the location of the point load on your graph with a triangular symbol (*v*). The function plots y from x=0 to L using a single call of fploto. In other words, there should be one call for fplot() and a single call for plot (indicating the location of the loading). Hint: Declare two anonymous functions y_1 and y_2. Using the heaviside built-in function, declare an anonymous function y based on y_1, y_2 and heaviside(). This function y gives the beam displacement x=0 to L. function BeamCant Point (E,I,L, a,W) M-file 3 This script M-file is a driver (main) program that performs the following tasks: 1. Specify the input parameters E, I,L,W, and the loading position a. 2. Repeatedly call the function BeamCantPoint_a' to create a single graph for a = 0 to 10 in with increments of 2 in. Use a for loop (hint: the built-in function length() might be useful). Plot to figure 1. 3. Repeatedly call the function 'BeamCant Point b' to create a single graph for a = 0 to 10 in with increments of 2 in. Use a "for" loop and plot to figure 2. Use the following parameters This M-file should be named 'BeamCantPointStudy'. E = 30*10^6; & psi I = 0.163; % in 4 L = 10; & in W = 1000; 8 lb Problem 2 (Flow speed in inclined pipe-revisted) Manning's equation gives the flow speed U (m/s) of water in a rectangular downward sloping pipe: VS U= BH 2/3 nB + 2H) 10 where S is the pipe slope, n is the pipe roughness, B(m) is the pipe width and H(m) is the pipe height. S B(m) H(m) 0.036 0.0001 0.020 0.0002 0.015 0.0012 0.030 0.0007 0.022 0.0003 2.6 8 1.5 a) Enter the above data into an excel spread-sheet (include column headers). b) Using xlsread, load the data into an array n SBH U. c) Write and call a function (M-file #1) in your main program (M-file #2) which calculates the flow speed via Manning's equation. This function should be one line of executable and not contain any loops! The function (M-file #1) must be declared via: function (U_vector]=manning_flow_speed (n_S_B_H_U_matrix) d) Store the calculated speed in the last column of the array n_S_B_H_U and print the resulting array to the command line in tabular form using fprintf(). Note, the printed table must include a header followed by a single line, data then followed by a single line. Hint: A similar type header might be created via fprintf(1, 'y(m) \t\t t(s) ') followed by fprintf(1,' '). e) Create a text-file (using Notepad) containing only the numerical data, read the data using load and repeat the above. You will have two programs, one using xlsread() and the other using load. Hint: In Notepad columns are created by using a tab between data values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions