Solutions of system of nonlinear equations: Newton-Raphson Example 4: The kinematic equations for a Four-Bar mechanism can be written as (5th semester,

Slides:



Advertisements
Similar presentations
H(s) x(t)y(t) 8.b Laplace Transform: Y(s)=X(s) H(s) The Laplace transform can be used in the solution of ordinary linear differential equations. Let’s.
Advertisements

Bode Magnitude Plots Constructed Bode Actual Bode
Solutions of system of nonlinear equations: Newton-Raphson Example 4: The kinematic equations for a Four-Bar mechanism can be written as (5th semester,
Mechanical Vibrations
FUNCTIONS.
Roots of a Polynomial: Root of a polynomial is the value of the independent variable at which the polynomial intersects the horizontal axis (the function.
Area of a single trapezoid = h
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Problems Ch(1-3).
Simpson Rule For Integration.
From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration.
Numerical Methods For Slides Thanks to Lecture 6 Interpolation
Centroids and Centers of Gravity
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
April Second Order Systems m Spring force ky F(t) (proportional to velocity) (proportional to displacement)
Simpson’s Rule: Example: Calculate the integral of the given function.
CHAPTER 3 NUMERICAL METHODS
Second Order System (Continued)
Ship Computer Aided Design Displacement and Weight.
Theoretical Mechanics STATICS KINEMATICS
A Paper Presentation on VIBRATION MEASURING INSTRUMENTS by A.ARIF DEPARTMENT OF MECHANICAL ENGINEERING GUDLAVALLERU ENGINEERING COLLEGE GUDLAVALLERU -
, Free vibration Eigenvalue equation EIGENVALUE EQUATION
System Time Response Characteristics
The formulae for the roots of a 3rd degree polynomial are given below
Section 3.1 Day 2 – Quadratic Functions After this section you should be able to: Graph a quadratic function with and without a calculator. Find the coordinates.
CHAPTER 3 NUMERICAL METHODS
Mechanical Vibrations
Chapter 1 Linear Equations and Graphs
Chapter 7 Numerical Differentiation and Integration
Chapter 1 Linear Equations and Graphs
The formulae for the roots of a 3rd degree polynomial are given below
The formulae for the roots of a 3rd degree polynomial are given below
Chapter 2 Response to Harmonic Excitation
Solution of Nonlinear Equations
Equations of Motion: Kinetic energy: Potential energy: Sin≈
Area of a single trapezoid = h
Distributed Forces: Centroids and Centers of Gravity
Section 3.2 Polynomial Functions and Their Graphs
Equations of Motion: Kinetic energy: Potential energy: Sin≈
The formulae for the roots of a 3rd degree polynomial are given below
MATH 2140 Numerical Methods
Example: Obtain the equation of motion of the mechanical system given below. Write the form of the output θ(t) in case of free vibration and determine.
Trapezoidal Rule of Integration
Distributed Forces: Centroids and Centers of Gravity
3. LAGRANGE INTERPOLATION METHOD
Distributed Forces: Centroids and Centers of Gravity
POLYNOMIAL INTERPOLATION
ENGINEERING MECHANICS
4.7 STRESS CONCENTRATIONS
Area of a single trapezoid = h
Equations of Motion: Kinetic energy: Potential energy: Sin≈
Simpson’s Rule: Example: Calculate the integral of the given function.
Section 11.2 Inverse Functions.
The formulae for the roots of a 3rd degree polynomial are given below
Chapter 1 Linear Equations and Graphs
Homework 02 ANSYS: Problem 1: (The system in Homework 01C- Problem 5)
Area of a single trapezoid = h
Newton-Raphson Example 4:
Numerical Computation and Optimization
Objective graph linear equations using slope-intercept form.
Find u,w ve z with computer?
Newton-Raphson Example 4:
3. LAGRANGE INTERPOLATION METHOD
Calculate the integral with; a) Trapezoidal rule b) Simpson’s rule
Newton-Raphson Example 4:
The formulae for the roots of a 3rd degree polynomial are given below
Newton-Raphson Example 4:
The formulae for the roots of a 3rd degree polynomial are given below
Presentation transcript:

Solutions of system of nonlinear equations: Newton-Raphson Example 4: The kinematic equations for a Four-Bar mechanism can be written as (5th semester, Mechanisms Course) s1s1 L2L2 L3L3 L4L4 θ2θ2 θ3θ3 θ4θ4 L 2 =0.15 m L 3 =0.45 m L 4 =0.28 m s 1 =0.2 m Where link 2 is the input member. How do you calculate θ 3 and θ 4 when θ 2 =120°

Solutions of system of nonlinear equations: Following changes are made in the computer program. clc, clear x=[0.5 1] ; err=[ ]; niter1=10;niter2=50; err=transpose(abs(err)); for n=1:niter2 x %Error Equations a(1,1)=-0.45*sin(x(1));a(1,2)=0.28*sin(x(2)); a(2,1)=0.45*cos(x(1));a(2,2)=-0.28*cos(x(2)); b(1)=-(0.45*cos(x(1))-0.28*cos(x(2))-0.275); b(2)=-( *sin(x(1))-0.28*sin(x(2))); % bb=transpose(b);eps=inv(a)*bb;x=x+transpose(eps); if n>niter1 if abs(eps)<err break else display ('Roots are not found') end ANSWER: θ 3 =0.216 rad (12.37°) θ 4 =0.942 rad (53.97°) (Initial angle values must be given in RADIAN) clc;clear [x,y]=solve('0.45*cos(x)-0.28*cos(y)=0.275',' *sin(x)-0.28*sin(y)=0'); vpa(x,6) vpa(y,6) Alternative solution with MATLAB

Solutions of system of nonlinear equations: Newton-Raphson Example 5: Kinematic equations for a crank mechanism are given below (5th semester Mechanisms Course) s L2L2 L3L3 θ2θ2 θ3θ3 L 2 =0.15 m L 3 =0.6 m Where link 2 (crank) is the input member. How dou you calculate θ 3 and s with computer when θ 2 =60°

Following changes are made in the computer program. ANSWER: θ 3 = rad (-12.5°) s= m Solutions of system of nonlinear equations: clc;clear [x,y]=solve(' *cos(x)-y=0',' *sin(x)=0'); vpa(x,6) vpa(y,6) Alternative solution with MATLAB clc, clear x=[-1 0.8] ; err=[ ]; niter1=10;niter2=50; err=transpose(abs(err)); for n=1:niter2 x %Error Equations a(1,1)=-0.6*sin(x(1));a(1,2)=-1; a(2,1)=0.6*cos(x(1));a(2,2)=0; b(1)=-( *cos(x(1))-x(2)); b(2)=-( *sin(x(1))); % bb=transpose(b);eps=inv(a)*bb;x=x+transpose(eps); if n>niter1 if abs(eps)<err break else display ('Roots are not found') end

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: Example 1: Given:  =0.36 ω 0 =24*2*π (rad/s) A=1.2 Φ=-42*π/180 (rad)=-0.73 rad ω 0 = rad/s ω -σ-σ α

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)');

