03_02

Notes_03_02
1 of 15
Complex Numbers for Planar Kinematics
Standard XY Notation
Complex Number Notation
Imaginary
(Vertical)
Y
r
b
a

a
X
Real (Horizontal)
r 2  a 2  b2
j
R a jbr e
j
e  cos   j sin 
tan   b / a
j  1
R  aî  bĵ  r
j
Expanding:
R  re
Position:
R  re
Velocity:
  re j
R
 r cos   j r sin 
j
r  magnitude , e  direction
a  r cos 
b  r sin 
j
 j r  e
d
 

dt
j
Extension
Tangential
  r e j
Acceleration: R
Extension
j
 j r  e
Tangential
Jerk:
r
b

R
  ( r  3r  2  3r  )e j
 r  2 e
Normal
j
 j 2 r  e
Coriolis
2
  d   
dt 2
j
j
 (r  3r   3r   r  3 ) j e
Snap:

j
j

R
 ( r  6r  2  12r    4r    3r  2  r  4 )e  (r  4r  6r  2  6r   4r   4r  3 ) j e
Note:
1. is always measured CCW from positive real axis.  ,  and  are positive CCW.
j
j
j
2. j e  e
(Try it using R  a  j b  r e )
Matrix Solution:
a 12 
a
[A]   11

a 21 a 22 
[A]{x} = {B}
{x}=[A]-1 {B}
1  a 22  a 12 
[A]1 
det[ A]  a 11 a 22  a 12 a 21
det[ A]  a 21 a 11 
Notes_03_02
2 of 15
Complex Number Analysis of Four Bar
constants r1 r2 r3 r4  and variable 
3 and 4
Given:
Find:
r
R


r
R
r
R


R
Loop Equation:
R 2  R 3  R 4  R1  0
Position:
r2 e
j 2
 r3 e
j 3
 r4 e
j 4
 r1e
j1
0
Real Components:
r2 cos  2  r3 cos 3  r4 cos  4  r1 cos 1  0
Imaginary Components:
j r2 sin  2  j r3 sin 3  j r4 sin  4  j r1 sin 1  0
Use Newton-Raphson iterative solution for position.
Position solution and  2 and r1  r2  r3  r4   1  0
 and 
Given:
Find:
3
4
j
j
j
j r2  2 e 2  j r3  3 e 3  j r4  4 e 4  0
 r2  2 sin  2  r3  3 sin  3  r4  4 sin  4  0
j r  cos   j r  cos   j r  cos   0
Velocity:
Real Components:
Imaginary Components:
2
2
2
3
3
3
4
4
4
r3 sin  3 r4 sin  4   3   r2  2 sin  2 
 

 r cos 
 r4 cos  4   4   r2  2 cos  2 
3
 3
detJ  r3r4 sin 3 cos 4  cos 3 sin 4   r3r4 sin 3  4   r3r4 sin 
 3  r2 2 sin 2  4  / r3 sin 3  4 
 4  r2 2 sin 2  3  / r4 sin 3  4 
Matrix Notation:
Given:
Position and velocity solutions and  2
 and 
Find:
3
4
Acceleration:
j
j
j
j
j
j
j r2  2 e 2  r2  22 e 2  j r3 3 e 3  r3  32 e 3  j r4  4 e 4  r4  24 e 4  0
 r2  2 sin  2  r2  22 cos  2 r33 sin  3  r3  32 cos  3 r4  4 sin  4  r4  24 cos  4  0
Real:
Imaginary: j r2  2 cos  2  j r2  22 sin  2  j r3 3 cos  3  j r3  32 sin  3  j r4  4 cos  4  j r4  24 sin  4  0
r3 sin 3 r4 sin  4  3   r2 2 sin  2  r2  22 cos  2  r3  32 cos 3  r4  24 cos  4 
Matrix: 

   
2
2
2
 r3 cos 3  r4 cos  4   4   r2 2 cos  2  r2  2 sin  2  r3  3 sin 3  r4  4 sin  4 
   r  sin      r  2 cos     r  2 cos     r  2 / r sin    
3
2 2
2
4
2 2
2
4
3 3
3
4
4 4
3
3
4
   r  sin      r  2 cos     r  2  r  2 cos   / r sin    
