Upload
michael-brooks
View
216
Download
1
Embed Size (px)
Citation preview
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)
s1
L2
L3
L4θ2
θ3
θ4
L2=0.15 mL3=0.45 mL4=0.28 ms1=0.2 m
0sinLsinLsinL
0scosLcosLcosL
443322
1443322
2
3
4
1
Where link 2 is the input member. How do you calculate θ3 and θ4 when θ2=120°.
)sin(28.0)sin(45.0)120sin(15.0f2.0)cos(28.0)cos(45.0)120cos(15.0f
432
431
-0.075
0.13
Solutions of system of nonlinear equations:
33
1 sin45.0f
44
1 sin28.0f
33
2 cos45.0f
44
2 cos28.0f
Following changes are made in the computer program.
clc, clearx=[0.5 1] ; err=[0.01 0.01];niter1=10;niter2=50;err=transpose(abs(err));for n=1:niter2x%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)=-(0.13+0.45*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 endend
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','0.13+0.45*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
L2 L3θ2
θ3
L2=0.15 mL3=0.6 m
0sinLsinL
0scosLcosL
3322
3322
)sin(6.0)60sin(15.0fs)cos(6.0)60cos(15.0f
32
31
Where link 2 (crank) is the input member. How dou you calculate θ3 and s with computer when θ2=60°.
0.075
0.1299
33
1 sin6.0f
1sf1
33
2 cos6.0f
0sf2
Following changes are made in the computer program.
ANSWER:
θ3=-0.2182 rad (-12.5°)
s=0.6607 m
Solutions of system of nonlinear equations:
clc;clear[x,y]=solve('0.075+0.6*cos(x)-y=0','0.1299+0.6*sin(x)=0');vpa(x,6)vpa(y,6)
Alternative solution with MATLAB
clc, clearx=[-1 0.8] ; err=[0.01 0.01];niter1=10;niter2=50;err=transpose(abs(err));for n=1:niter2x%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)=-(0.075+0.6*cos(x(1))-x(2)); b(2)=-(0.1299+0.6*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 endend
Newton-Raphson Example 6:
Solutions of system of nonlinear equations:
The time-dependent locations of two cars denoted by A and B
are given as
3ts
t4ts2
B
3A
At which time t, two cars meet?
BA ss 3t4ttf 23
4t2t3f 2
n1n xx,
ff
0 0.5 1 1.5 2 2.5 3 3.5 4-10
0
10
20
30
40
50
Zaman (s)
Yol
(m
)
A
B
Newton-Raphson Example 6:
Solutions of system of nonlinear equations:
ANSWER
t=0.713 s
t=2.198 s
0 0.5 1 1.5 2 2.5 3 3.5 4-10
0
10
20
30
40
50
Zaman (s)
Yol
(m
)
A
B
Using roots command in MATLAB
a=[ 1 -1 -4 3]; roots(a)
clc;cleart=solve('t^3-t^2-4*t+3=0');vpa(t,6)
Alternative Solutions with MATLAB
clc, clearx=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 endenddisplay('Answer is='),x
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 -42o. Write the MATLAB code to plot the graph of the vibration signal.
Graph Plotting:
Graph Plotting Example 7:
)73.0t7.140cos(e2.1)t(y t3.54
Given:
=0.36
ω0=24*2*π (rad/s)
A=1.2
Φ=-42*π/180 (rad)=-0.73 rad
ω0=150.796 rad/sω
-σ
3.54796.150*36.00
s/rad7.14036.01*796.150
12
20
20
20
α
0
cos
s0416.0796.1501415.3*22
T0
0
s002.0200416.0
20T
t 0 s1155.036.0
0416.0Tt 0
s
Graph Plotting:
0 0.02 0.04 0.06 0.08 0.1 0.12-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Zaman (s)
y
clc;cleart=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)');