Example 2: Solutions of system 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?

Newton-Raphson Example 2: Solutions of system of nonlinear equations: ANSWER t=0.713 s t=2.198 s Using roots command in MATLAB a=[ ]; 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;err=0.001; niter=20; % for n=1:niter % f=x^3-x^2-4*x+3; df=3*x^2-2*x-4; % eps=-f/df; x =x+eps; if abs(f)<err break end display('Answer is='),x

Simpson’s Rule: i Example 3: Calculate the integral of the given function.

kθM(θ) 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= Simpson’s Rule:

Example 4: Simpson’s Rule: kθM2(θ)M2(θ) x x x x x10 -7

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

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

Lagrange Interpolation: Example 6: 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). Medical cement Thermometer With Matlab: >>clc;clear >> t=[ ]; >> T=[ ]; >> interp1(t,T,36,'spline')

Lagrange Interpolation: Example 7: 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) mm P cr

Lagrange Interpolation: Thickness (t) (mm) Buckling Load P cr (N) mm clc;clear t=[ ]; P=[ ]; interp1(t,P,0.8,'spline') P cr 0.5,30 0.6, , ,46 0.9,58 data.txt clc;clear v=load ('c:\saha\data.txt') interp1(v(:,1),v(:,2),0.8,'spline') 1. Lagrange Interpolation with Matlab 2. Lagrange Interpolation with Matlab

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

Solution of system of nonlinear equations : How do you find x and y values, which satisfy the equations? x= y= with Matlab: >>[x,y]=solve('sin(2*x)+y^3=3*x-1','x^2+y=1-y^2') x=0.6786, y= clc, clear x=[1 1]; err=[ ]; niter1= 5; niter2=50; err=transpose(abs(err)); 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)<err break else display ('Roots are not found') end Example 9:

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]; err=[ ]; niter1= 5; niter2=50; err=transpose(abs(err)); 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)<err break else display ('Roots are not found') end Example 10:

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=[ ]; interp1(x,P,5,'spline') Lagrange Interpolation: Example 11:

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 b) How do you find the answer manually? Result: a)How do you find the answer with computer? clc;clear x=[ ]; y=[ ]; interp1(x,y,50,'spline') Lagrange Interpolation: Example 12:

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

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

Lagrange Interpolation + Simpson’s Rule: For a steel plate weighing 10 N and has a thickness 2 mm, the coordinates of some points shown in the figure were measured (in cm) by a Coordinate Measuring Machine (CMM). How do you calculate the density 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.2 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 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 15:

Lagrange Interpolation + Simpson’s Rule: xy

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=[ ]; y=[ ]; interp1(x,y,1,'spline') interp1(x,y,2,'spline') interp1(x,y,3,'spline')

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 b) With computer using Matlab >>syms t >>I=int((1+sin(t)^3)/sqrt(t^2+1),0,10);vpa(I,5) Example 16:

Simpson’s Rule: Find the intersection area of the curves y=x 2 +2 and y=3x. Roots kxf using Matlab >>syms x >>I=int(3*x-x^2-2,1,2);vpa(I,5) >> roots([1 -3 2]) Example 17:

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

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 = kN are known? A b F Example 19:

System of linear equations: A b F with Matlab clc;clear A=[ ; ; ; ]; b=[-0.466;0;-6.557;4.353]; F=inv(A)*b F JD = kN F FD = kN F CD = kN F FC = kN