Homework 1 - EGM 3344 Sorting Number: 190 Problem Set: 1...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
EGM 3344 Sorting Number: 190 Problem Set: 1 Problems completed: 1.4b, 1.8, 2.2, 2.3, 2.5, 2.7, 2.8, 2.14, 3.1, 3.5, 3.9, 3.10, 3.12, 3.13, 3.16, 3.19
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 1.8 Code and Solution: %Problem 1.8 A = 1200; Q = 500; dt = 0.5; t = [0:dt:10]'; npts = length(t); y = zeros(npts,1); %for loop using a counter i for i = 2:npts dydtold = 3*(Q/A)*sin(t(i-1,1))^2 - (Q/A); y(i,1) = y(i-1,1) + dydtold*dt; end %Plot t versus y plot(t,y, 's-' ) 0 2 4 6 8 10 -0.5 0 0.5 1 1.5 2 2.5
Background image of page 2
Problem 2.2 Code and Solution: %Problem 2.2 %Provide values of z from -4 to 4 in increments of 1 z = (-4:0.1:4)'; f = (1/(sqrt(2*pi)))*(exp((-z.^2)/2)); %Plot f as a function of v plot(z,f) %Label the ordinate as frequency and the abscissa as z ylabel( 'frequency' ) xlabel( 'z' ) -4 -3 -2 -1 0 1 2 3 4 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 frequency z
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 2.3 Code and Solution: %Problem 2.3 %Use linspace function to create vectors identical to t=5:6:30 linspace(5,29,5) %Use linspace function to create vectors identical to x=-3:4 linspace(-3,4,8) ans = 5 11 17 23 29 ans = -3 -2 -1 0 1 2 3 4
Background image of page 4
Problem 2.5 Code and Solution: %Problem 2.5 F = [11 12 15 9 12]; x = [0.013 0.020 0.009 0.010 0.012]; %Hooke's Law where k is the spring constant (N/m) %F is the force (N), and x is the displacement (m) k = F./x %Potential energy stored in the spring (J) U = (1/2)*k.*(x.^2) %Finds max Potential energy maxU = max(U) k = 1.0e+003 * 0.8462 0.6000 1.6667 0.9000 1.0000 U = 0.0715 0.1200 0.0675 0.0450 0.0720 maxU = 0.1200
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 2.7 Code and Solution: %Problem 2.7 %Matrix of values where each row represents one channel and each %column represents one of the parameters Values = [0.035 0.0001 10 2; 0.020 0.0002 8 1; 0.015 0.0010 19 1.5; 0.030 0.0008 24 3; 0.022 0.0003 15 2.5]; %Assigns the first column of the matrix to the vaiable n n = Values(1:5,1); %Assigns the second column of the matrix to the vaiable S S = Values(1:5,2); %Assigns the third column of the matrix to the vaiable B B = Values(1:5,3); %Assigns the fourth column of the matrix to the vaiable H H = Values(1:5,4); %Manning's equation where U is velocity(m/s), S is channel slope %n is roughness coefficient, B is width(m), and H is depth (m) U = (sqrt(S)./n).*(((B.*H)./(B + 2*H)).^(2/3)) U = 0.3624 0.6094 2.5053 1.6900 1.1971
Background image of page 6
Problem 2.8 Code and Solution:
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

Homework 1 - EGM 3344 Sorting Number: 190 Problem Set: 1...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online