Lecture 2. A Day of Principles The principle of virtual work d’Alembert’s principle Hamilton’s...

Preview:

Citation preview

1

Lecture 2. A Day of Principles

The principle of virtual work

d’Alembert’s principle

Hamilton’s principle

(with an example that applies ‘em all at the end)

2

Principle of virtual work says the work done by a virtual displacement from an equilibrium position must be zero.

δW = fi ⋅δri

i=1

N

∑ = 0

This can be used in statics to find forcesWe need to move this up to dynamics

d’Alembert’s principle says that

−ma = −m˙ v can be treated as an

inertial force

3

Combine these

δW = fi − m˙ v i( ) ⋅δri

i=1

N

∑ = 0

We eliminated internal forces last time, so the fs are external

We suppose we know them, and since the displacement is tinythey don’t change during the virtual displacement

4

The virtual displacements, if unconstrained, can be written

δri = δxi + δyj + δzk

What I’d like to do is gather all of this up into what I’ll call configuration space

q = x1 y1 z1 x2 y2 z2 L xK yK zK{ }T

The dimension of q is N = 3K

5

That’s just an example of a configuration space.We’ll see more as we go along.

The general rule, which we’ll investigate as we go along,there are (at least) as many qs as there are degrees of freedom.

We’ll take up the matter of constraints — relations among the qs —later

Bottom line: we can write the rs in terms of the qs.

6

m1 m2

y1 y2

k1 k2k3

Simple example of possible qs

q =y1

y2

⎧ ⎨ ⎩

⎫ ⎬ ⎭

, y1 + y2

y1 − y2

⎧ ⎨ ⎩

⎫ ⎬ ⎭

7

Each r can depend on all the qs.

δri =∂ri

∂qkδqk

i=1

N= 3K

∑ =∂ri

∂qkδqk

repeatedindices

δW = fi − m˙ v i( ) ⋅∂ri

∂qkδqk

i=1

N

∑ = 0

summation convention does not apply to i in this formula

8

fi ⋅∂ri

∂qkδqk

i=1

N

∑ = m˙ v i ⋅∂ri

∂qkδqk

i=1

N

Let’s do some rearranging

fi ⋅∂ri

∂qki=1

N

∑ ⎛

⎝ ⎜

⎠ ⎟δqk = m˙ v i ⋅

∂ri

∂qki=1

N

∑ ⎛

⎝ ⎜

⎠ ⎟δqk

Define the generalized force

Qk = fi ⋅∂ri

∂qki=1

N

∑ ⎛

⎝ ⎜

⎠ ⎟

This force goes with the kth generalized coordinate

9

m˙ v i ⋅∂ri

∂qki=1

N

∑ ⎛

⎝ ⎜

⎠ ⎟δqk = Qkδqk

The left hand side looks a lot like a momentum changedotted into something. If you like manipulations

you’ll LOVE what comes next

First a bit of what I call “integration by parts”

d

dtfg( ) = ˙ f g + f˙ g ⇒ ˙ f g =

d

dtfg( ) − f ˙ g

This is a useful trick in deriving things

10

mi ˙ v i ⋅∂ri

∂qk= mi

d

dtvi ⋅

∂ri

∂qk

⎝ ⎜

⎠ ⎟− mivi ⋅

d

dt

∂ri

∂qk

⎝ ⎜

⎠ ⎟

˙ q j is not a function of

qk

d

dt

∂ri

∂qk

⎝ ⎜

⎠ ⎟=

∂q j

∂ri

∂qk

⎝ ⎜

⎠ ⎟˙ q j

∂∂q j

∂ri

∂qk

⎝ ⎜

⎠ ⎟˙ q j =

∂qk

∂ri

∂q j

⎝ ⎜

⎠ ⎟˙ q j

∂∂qk

∂ri

∂q j

⎝ ⎜

⎠ ⎟˙ q j =

∂qk

∂ri

∂q j˙ q j

⎝ ⎜

⎠ ⎟

∂∂qk

∂ri

∂q j˙ q j

⎝ ⎜

⎠ ⎟=

∂qk˙ r i( ) =

∂vi

∂qk

d

dt( ) =

∂q j ( ) ˙ q j ⇒

11

mi ˙ v i ⋅∂ri

∂qk= mi

d

dtvi ⋅

∂ri

∂qk

⎝ ⎜

⎠ ⎟− mivi ⋅