4
2 2
2
3
2 2
2
3
3 3
4 4
3
4
4
3
4
Notes_03_02
3 of 15
Given: Position, velocity and acceleration solutions and 2
 and 
Find:
3
4
Jerk:
j
j
j
j
j (r22  r2  32 )e 2  3r2  2  2 e 2  j (r33  r3  33 )e 3  3r3  33 e 3
j
j
 j (r44  r4  34 )e 4  3r4  4  4 e 4  0
Real Components:
 (r22  r2  32 ) sin  2  3r2  2  2 cos  2 (r33  r3  33 ) sin  3  3r3  33 cos 3
(r   r  3 ) sin   3r   cos   0
4
4
4
4
4
4
4
4
4
Imaginary Components:
j (r22  r2  32 ) cos  2  j 3r2  2  2 sin  2  j (r33  r3  33 ) cos 3  j 3r3  33 sin  3
 j (r44  r4  34 ) cos  4  j 3r4  4  4 sin  4  0
Matrix Notation:
r4 sin  4  3 
r3 sin  3
 
 r cos 
 r4 cos  4  4 
3
 3
 (r22  r2  32 ) sin  2  3r2  2  2 cos  2  r3  33 sin  3  3r3  3 3 cos  3  r4  34 sin  4  3r4  4  4 cos  4 



3
 
3
 
3
 
 (r2 2  r2  2 ) cos  2  3r2  2  2 sin  2  r3  3 cos  3  3r3  3  3 sin  3  r4  4 cos  4  3r4  4  4 sin  4 
Given: Position, velocity, acceleration and jerk solutions and 2
 and 
Find:
3
4
Snap:
j
j

 j r2 (2  6 22 2 )e 2  r2 (4 22  322   42 )e 2
j
j
 j r3 (3  6 323 )e 3  r3 (4 33  332   34 )e 3
j
j
 j r4 (4  6 244 )e 4  r4 ( 4 44  324   44 )e 4  0
Real Components:

 r2 (2  6 22 2 ) sin 2  r2 (4 22  322   42 ) cos 2

 r3 (3  6 323 ) sin 3  r3 (4 33  332   34 ) cos 3

 r4 (4  6 244 ) sin 4  r4 (4 44  324   44 ) cos 4  0
Imaginary Components:

 j r (  6 2  ) cos   j r (4   32   4 ) sin 
2
2
2
2
2
2
2 2
2
2
2

 j r3 (3  6 323 ) cos 3  j r3 (4 33  332   34 ) sin 3

 j r4 (4  6 244 ) cos 4  j r4 (4 44  324   44 ) sin 4  0
Notes_03_02
Matrix Notation:
r3 sin  3
 r cos 
3
 3
 r (  6 2  ) sin   r (4   3 2   4 ) cos  
2
2
2
2
2 2
2
2
2
 2 2

2
2
4
 6r3  3  3 sin  3  r3 (4 33  3 3   3 ) cos  3



 2  sin   r (4   3 2   4 ) cos 

6
r




4
4
4
4
4
4
4
4
4
4





r4 sin  4   3  





 r4 cos  4  4  

2
2
4
 r (  6 2  2 ) cos  2  r2 (4 22  3 2   2 ) sin  2 
 2 2

 6r3  32  3 cos  3  r3 (4 33  3 32   34 ) sin  3



 6r4  24  4 cos  4  r4 (4 44  3 24   44 ) sin  4

4 of 15
Notes_03_02
5 of 15
Complex Number Analysis of In-Line and Offset Slider Crank
Given:
Find:
constants r2 r3 r4  =+90°) and variable 
3 and r1

r
R
R
r
r

R
R
Loop Equation:
R 2  R 3  R 4  R1  0
Position:
r2 e
j 2
 r3 e
j 3
 r4 e
j 4
 r1e
j1
0
Real Components:
r2 cos  2  r3 cos 3  r4 cos  4  r1 cos 1  0
Imaginary Components:
j r2 sin  2  j r3 sin 3  j r4 sin  4  j r1 sin 1  0
Use Newton-Raphson iterative solution for position.
Given:
Find:
Position solution and  2 and r2  r3  r4   1   4  0
 and r
3
1
j
j
j
j r2  2 e 2  j r3  3 e 3  r1 e 1  0
 r2  2 sin  2  r3  3 sin  3  r1 cos 1  0
