Chain Rule of Differentiation

Download Report

Transcript Chain Rule of Differentiation

ME451 Kinematics and Dynamics of Machine Systems

Review of Differential Calculus

2.5, 2.6

September 11, 2013 Radu Serban University of Wisconsin-Madison

Assignments

 HW 1 Due today (Dropbox folder closed)  HW 2 Assigned: due September 16 (by 12:00PM)   Problems from slides 7 & 10 (PDF available at course website) + 2.4.4, 2.5.2, 2.5.7

Upload a file named “ lastName_HW_02.pdf

” to the Dropbox Folder “ HW_02 ” at Learn@UW.  MATLAB 1 Assignment: due September 18 (by 11:59PM)   PDF available at course website (includes upload instructions) Hint: Look at the following Matlab functions (use the

help

command) 

inline

sym/eval

and

matlabFunction

 Use the forum to post results; OK to discuss possible approaches; not OK to post your entire code.

2

Before we get started…

  Last time:  Discussed vector and matrix differentiation  Started chain rule of differentiation Today:  Chain rule; velocity and acceleration of a point in moving frame  Discuss absolute vs. relative coordinates  A word on notation: when

bold

fonts are not available, use underline to indicate vector or matrix quantities (and distinguish them from scalars).

3

Chain Rule of Differentiation

 Formula for computing the derivative(s) of the composition of two or more functions:    We have a function

f

of a variable

q

which is itself a function of

x

.

Thus,

f

is a function of

x

(implicitly through

q

) Question: what is the derivative of

f

with respect to

x

?

 Simplest case: real-valued function of a single real variable: 4

Case 1

Scalar Function of Vector Variable

f

is a scalar function of “n” variables:

q

1 , …,

q n

 However, each of these variables

q i

set of “

k

” other variables

x 1 , …, x k

.

in turn depends on a 5  The composition of

f

and

q

leads to a new function:

Chain Rule

Scalar Function of Vector Variable

 Question: how do you compute  x ?

 Using our notation:  Chain Rule: 6

Assignment

[due 09/16]

7

Case 2

Vector Function of Vector Variable

F

is a vector function of several variables:

q 1 , …, q n

 However, each of these variables

q i

set of

k

other variables

x 1 , …, x k

.

depends in turn on a 8  The composition of

F

and

q

leads to a new function:

Chain Rule

Vector Function of Vector Variable

 Question: how do you compute 

x

?

 Using our notation:  Chain Rule: 9

Assignment

[due 09/16]

10

Case 3

Vector Function of Vector Variable s

F

is a vector function of 2 vector variables

q

and

p

:  Both

q

and

p

𝐱 = 𝑥 1 , ⋯ , 𝑥 𝑘 in turn depend on a set of

k

𝑇 : other variables  A new function  (

x

) is defined as:  Example: a force (which is a vector quantity), depends on the generalized positions and velocities 11

Chain Rule

Vector Function of Vector Variable s

 Question: how do you compute 𝚽 𝐱 ?

 Using our notation:  Chain Rule: 12

[handout]

Example

13

Case 4

Time Derivatives

 In the previous slides we talked about functions f depending on q, where q in turn depends on another variable x.

 The most common scenario in ME451 is when the variable x is actually time ,

t

 You have a function that depends on the generalized coordinates

q

, and in turn the generalized coordinates are functions of time (they change in time, since we are talking about kinematics/dynamics here…)  Case 1: scalar function that depends on an array of

m

generalized coordinates: time-dependent 14  Case 2: vector function (of dimension n) that depends on an array of

m

time-dependent generalized coordinates:

Chain Rule

Time Derivatives

 Question: what are the time derivatives of  and ?

 Applying the chain rule of differentiation, the results in both cases can be written formally in the exact same way, except the dimension of the result will be different  Case 1: scalar function 15  Case 2: vector function

Example

Time Derivatives

16

A Few More Useful Formulas

17

2.6

Velocity and Acceleration of a Point Fixed in a Moving Frame