∂q j

∂ri

∂qk

⎝ ⎜

⎠ ⎟˙ q j

mi ˙ v i ⋅∂ri

∂qk= mi

d

dtvi ⋅

∂ri

∂qk

⎝ ⎜

⎠ ⎟− mivi ⋅

∂vi

∂qk

so

turns into

We still aren’t done. The second term on the right is cool

mivi ⋅∂vi

∂qk =∂

∂qk

1

2mivi ⋅vi

⎝ ⎜

⎠ ⎟=

∂Ti

∂qk

but we need to play with the first term

12

mi

d

dtvi ⋅

∂ri

∂qk

⎝ ⎜

⎠ ⎟

vi =∂ri

∂q j˙ q j ⇒

∂vi

∂˙ q j=

∂ri

∂q j

so

mi

d

dtvi ⋅

∂vi

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟=

d

dt

∂ ˙ q k1

2mivi ⋅vi

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟=

d

dt

∂˙ q kTi( )

⎝ ⎜

⎠ ⎟

sort of a trick

13

m˙ v i ⋅∂ri

∂qki=1

N

∑ ⎛

⎝ ⎜

⎠ ⎟δqk = Qkδqk

turns into

d

dt

∂T

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟−

∂T

∂qk− Qk

⎝ ⎜

⎠ ⎟δqk = 0

Remember that there is a sum on k here!

I can split Qk into two pieces: the potential and nonpotential parts

Qk = −∂V

∂qk+ QNP( )k

so

14

d

dt

∂T

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟−

∂T

∂qk+

∂V

∂qk− QNP( )k

⎝ ⎜

⎠ ⎟δqk = 0

V = V qk( )⇒

∂V

∂˙ q k= 0For our purposes

d

dt

∂ T −V( )∂ ˙ q k

⎝ ⎜

⎠ ⎟−

∂ T −V( )∂qk

− QNP( )k

⎝ ⎜

⎠ ⎟δqk = 0

d

dt

∂ T −V( )∂ ˙ q k

⎝ ⎜

⎠ ⎟−

∂ T −V( )∂qk

⎝ ⎜

⎠ ⎟δqk = QNP( )k

δqk

15

d

dt

∂L

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂qk

⎝ ⎜

⎠ ⎟δqk = Qkδqk

The Lagrangian

L = T −V

If the qk are independent, then we have the Euler-Lagrange equations

From here on in Qk will be understood to be the nonpotential generalized forcesWe’ll have an algorithm for the calculation later.

d

dt

∂L

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂qk

⎝ ⎜

⎠ ⎟= Qk

16

What did we do and what did we assume?

Principle of virtual work

d’Alembert’s principle (inertial forces)

Independence of the generalized coordinates

We will spend a lot of time dealing with cases where the qs are not independent. . . . . but not today . . .

All the rest was clever manipulation

17

??

18

Hamilton’s Principle

This is a formalism that leads to the Euler-Lagrange equationsand it will help us when we need to consider constraints

(relations between the dqs).

This is generally posed in terms of the Lagrangianbut that eliminates the generalized forces

which I’d like to include

Let me define

L* = T + W

where W denotes the work, potential and nonpotential

19

We write the action integral

I = L * qk, ˙ q k, t( )dtt1

t2∫

The action integral depends on the path between the two end points.

20

Hamilton’s principle statesThe actual path will be the path that minimizes the action integral.

Suppose that

qk = qk η( ), qk 0( ) = q0k where the zero denotes the desired path

I η( ) = L * qk η , t( ), ˙ q k η , t( ), t( )dtt1

t2∫

dI η( )dη

= 0 =∂L *

∂qk

∂qk

∂η+

∂L *

∂˙ q k∂˙ q k

∂η

⎝ ⎜

⎠ ⎟dt

t1

t2∫

The first piece is fine; we need to play with the second.

21

∂L *

∂˙ q k∂˙ q k

∂η

⎝ ⎜

⎠ ⎟dt

t1

t2∫ =∂L *

∂˙ q kd

dt

∂qk

∂η

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟dt

t1

t2∫

∂L *

∂˙ q kd

dt

∂qk

∂η

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟dt

t1

t2∫ =d

dt

∂L *

∂˙ q k∂qk

∂η

⎝ ⎜

⎠ ⎟−

d

dt

∂L *

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟∂qk

∂η

⎝ ⎜

⎠ ⎟dt