Real Components:
j r2  2 cos  2  j r3  3 cos  3  j r1 sin 1  0
Imaginary Components:
r3 sin 3  cos 1   3   r2  2 sin  2 
Matrix Notation:
 

 r cos 
 sin 1   r1   r2  2 cos  2 
3
 3
detJ  r3 sin 3 sin i  cos 3 cos 1   r3 cos3  1 
 3  r2 2 cos2  1  / r3 cos3  1 
r1  r2 2 sin 2  3  / cos3  1 
Velocity:
Given:
Position and velocity solutions and  2
 and r
Find:
3
1
Acceleration:
j
j
j
j
j
j r2  2 e 2  r2  22 e 2  j r3  3 e 3  r3  32 e 3  r1 e 1  0
 r2  2 sin  2  r2  22 cos  2 r3 3 sin  3  r3  32 cos  3 r1 cos 1  0
Real:
Imaginary: j r2  2 cos  2  j r2  22 sin  2  j r3 3 cos  3  j r3  32 sin  3  j r1 sin 1  0
Matrix Notation:
r3 sin 3  cos 1  3   r2  2 sin  2  r2  22 cos  2  r3  32 cos 3 

 r cos 
      
2
2

sin

3
3
1

  r1   r2  2 cos  2  r2  2 sin  2  r3  3 sin 3 
   r  cos     r  2 sin      r  2 sin    / r cos   
3
2 2
2
1
2 2
2
1
3 3
3
1
3
3
1
2
2




r1  r22 sin 3  2   r22 cos3  2   r33 / cos3  1 
Notes_03_02
6 of 15
Position and velocity solutions and 2
 and r
3
1
Given:
Find:
Jerk:
j
j
j
j
j
j (r22  r2 32 )e 2  3r2 22e 2  j (r33  r3 33 )e 3  3r3 33e 3  r1 e 1  0
Real Components:
 (r22  r2 32 ) sin 2  3r2 22 cos 2 (r33  r3 33 ) sin 3  3r3 33 cos 3  r1 cos 1  0
Imaginary Components:
j (r22  r2 32 ) cos 2  j 3r2 22 sin 2  j (r33  r3 33 ) cos 3  j 3r3 33 sin 3  j r1 sin 1  0
Matrix Notation:
r3 sin 3  cos 1  3   (r22  r2 32 ) sin 2  3r2 22 cos 2  r3 33 sin 3  3r3 33 cos 3 
 

 r cos 
 sin 1   r1   (r22  r2 32 ) cos 2  3r2 22 sin 2  r3 33 cos 3  3r3 33 sin 3 
3
 3
Position and velocity solutions and 2
 and r
Given:
Find:
Snap:
3
1
j
j

 j (r22  6r2  22  2 )e 2  (4r22  2  3r2  22  r2  42 )e 2
j
j
j

 j (r33  6r3  32  3 )e 3  (4r33  3  3r332  r3  34 )e 3  r1 e 1  0
Real Components:

 (r22  6r2  22  2 ) sin  2  (4r22  2  3r2  22  r2  42 ) cos  2
j

 (r33  6r3  32  3 ) sin  3  (4r33  3  3r3 32  r3  34 ) cos  3  r1 e 1 cos 1  0
Imaginary Components:

 j (r   6r  2  ) cos   j (4r    3r  2  r  4 ) sin 
2
2
2
2
2
2
2
2
2
2
2
2
2
2
j

 j (r33  6r3  32  3 ) cos  3  j (4r33  3  3r3 32  r3  34 ) sin  3  j r1 e 1 sin 1  0
Matrix Notation:
 (r   6r  2  ) sin   (4r    3r  2  r  4 ) cos  
2 2 2
2
2 2 2
2 2
2 2
2
 2 2

2
2
4













6
r


sin


(
4
r



3
r


r

)
cos

3 3 3
3
3 3 3
3 3
3 3
3
r3 sin  3  cos 1  3  

 

 r cos 

 sin 1   r1  
3

 3
2 
2
4











 (r   6r2  2  2 ) cos  2  (4r2 2  2  3r2  2  r2  2 ) sin  2 
 2 2

 6r3  32  3 cos  3  (4r33  3  3r3 32  r3  34 ) sin  3

