Presentation is loading. Please wait.

Presentation is loading. Please wait.

From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration.

Similar presentations


Presentation on theme: "From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration."— Presentation transcript:

1 From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration magnitude is 1.2 and phase angle is -42 o. Write the MATLAB code to plot the graph of the vibration signal. Graph Plotting: Graph Plotting Example 7: Given:  =0.36 ω 0 =24*2*π (rad/s) A=1.2 Φ=-42*π/180 (rad)=-0.73 rad ω 0 =150.796 rad/s ω -σ-σ α

2 Graph Plotting: clc;clear t=0:0.002:0.1155; yt=1.2*exp(-54.3*t).*cos(140.7*t+0.73); plot(t,yt) xlabel(‘Time (s)'); ylabel(‘Displacement (mm)'); Time (s) Displacement (mm)

3 Roots of a polynomial: Find the roots of the polynomial. with Matlab >> p=[3 0 5 6 -20] >> roots(p) ans = -1.5495 0.1829 + 1.8977i 0.1829 - 1.8977i 1.1838 >>ezplot('3*t^4+5*t^2+6*t-20',-2,2)

4 Newton-Raphson Example: Solution of nonlinear equations: The time-dependent locations of two cars denoted by A and B are given as At which time t, two cars meet?

5 Newton-Raphson Example: Solutions of system of nonlinear equations: ANSWER t=0.713 s t=2.198 s Using roots command in MATLAB a=[ 1 -1 -4 3]; roots(a) clc;clear t=solve('t^3-t^2-4*t+3=0'); vpa(t,6) Alternative Solutions with MATLAB clc, clear x=1;xe=0.001*x; niter=20; %---------------------------------------------- for n=1:niter %---------------------------------------------- f=x^3-x^2-4*x+3; df=3*x^2-2*x-4; %---------------------------------------------- x1=x x=x1-f/df if abs(x-x1)<xe kerr=0;break end kerr,x

6 Solution of system of nonlinear equations : How do you find x and y values, which satisfy the equations? x=0.6786 y=0.3885 with Matlab: >>[x,y]=solve('sin(2*x)+y^3=3*x-1','x^2+y=1-y^2') x=0.6786, y=0.3885 clc, clear x=[1 1]; xe=[0.01 0.01]; niter1= 5; niter2=50; fe=transpose(abs(fe));kerr=1; for n=1:niter2 x %-----Error equations------------------------ a(1,1)=2*cos(2*x(1))-3;a(1,2)=3*x(2)^2; a(2,1)=2*x(1);a(2,2)=2*x(2)+1; b(1)=-(sin(2*x(1))+x(2)^3-3*x(1)+1); b(2)=-(x(1)^2+x(2)^2+x(2)-1); %------------------------------------------------------- bb=transpose(b);eps=inv(a)*bb;x=x+transpose(eps); if n>niter1 if abs(eps)<xe kerr=0; break else display ('Roots are not found') end

7 Solution of system of nonlinear equations: How do you calculate a and b, which satisfy given equations by computer? With Matlab >>[a,b]=solve('3*(a^2-1)+2*b^2=11','2*a^3+(b-1)^2=16') Matlab gives all possible solutions clc, clear x=[1 1]; xe=[0.01 0.01]; niter1= 5; niter2=50; fe=transpose(abs(fe));kerr=1; for n=1:niter2 x %-----Error equations------------------------ a(1,1)=6*x(1);a(1,2)=4*x(2); a(2,1)=6*x(1)^2;a(2,2)=2*(x(2)-1); b(1)=-(3*(x(1)^2-1)+2*x(2)^2-11); b(2)=-(2*x(1)^3+(x(2)-1)^2-16); %------------------------------------------------------- bb=transpose(b);eps=inv(a)*bb;x=x+transpose(eps); if n>niter1 if abs(eps)<xe kerr=0; break else display ('Roots are not found') end

8 Lagrange Interpolation: Example: The temperature (T) of a medical cement increases continuously as the solidification time (t) increases. The change in the cement temperature was measured at specific instants and the measured temperature values are given in the table. Find the cement temperature at t=36 (sec).

9 Lagrange Interpolation: Example: The buckling tests were performed in order to find the critical buckling loads of a clamped-pinned steel beams having different thicknesses. The critical buckling loads obtained from the experiments are given in the table. Find the critical buckling load P cr (N) of a steel beam with 0.8 mm thickness. Thickness (t) (mm) Buckling Load P cr (N) 0.530 0.635 0.6537 0.7346 0.958 0.8 mm P cr

10 Lagrange Interpolation: Thickness (t) (mm) Buckling Load P cr (N) 0.530 0.635 0.6537 0.7346 0.958 0.8 mm clc;clear t=[0.5 0.6 0.65 0.73 0.9]; P=[30 35 37 46 58]; interp1(t,P,0.8,'spline') P cr 0.5,30 0.6,35 0.65,37 0.73,46 0.9,58 data.txt clc;clear v=load ('c:\saha\data.txt') interp1(v(:,1),v(:,2),8,'spline') 1. Lagrange Interpolation with Matlab 2. Lagrange Interpolation with Matlab

11 The pressure values of a fluid flowing in a pipe are given in the table for different locations. Find the pressure value for 5 m. a) Lagrange interpolation (manually) a) with computer Location (m)3810 Pressure (atm)76.26 a) with Lagrange interpolation b) For computer solution, the MATLAB code is given as clc;clear x=[3 8 10]; P=[7 6.2 6]; interp1(x,P,5,'spline') Lagrange Interpolation:

12 The x and y coordinates of three points on the screen, which were clicked by a CAD user are given in the figure. Find the y value of the curve obtained from these points at x=50. xy 25-10 4020 705 b) How do you find the answer manually? Result: 26.111 a)How do you find the answer with computer? clc;clear x=[25 40 70]; y=[-10 20 5]; interp1(x,y,50,'spline') Lagrange Interpolation:

13 Simpson’s Rule: Example: Calculate the volume of the 3 meter long beam whose cross section is given in the figure. kxy(x) 000.5 10.20.597 20.40.6864 30.60.7663 40.80.8356 51.00.8944 61.20.9432 >>syms x; area=int((x+1)/(sqrt(x^2+4)),0,1.2);vpa(area,5) Solution with Matlab: Area=0.9012

14 Simpson’s Rule: Calculate the integral with; a) Trapezoidal rule b) Simpson’s rule c) Using MATLAB, take n=4. a) Trapezoidal rule: Divide into for equal sections between 0.5 and 1. kθf 00.50.6205 10.6250.6411 20.750.6337 30.8750.5996 410.5403

15 Simpson’s Rule: b) Simpson’s rule: using Matlab >>syms tet >>I=int(sqrt(tet)*cos(tet),0.5,1);vpa(I,5) I=0.30796

16 Lagrange Interpolation + Simpson’s Rule: For a steel plate weighing 10 N and has a thickness 3 mm, the the coordinates of some points shown in the figure were measured (in cm) by a Coordinate Measuring Machine (CMM). How do you calculate the intensity of the steel by fitting a curve, which passes through these points. ? a) Manual calculation: The volume of the part is calculated by using its surface area and 0.3 cm thickness value. The simpson’s rule is used for area calculation. The x axis must be divided in equal segments in this method. Since the points are not equally spaced on the x axis, the necessary y values should be calculated at suitable x values. xy 05 2.57.8 3.79.3 410 If we divide the interval 0-4 into four equal sections using the increment ∆x=1, we can obtain the y values for x=1, x=2 and x=3. Example:

17 Lagrange Interpolation + Simpson’s Rule: xy 05 16.763 27.4969 38.2323 410

18 Lagrange Interpolation + Simpson’s Rule: b) With computer: For calculation with computer, MATLAB code is arranged to find the y values for x=1, x=2 and x=3 and the code Lagr.I is run. The area of the plate can be calculated by using Simpson’s rule. Then, the density of the steel can be calculated as mentioned before. clc;clear x=[0 2.5 3.7 4]; y=[5 7.8 9.3 10]; interp1(x,y,1,'spline') interp1(x,y,2,'spline') interp1(x,y,3,'spline')

19 Simpson’s Rule: -1.4 4.2i Example: Calculate the integral of the given function.

20 kθM(θ) 000.4249 10.3742-1.4592 20.7484-0.1476 31.12260.5119 41.49680.0512 51.8710-0.1796 62.2452-0.0178 72.61940.0630 82.99360.0062 93.3678-0.0221 103.7420-0.0021 114.11620.0078 124.490.000744 Solution with Matlab: >>clc;clear; >> syms teta >>f=2.5*exp(-1.4*teta)*cos(4.2*teta+1.4) >>y=int(f,0,4.49) >>vpa(y,5) I=-0.4966 Simpson’s Rule:

21 Example: Simpson’s Rule: kθM2(θ)M2(θ) 000.1806 10.37422.1293 20.74840.0218 31.12260.2621 41.49680.0026 51.87100.0323 62.24520.000316 72.61940.0040 82.99363.81x10 -5 93.36784.88x10 -4 103.74204.598x10 -6 114.11626.013x10 -5 124.495.541x10 -7

22 Simpson’s Rule: Solution with Matlab: We must increase the number of sections! >>clc;clear; >> syms teta >>f=(2.5*exp(-1.4*teta)*cos(4.2*teta+1.4))^2 >>y=int(f,0,4.49) >>vpa(y,5) I=0.898

23 Simpson’s Rule: A stationary car starts to move with the acceleration given below Find the speed of the car at the end of 10 seconds a)Manually b)With computer a) ktf 001 12.50.40216 250.0753 37.50.2358 4100.18178 b) With computer using Matlab >>syms t >>I=int((1+sin(t)^3)/sqrt(t^2+1),0,10);vpa(I,5)

24 Simpson’s Rule: Find the intersection area of the curves y=x 2 +2 ile y=3x. Roots kxf 010 11.250.1875 21.50.25 31.750.1875 420 using Matlab >>syms x >>I=int(3*x-x^2-2,1,2);vpa(I,5) >> roots([1 -3 2])

25 System of linear equations: How do you calculate u,w and z with computer? With Matlab clc;clear a=[-1 1 -3;0 3 -6;1 1 1]; b=[9;12;5]; c=inv(a)*b

26 System of linear equations: As a result of the equilibrium conditions, the equations given below are obtained for a truss system. How do you calculate the member forces F JD, F FD, F CD and F FC if F CK =6.157 kN and F CB =-3.888 kN are known? A b F

27 System of linear equations: A b F with Matlab clc;clear A=[-1 -0.707 -0.894 0;0 -0.707 -1 0;3 0 0 2.365;0 0 0.894 1]; b=[-0.466;0;-6.557;4.353]; F=inv(A)*b F JD = 1.5429 kN F FD = -14.3701 kN F CD = 10.1596 kN F FC = -4.7297 kN


Download ppt "From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration."

Similar presentations


Ads by Google