t1

t2∫

I can integrate the first part. All the paths hit the end points, and the integral is zero.

∂qk

∂η= δqk → 0

I do my integration by parts trick again

qk = q0k +

∂qk

∂ηη = 0

⎝ ⎜ ⎜

⎠ ⎟ ⎟η +L

22

so I have

dI η( )dη

= 0 =∂L *

∂qk−

d

dt

∂L *

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟∂qk

∂ηdt

t1

t2∫ =∂L *

∂qk−

d

dt

∂L *

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟δqkdt

t1

t2∫

and this gives us the Euler-Lagrange equations

No matter how we look at it, we have a governing system

d

dt

∂L

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂qk

⎝ ⎜

⎠ ⎟δqk = Qkδqk

23

from a governing integral

Qk +∂L

∂qk−

d

dt

∂L

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟δqkdt

t1

t2∫

We get the Euler-Lagrange equations if the dqk are independent

We will have issues regarding independenceand solutions for them.

We will have issues regarding the generalized forcesand we’ll develop techniques for finding them.

24

??

25

A special kind of friction: “viscous” friction, damper/dashpot

y€

friction force = −c˙ y

damping constant

26

We can get the force by differentiating something called the Rayleigh dissipation function

F =1

2ν ij ˙ q i ˙ q j

The (unconstrained) Euler-Lagrange equations become

d

dt

∂L

∂˙ q k ⎛

⎝ ⎜

⎠ ⎟+

∂F

∂˙ q k−

∂L

∂qk= Qk

where Qk no longer includes the friction forces

note double summationthe coefficients are the most generalthey will usually be much simpler

27

I’d like to put all this together in some sort of procedure.

??

We can look at some mechanical systems that can be viewed as collections of point masses

OK. Away we go . . .

28

The Euler-Lagrange process

1. Find T and V as easily as you can

2. Apply geometric constraints to get to N coordinates

3. Assign generalized coordinates

4. Define the Lagrangian

29

5. Differentiate the Lagrangian with respect to the derivative of the first generalized coordinate

6. Differentiate that result with respect to time

7. Differentiate the Lagrangian with respect to the same generalized coordinate

8. Subtract that and set the result equal to Q1

∂L

∂˙ q 1

d

dt

∂L

∂˙ q 1 ⎛

⎝ ⎜

⎠ ⎟

∂L

∂q1

d

dt

∂L

∂˙ q 1 ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂q1= Q1

Repeat until you have done all the coordinates

30

M

y1, f1

OVERHEAD CRANE

(y2, z2)

m

q

Steps 1-4 lead us to

T =1

2M + m( ) ˙ q 1

2+

1

2ml2 ˙ q 2

2+ ml ˙ q 1˙ q 2 cosq2

V = −mglcosq2

L =1

2M + m( ) ˙ q 1

2+

1

2ml2 ˙ q 2

2+ ml ˙ q 1˙ q 2 cosq2 + mglcosq2

(start without the generalized forces)

y1 = q1, θ = q2

31

For q1

5. ∂L

∂˙ q 1= M + m( ) ˙ q 1 + ml ˙ q 1 cosq1

6. d

dt

∂L

∂˙ q 1 ⎛

⎝ ⎜

⎠ ⎟= M + m( )˙ ̇ q 1 + mlcosq1˙ ̇ q 2 − ml ˙ q 2

2sinq2

7. ∂L

∂q1= 0

8. d

dt

∂L

∂˙ q 1 ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂q1= M + m( )˙ ̇ q 1 + mlcosq2˙ ̇ q 2 − ml ˙ q 2

2sinq2 = 0

L =1

2M + m( ) ˙ q 1

2+

1

2ml2 ˙ q 2

2+ ml ˙ q 1˙ q 2 cosq2 + mglcosq2

32

For q2

5. ∂L

∂˙ q 2= ml2 ˙ q 2 + ml ˙ q 1 cosq2

6. d

dt

∂L

∂˙ q 2 ⎛

⎝ ⎜

⎠ ⎟= ml2˙ ̇ q 2 + ml˙ ̇ q 1 cosq2 − ml ˙ q 1˙ q 2 sinq2

7. ∂L

∂q2= −ml ˙ q 1˙ q 2 sinq2 − mglsinq2

8. d

dt

∂L

∂˙ q 2 ⎛

⎝ ⎜

⎠ ⎟−

∂L