Notes_03_02
7 of 15
Complex Number Analysis of Inverted Slider Crank
constants r1 r2 and variable 
r4 and 4
Given:
Find:
r 

R
r
R

r 
R
R 2  R 4  R1  0
j
j
j
Position:
r2 e 2  r4 e 4  r1e 1  0
Real Components:
r2 cos 2  r4 cos 4  r1 cos 1  0
Imaginary Components:
j r2 sin 2  j r4 sin 4  j r1 sin 1  0
Use Newton-Raphson iterative solution for position.
Loop Equation:
Position solution and  2 and r1  r2   1  0
r4 and  4
j
j
j
Velocity:
j r2  2 e 2  r4 e 4  j r4  4 e 4  0
Real Components:
 r2  2 sin  2  r4 cos  4  r4  4 sin  4  0
Imaginary Components:
j r2  2 cos  2  j r4 sin  4  j r4  4 cos  4  0
 cos  4 r4 sin  4   r4   r2  2 sin  2 
Matrix Notation:

  sin   r cos       
4
4
4  4 

 r2  2 cos  2 
detJ  r4 cos 2 4  sin 2 4  r4
r4  r2 2 sin 2  4 
 4  r2 2 cos2  4  / r4
Given:
Find:


Given:
Position and velocity solutions and  2
r4 and  4
Find:
Acceleration:
j
j
j
j
j
j
j r2  2 e 2  r2  22 e 2  r4 e 4  j r4  4 e 4  r4  24 e 4  j 2 r4  4 e 4  0
Real Components:
 r2  2 sin  2  r2  22 cos  2 r4 cos  4 r4  4 sin  4  r4  24 cos  4  2r4  4 sin  4  0
Imaginary Components:
j r2 2 cos  2  j r2  22 sin  2  j r4 sin  4  j r4  4 cos  4  j r4  24 sin  4  j 2r4  4 cos  4  0
Matrix Notation:
 cos 4 r4 sin 4  r4   r22 sin 2  r2 22 cos 2  r4 24 cos 4  2r4 4 sin 4 

  sin   r cos       
2
2

4
4
4  4 

 r22 cos 2  r22 sin 2  r44 sin 4  2r44 cos 4 
r4  r2  2 sin  2   4   r2  22 cos 2   4   r4  24
  r  cos     r  2 sin      2r  / r
4
2 2
2
4
2 2
2
4
4 4
4


Notes_03_02
Given: Position, velocity and acceleration solutions and 2
r and 
Find:
4
4
Jerk:
j
j
j
j
j (r22  r2 32 )e 2  3r2 22e 2  (r4  3r4 24 )e 4  j (3r4 4  3r44 )e 4
j
j
 j (r44  r4 34 )e 4  3r4 44e 4  0
Real Components:
 (r22  r2 32 ) sin 2  3r2 22 cos 2  (r4  3r4 24 ) cos 4  (3r4 4  3r44 ) sin 4
(r   r  3 ) sin   3r   cos   0
4 4
4 4
4
4 4 4
4
Imaginary Components:
j (r22  r2 32 ) cos 2  j 3r2 22 sin 2  j (r4  3r4 24 ) sin 4  j (3r4 4  3r44 ) cos 4
 j (r   r  3 ) cos   j 3r   sin   0
4 4
4 4
4
4 4 4
4
Matrix Notation:
 cos 4 r4 sin 4  r4 
  sin   r cos     
4
4
4  4 

3
 (r22  r2 2 ) sin 2  3r2 22 cos 2  (3r4 4  3r44  r4 34 ) sin 4  3r4 44  3r4 24 cos 4 



3
 


3
 
2
 (r2 2  r22 ) cos 2  3r222 sin 2  (3r44  3r44  r44 ) cos 4  3r444  3r44 sin 4 
Given: Position, velocity, acceleration and jerk solutions and 2
 and 
Find:
3
4
Snap:
 r2 (4 22  322   42 )e
j 2
j
 j r2 (2  6 222 )e 2
j
j
 (r4  6r4 24  12r4 44 )e 4  j (4r4 4  6r44  4r44  4r4 34 )e 4
j
j
 r4 (4 44  324   44 )e 4  j r4 (4  6 244 )e 4  0
Real Components:
 r (4   32   4 ) cos   r (  6 2 ) sin 
