Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

u u Question 2: Vibrating Membrane In this problem you will examine the natural modes of vibration of a rectangular membrane of length a and

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
u u Question 2: Vibrating Membrane In this problem you will examine the natural modes of vibration of a rectangular membrane of length a and width [7. fixed along all four edges. Vibrating plates or membranes are commonly encountered in various fields such as structural engineering. mechanical engineering and acoustics. Understanding their mode shapes is crucial for analyzing their behavior and resonance frequencies. Assuming the membrane obeys the two-dimenional wave equation, the (normalized) amplitude f of the (m, it) natural mode of vibration is isms): where x and y are coordinates along the membrane and m and n are positive integer mode indices. f(x,y,a,b;m,n) = sin(x Question 2.0 mil" (1 Writeatunction modeishape(x,y,a,b,m,n) which takes in: 'x: float or np. ndarray x coordinates along the membrane, x E (O, a) : float or np.ndarray y coordinates along the membrane. y E (0, b) : float membrane length. a > 0 : float membrane width, b > O : int mode index along x, m = 1, 2, 3, : int mode index along y, n = 1,2,3, and returns the mode amplitude f(x, y, a, b ; m, n) shown in Eq._(i_ at each point defined by x and y . Once you are done, test your modeishape function for x assign it to the variable q2_0 . # ANSWER CELL # TEST YOUR FUNCTION HERE q2_0 np.linspace(0, 1) ,y np.linspace(0,1) . a : 1 , b 1 . m 1,n 1 and (3) Question 2.1 Let us now compute the m = 3, n = 2 natural mode of vibration for a membrane of length a = 3 and width b = 2 on a discrete two-dimensional grid. To this end, first create two linear ranges of 1000 equally spaced points each for the x and y coordinates, named x and y , respectively. Then, define combined two-dimensional coordinate arrays X and Y for each point on the grid. The documentation of gpmteshgm may be helpful. Finally, using your mode_shape function. compute the mode amplitude on the LIE grid and assign the output array to the variable Z . In In In # ANSWER CELL a? Length a = # Width b = ... 9'? Parameter m m: ... 9'? Parameter n n= ... 51' Create x and yranges x= y= 9? Create combined X and Y grid X,Y= # Compute Z z = modeishapetx,Y,a,b,m,n) # Do not modify and run this cell for grading purposes x_q2_1 = np.copy(x} Y_q2_1 = nP-COPY(Yl X_q2_1 = np.copy(X} Y7q271 = np.copy(Y} ziq271 = np.copy(Z} grader.check( "q2 . 1 "i Question 2.2 Visualize the membrane's natural mode of vibration computed in Question 2.1 by creating a surface plot of Z on the X, Y grid. The documentation of pit. plot_surface may be helpful. Create a matplotlib. pyplot figure stored in fig_2 and perform the following tasks on the same figure: Create a surface plot of the natural mode shape for a = m = 3 and b = n = 2, i.e. z vs. x and Y . . Set the surface colormap to plasma . Set the figure title to "Natural mode shape for m = 3, n = 2" with font size 14. Set the x-axis label to "X" with font size 12. Set the y-axis label to "Y" with font size 12. Set the y-axis label to "Z" with font size 12. Adjust the plot to have equal axis aspect ratios, refer to the documentation. . Adjust the viewing distance if some of the labels are clipped from the figure. Take a look at the zoom argument of set box axpect. When you are finished, your figure should look like Figure 3. Feel free to experiment with plotting options that have not been explicitly specified. Natural mode shape for m = 3, n = 2 1.0 0.5 0.0 +-0.5 -1.0 2.5 2.0 1.5 0.0 0.5 1.0 1.0 0.5 Y 1.5 2 X 0.0 2.0 2.5 3.0 -0.5 Figure 3. Question 2.2 plot. 1: # ANSWER CELL # Create figure fig_2 = . . . # Create axes with 3d projection ax = . # Plot surface # Set title # Set labels . . .Question 2.3 Create another set of two-dimensional coordinate grids X and Y of 1000 equally spaced points in each direction for a square membrane of unit length a = b = 1. Then, create a matplotlib . pyplot figure stored in fig_3 and perform the following tasks on the same figure: Create a 2x2 subplot layout and plot the membrane mode shape for m, n = 1, 2. Store the subplot axes in the variable axs . The subplot in the m-th row and n-th column should contain the mode shape for the respective m and n values. For example, the subplot in the lower left (row 2, column 1) should contain the plot for m = 2 and n = 1. Set the figure title (suptitle) to "Mode shapes" with font size 16. For each plot do the following: Set the surface colormap to coolwarm Set the subplot title "m = {m), n = {n)" where you insert the appropriate value in the braces. See Figure 4 for reference. . Set the x-axis label to "X" . Set the y-axis label to "Y". . Set the y-axis label to "Z". Adjust the viewing distance if some of the labels are clipped from the subplot. Take a look at the zoom argument of set box axpect. When you are finished, your figure should look like Figure 4. Feel free to experiment with plotting options that have not been explicitly specified. Mode shapes m = 1, n = 1 m = 1, n = 2 0.8 0.5 0.6 Z Z 0.0 0.4 0.2 -0.5 0.0 0.6 0.00.20.40.60.810 9.4 X 9.2 0.00.20.40.60.8 1.0 0.2 X m = 2, n = 1 m = 2, n = 2 0.5 0.5 Z Z 0.0 0.0 -0.5 -0.5 D.8.0 y 0.00.20.40.60.810 0.00.2 0.40.6 0.81.0 NO X x Figure 4. Question 2.3 plot.] : # ANSWER CELL # Do not modify this line for grading purposes import matplotlib. pyplot as plt # Create x and y 10 grids X = y= # Create combined x and y 2D grid X, Y = . . . # Create figure of 2x2 3D subplots fig_3, axs = . . . # Plot mode shape on each subplot # Set figure title pit . show ( ): # Do not modify and run this cell for grading purposes x_q2_3 = np. copy (x) y_q2_3 = np. copy (y) X_q2_3 = np. copy (X) Y_q2_3 = np. copy (Y) : grader . check("q2.3")

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

University Physics Volume 1

Authors: William Moebs, Samuel J. Ling, Jeff Sanny

1st Edition

168092043X, 9781680920437

More Books

Students also viewed these Physics questions