Velocity and Acceleration of a Point Fixed in a Moving Frame

 A moving rigid body and a point P, fixed (rigidly attached) to the body  The position vector of point P, expressed in the GRF is: and changes in time because both 𝐫 body position) and 𝐀 (the (the body orientation) change.

Questions:  What is the velocity That is: what is 𝐫 𝑃 ?

of P?

 What is the acceleration That is: what is 𝐫 𝑃 ?

of P?

19

Some preliminaries

 Orthogonal Rotation Matrix  Note that, when applied to a vector, this rotation matrix produces a new vector that is perpendicular to the original vector (counterclockwise rotation) 20  The matrix  The

B

matrix is always associated with a rotation matrix

A

.

 Important relations (easy to check):

Velocity of a Point Fixed in a Moving Frame

 Something to keep in mind: we’ll manipulate quantities that depend on the generalized coordinates, which in turn depend on time  Specifically, the orientation matrix

A

coordinate  depends on the generalized , which is itself a function of

t

 This is where the [time and partial] derivatives we discussed before come into play 21

Acceleration of a Point Fixed in a Moving Frame

 Same idea as for velocity, except that you need two time derivatives to get accelerations 22

Example

23

Absolute (Cartesian) vs. Relative Generalized Coordinates

Generalized Coordinates

General Comments

 What are Generalized Coordinates (GC)?

 A set of quantities (variables) that uniquely determine the state of the mechanism    the location of each body the orientation of each body (and from these, the position of any point on any body)  These quantities change in time since a mechanism allows motion  In other words, the generalized coordinates are functions of time  The rate at which the generalized coordinates change define the set of generalized velocities   Most often, obtained as the straight time derivative of the generalized coordinates Sometimes this is not the case though Example: in 3D Kinematics, there is no generalized coordinate whose time derivative is the angular velocity  Important remark : there are multiple ways of choose the set of generalized coordinates that describe the state of your mechanism 25

[handout]

Example (Relative GC)

26 Use the array

q

of generalized coordinates to locate the point P in the GRF (Global Reference Frame)

[handout]

Example (Absolute GC)

27 Use the array

q

of generalized coordinates to locate the point P in the GRF (Global Reference Frame)

Relative vs. Absolute GCs (1)

 A consequential question:  Where was it easier to come up with position of point P?

 First Approach (Example RGC) – relies on relative coordinates:   Angle  1 Angle  12 uniquely specified both position and orientation of body 1 uniquely specified the position and orientation of body 2 with respect to body 1   To locate point P on body 2 w.r.t. the GRF, we need to first position body 1 w.r.t. the GRF (based on  1 ), then position body 2 w.r.t. to body 1 (based on  12 ) Note that if there were 100 bodies, I would have to position body 1 w.r.t. to GRF, then body 2 w.r.t. body 1, then body 3 w.r.t. body 2, and so on, until we can position body 100 w.r.t. body 99 28

Relative vs. Absolute GCs (2)

 Second Approach (Example AGC) – relies on absolute (Cartesian) generalized coordinates:  x 1 , y 1 ,  1 define the position and orientation of body 1 w.r.t. the GRF  x 2 , y 2 ,  2  define the position and orientation of body 2 w.r.t. the GRF To express the location of P is then straightforward and uses only x 2 , y 2 ,  2 local information (local position of B in body 2): in other words, use only information associated with body 2.

and  For AGC, you handle many generalized coordinates  3 for each body in the system (six for this example) 29

Relative vs. Absolute GCs:

There is no such thing as a free lunch

 Absolute GC formulation:    Straightforward to express the position of a point on a given body (and only involves the GCs corresponding to the appropriate body and the position of the point in the LRF)… …but requires many GCs (and therefore many equations) Common in multibody dynamics (major advantage: easy to remove/add bodies and/or constraints)  Relative GC formulation:   Requires a minimal set of GCs …but expressing the position of a point on a given body is complicated (and involves GCs associated with an entire chain of bodies)  Common in robotics, molecular dynamics, real-time applications 

We will use AGC

: the math is simpler; let the computer keep track of the multitude of GCs … 30

Example 2.4.3

Slider Crank

 Based on information provided in figure (b), derive the position vector associated with point P (that is, find position of point P in the global reference frame OXY) 31 O

What comes next…

 Planar Cartesian Kinematics (Chapter 3)   Kinematics modeling : deriving the equations that describe motion of a mechanism, independent of the forces that produce the motion.

We will be using an Absolute (Cartesian) Coordinates formulation  Goals:   Develop a general library of constraints (the mathematical equations that model a certain physical constraint or joint) Pose the Position, Velocity and Acceleration Analysis problems  Numerical Methods in Kinematics (Chapter 4)  Kinematics simulation : solving the equations that govern position, velocity and acceleration analysis 32