2
2 2
2
2
2
2
2
2 2
2
 (r4  6r   12r4 44 ) cos 4  (4r4 4  6r44  4r44  4r4 34 ) sin 4
 r (4   32   4 ) cos   r (  6 2 ) sin   0
2
4 4
4
4 4
4
4
4
4
4
4 4
4
Imaginary Components:
 j r2 (4 22  322   42 ) sin 2  j r2 (2  6 222 ) cos 2
 j (r4  6r4 24  12r4 44 ) sin 4  j (4r4 4  6r44  4r44  4r4 34 ) cos 4
 j r (4   32   4 ) sin   j r (  6 2 ) cos   0
4
4 4
4
4
4
4
4
4 4
4
8 of 15
Notes_03_02
9 of 15
Matrix Notation:
 cos 4
  sin 
4

 r (  6 2 ) sin   r (4   32   4 ) cos 

2 2
2
2
2 2
2
2
2
 2 2

 (4r4 4  6r44  4r44  4r4 34 ) sin 4  (6r4 24  12r4 44 ) cos 4 


 2 sin   r (4   32   4 ) cos 

6
r




4
4
4
4
4
4
4
4
4
4
r4 sin 4   r4  





 r4 cos 4  4  

2
2
4

 r (  6 22 ) cos 2  r2 (4 22  32   2 ) sin 2
 2 2

 (4r4 4  6r44  4r44  4r4 34 ) cos 4  (6r4 24  12r4 44 ) sin 4 


 6r4 244 cos 4  r4 (4 44  324   44 ) sin 4