∂q2= ml2˙ ̇ q 2 + ml˙ ̇ q 1 cosq2 − ml ˙ q 1˙ q 2 sinq2 + ml ˙ q 1˙ q 2 + mgl( )sinq2 = 0

L =1

2M + m( ) ˙ q 1

2+

1

2ml2 ˙ q 2

2+ ml ˙ q 1˙ q 2 cosq2 + mglcosq2

33

8a. M + m( )˙ ̇ q 1 + mlcosq2˙ ̇ q 2 − ml ˙ q 22sinq2 = 0

8b. ml2˙ ̇ q 2 + ml˙ ̇ q 1 cosq2 − ml ˙ q 1˙ q 2 sinq2 + ml ˙ q 1˙ q 2 + mgl( )sinq2 = 0

The governing equations are then

8a. M + m( )˙ ̇ y 1 + mlcosθ ˙ ̇ θ − ml ˙ θ 2 sinθ = 0

8b. ml2˙ ̇ θ + ml˙ ̇ y cosθ − ml˙ y ̇ θ sinθ + ml˙ y ̇ θ + mgl( )sinθ = 0

Put the physical variables back so it looks more familiar

This is all without forcing or damping — let’s add those

34

M

y1, f1

OVERHEAD CRANE

(y2, z2)

m

q

If y1 changes, f1 does workQ1 = f1

If q changes, t1 does workQ2 = t1

add a torque, t1

If y1 changes, t1 does no workQ1 does not change

If q changes, f1 does no workQ2 = 0

(with forces)

35

The governing equations were

8a. M + m( )˙ ̇ y + mlcosθ ˙ ̇ θ − ml ˙ θ 2 sinθ = 0

8b. ml2˙ ̇ θ + ml˙ ̇ y cosθ − ml˙ y ̇ θ sinθ + ml˙ y ̇ θ + mgl( )sinθ = 0

We added the generalized forces

8a. M + m( )˙ ̇ y + mlcosθ ˙ ̇ θ − ml ˙ θ 2 sinθ = Q1 = f1

8b. ml2˙ ̇ θ + ml˙ ̇ y cosθ − ml˙ y ̇ θ sinθ + ml˙ y ̇ θ + mgl( )sinθ = Q2 = τ 1

Now we need the Rayleigh dissipation function

36

F =1

2c ˙ θ 2

The damper works when the angle changes, but not when the cart movesSo, the Rayleigh dissipation function for this problem is

∂F∂ ˙ y

= 0, ∂ F

∂ ˙ θ = c ˙ θ

8a. M + m( )˙ ̇ y + mlcosθ ˙ ̇ θ − ml ˙ θ 2 sinθ = f1

8b. ml2˙ ̇ θ + ml˙ ̇ y cosθ − ml˙ y ̇ θ sinθ + ml˙ y ̇ θ + mgl( )sinθ + c ˙ θ = τ 1

37

We aren’t really up to discussing solving these problems,but let me say a few things that we will revisit.

M + m( )˙ ̇ y + mlcosθ ˙ ̇ θ − ml ˙ θ 2 sinθ = f1

ml2˙ ̇ θ + ml˙ ̇ y cosθ − ml˙ y ̇ θ sinθ + ml˙ y ̇ θ + mgl( )sinθ + c ˙ θ = τ 1

a pair of coupled second order ordinary differential equations

It would be nice to have first order equations

There are lots of ways to do this, and we’ll look at many of thembut the simplest is to let

˙ q i = ui

38

Then we’ll have

M + m( ) ˙ u 1 + mlcosq2 ˙ u 2 − mlu22sinq2 = f1

mlcosθ ˙ u 1 + ml2 ˙ u 2 − mlu1u2 sinq1 + mlu1u2 + mgl( )sinq2 + cu2 = τ 1

˙ q 1 = u1

˙ q 2 = u2

If you supply a force, a torque and initial conditionsyou can solve this set numerically.

39

You can solve for the variables, which I won’t do because it is pretty messy, and you’ll wind up with

d

dt

q1

q2

u1

u2

⎨ ⎪ ⎪

⎩ ⎪ ⎪

⎬ ⎪ ⎪

⎭ ⎪ ⎪

=

u1

u2

rhs( )3

rhs( )4

⎪ ⎪

⎪ ⎪

⎪ ⎪

⎪ ⎪

Later on we’ll learn to call this a state vector

Recommended