Notes_03_02
10 of 15
Four bar r1=90, r2=30, r3=60, r4=45
180
160
link 3
link 4
140
Angle [deg]
120
100
80
60
40
20
0
-100
-80
-60
-40
-20
0
20
Theta 2 [deg]
40
60
80
100
60
80
100
Four bar r1=90, r2=30, r3=60, r4=45
8
6
Angular velocity [rad/sec]
4
2
0
-2
-4
link
link
link
link
-6
3 complex numbers
4 complex numbers
3 geometric
4 geometric
-8
-10
-100
-80
-60
-40
-20
0
20
Theta 2 [deg]
40
Notes_03_02
11 of 15
Four bar r1=90, r2=30, r3=60, r4=45
Angular acceleration [rad/sec/sec]
150
link
link
link
link
100
3 complex numbers
4 complex numbers
3 geometric
4 geometric
50
0
-50
-100
-100
-80
-60
-40
-20
0
20
Theta 2 [deg]
40
60
80
100
60
80
100
Four bar r1=90, r2=30, r3=60, r4=45
4000
Angular jerk [rad/sec/sec/sec]
3000
link
link
link
link
2000
3 complex numbers
4 complex numbers
3 geometric
4 geometric
1000
0
-1000
-2000
-3000
-100
-80
-60
-40
-20
0
20
Theta 2 [deg]
40
Notes_03_02
12 of 15
Four bar r1=90, r2=30, r3=60, r4=45
4000
link
link
link
link
Angular jerk [rad/sec/sec/sec]
3000
2000
3 complex numbers
4 complex numbers
3 finite difference
4 finite difference
1000
0
-1000
-2000
-3000
-100
-80
-60
-40
-20
0
20
Theta 2 [deg]
40
60
80
100
Notes_03_02
% fourbar_kin.m - four bar kinematics
%
geometric and complex number methods
% HJSIII, 04.03.15
% general constants
d2r = pi / 180;
% link lengths and coupler angle
r1 = 90;
r2 = 30;
r3 = 60;
r4 = 45;
% crank
w2 = -10;
a2 = 2;
g2 = -0.5;
% [rad/sec]
% [rad/sec/sec]
% [rad/sec/sec/sec]
% theta 2 at toggle positions +/- 109 deg
th2max = acos( (r1*r1 + r2*r2 - (r3+r4)*(r3+r4)) /2 /r1 /r2 );
th2max_deg = fix( th2max / d2r ) - 3;
th2min_deg = -th2max_deg;
% reduced motion
th2min_deg = -90;
th2max_deg = 90;
%th2min_deg = -109;
%th2max_deg = 109;
% allocate empty array to hold values
keep_m = [];
keep_g = [];
% crank angle
for th2_deg = th2min_deg : 1 : th2max_deg,
%for th2_deg = 65 : 65,
th2 = th2_deg * d2r;
% geometric position equations
e = sqrt( r1*r1 + r2*r2 - 2*r1*r2*cos(th2) );
alpha = asin( r2 * sin(th2) / e );
gamma = acos( ( r3*r3 + r4*r4 - e*e ) /2 /r3 /r4 );
beta = asin( r3 * sin(gamma) / e );
th4 = pi - alpha - beta;
th3 = th4 - gamma;
% matrix velocity equations
JAC = [ -r3*sin(th3)
r4*sin(th4) ;
r3*cos(th3) -r4*cos(th4) ];
vrhs = [
r2*w2*sin(th2) ;
-r2*w2*cos(th2) ];
vsol = inv(JAC) * vrhs;
w3 = vsol(1);
w4 = vsol(2);
% geometric velocity solutions
th2d = w2;
ed = r1*r2*th2d*sin(th2) / e;
ad = ( r2*th2d*cos(th2) - ed*sin(alpha) ) /e /cos(alpha);
gd = e*ed /r3 /r4 /sin(gamma);
bd = ( r3*gd*cos(gamma) - ed*sin(beta) ) /e / cos(beta);
th4d = -ad - bd;
th3d = th4d - gd;
% matrix acceleration equations
arhs = [ r2*a2*sin(th2)+r2*w2*w2*cos(th2)+r3*w3*w3*cos(th3)-r4*w4*w4*cos(th4) ;
-r2*a2*cos(th2)+r2*w2*w2*sin(th2)+r3*w3*w3*sin(th3)-r4*w4*w4*sin(th4) ];
asol = inv(JAC) * arhs;
a3 = asol(1);
a4 = asol(2);
13 of 15
Notes_03_02
14 of 15
% geometric acceleration solutions
th2dd = a2;
edd = ( r1*r2*(th2d*th2d*cos(th2) + th2dd*sin(th2)) - ed*ed ) / e;
add = ( -r2*th2d*th2d*sin(th2) +r2*th2dd*cos(th2) - edd*sin(alpha) ...
-2*ed*ad*cos(alpha) + e*ad*ad*sin(alpha) ) /e /cos(alpha);
gdd = ( ed*ed +e*edd - r3*r4*gd*gd*cos(gamma) ) /r3 /r4 /sin(gamma);
bdd = ( -r3*gd*gd*sin(gamma) +r3*gdd*cos(gamma) -edd*sin(beta) ...
-2*ed*bd*cos(beta) +e*bd*bd*sin(beta) ) /e / cos(beta);
th4dd = -add - bdd;
th3dd = th4dd - gdd;
% matrix jerk equations
jrhs1 = (r2*g2-r2*w2*w2*w2)*sin(th2) +3*r2*w2*a2*cos(th2) ...
-r3*w3*w3*w3*sin(th3) +3*r3*w3*a3*cos(th3) ...
+r4*w4*w4*w4*sin(th4) -3*r4*w4*a4*cos(th4) ;
jrhs2 = -(r2*g2-r2*w2*w2*w2)*cos(th2) +3*r2*w2*a2*sin(th2) ...
+r3*w3*w3*w3*cos(th3) +3*r3*w3*a3*sin(th3) ...
-r4*w4*w4*w4*cos(th4) -3*r4*w4*a4*sin(th4) ;
jrhs = [ jrhs1 ; jrhs2 ];
jsol = inv(JAC) * jrhs;
g3 = jsol(1);
g4 = jsol(2);
% geometric jerk solutions
th2ddd = g2;
eddd = ( r1*r2*(3*th2d*th2dd*cos(th2) -th2d*th2d*th2d*sin(th2) + th2ddd*sin(th2)) ...
-3*ed*edd ) / e;
addd = ( -3*r2*th2d*th2dd*sin(th2) -r2*th2d*th2d*th2d*cos(th2) +r2*th2ddd*cos(th2) ...
+3*e*ad*add*sin(alpha) +e*ad*ad*ad*cos(alpha) ...
-3*edd*ad*cos(alpha) -3*ed*add*cos(alpha) +3*ed*ad*ad*sin(alpha) ...
-eddd*sin(alpha) ) /e /cos(alpha);
gddd = ( 3*ed*edd +e*eddd - r3*r4*(3*gd*gdd*cos(gamma) -gd*gd*gd*sin(gamma)) ) ...
/r3 /r4 /sin(gamma);
bddd = ( -3*r3*gd*gdd*sin(gamma) -r3*gd*gd*gd*cos(gamma) +r3*gddd*cos(gamma) ...
-eddd*sin(beta) -3*bd*edd*cos(beta) -3*ed*bdd*cos(beta) ...
+3*ed*bd*bd*sin(beta) +3*e*bd*bdd*sin(beta) +e*bd*bd*bd*cos(beta) ) ...
/e / cos(beta);
th4ddd = -addd - bddd;
th3ddd = th4ddd - gddd;
% save for plotting
keep_m = [ keep_m ; th2
keep_g = [ keep_g ; th2
end
th3
th3
th4
th4
w3
th3d
w4
th4d
a3
th3dd
% create plotting vectors
th2_deg = keep_m(:,1) / d2r;
th3_deg = keep_m(:,2) / d2r;
th4_deg = keep_m(:,3) / d2r;
w3
w4
a3
a4
g3
g4
=
=
=
=
=
=
keep_m(:,4);
keep_m(:,5);
keep_m(:,6);
keep_m(:,7);
keep_m(:,8);
keep_m(:,9);
th3d = keep_g(:,4);
th4d = keep_g(:,5);
th3dd = keep_g(:,6);
th4dd = keep_g(:,7);
th3ddd = keep_g(:,8);
th4ddd = keep_g(:,9);
figure( 1 )
clf
plot( th2_deg,th3_deg,'r', th2_deg,th4_deg,'g' )
xlabel( 'Theta 2 [deg]' )
ylabel( 'Angle [deg]' )
legend( 'link 3', 'link 4' )
a4
th4dd
g3
th3ddd
g4
];
th4ddd ];
Notes_03_02
title( 'Four bar r1=90, r2=30, r3=60, r4=45' )
figure( 2 )
clf
plot( th2_deg,w3,'ro', th2_deg,w4,'go', th2_deg,th3d,'b', th2_deg,th4d,'k' )
xlabel( 'Theta 2 [deg]' )
ylabel( 'Angular velocity [rad/sec]' )
legend( 'link 3 complex numbers', 'link 4 complex numbers', ...
'link 3 geometric', 'link 4 geometric' )
title( 'Four bar r1=90, r2=30, r3=60, r4=45' )
figure( 3 )
clf
plot( th2_deg,a3,'ro', th2_deg,a4,'go', th2_deg,th3dd,'b', th2_deg,th4dd,'k' )
xlabel( 'Theta 2 [deg]' )
ylabel( 'Angular acceleration [rad/sec/sec]' )
legend( 'link 3 complex numbers', 'link 4 complex numbers', ...
'link 3 geometric', 'link 4 geometric' )
title( 'Four bar r1=90, r2=30, r3=60, r4=45' )
figure( 4 )
clf
plot( th2_deg,g3,'ro', th2_deg,g4,'go', th2_deg,th3ddd,'b', th2_deg,th4ddd,'k' )
xlabel( 'Theta 2 [deg]' )
ylabel( 'Angular jerk [rad/sec/sec/sec]' )
legend( 'link 3 complex numbers', 'link 4 complex numbers', ...
'link 3 geometric', 'link 4 geometric' )
title( 'Four bar r1=90, r2=30, r3=60, r4=45' )
% check by finite differences
figure( 5 )
clf
dt = ( 1 * d2r ) / w2;
g3_fd = [ NaN ; diff( a3 ) ] / dt;
g4_fd = [ NaN ; diff( a4 ) ] / dt;
plot( th2_deg,g3,'ro', th2_deg,g4,'go', th2_deg,g3_fd,'b', th2_deg,g4_fd,'k' )
xlabel( 'Theta 2 [deg]' )
ylabel( 'Angular jerk [rad/sec/sec/sec]' )
legend( 'link 3 complex numbers', 'link 4 complex numbers', ...
'link 3 finite difference', 'link 4 finite difference' )
title( 'Four bar r1=90, r2=30, r3=60, r4=45' )
% bottom of fourbar_kin.m
15 of 15