CS205B / CME306 Homework 3 Rotation Matrices 1. The ODE that describes rigid body evolution is given by R = ω R. (a) Write down the forward Euler update for this equation. R n+1 = R n + tω R n (b) Show that the updated rotation matrix computed from this update is not orthogonal. R n+1 (R n+1 ) T = (R n + tω R n )(R n + tω R n ) T = R n (R n ) T + tω R n (R n ) T + tr n (ω R n ) T + t 2 (ω ) T R n (R n ) T ω = I + tω R n (R n ) T tr n (R n ) T ω t 2 ω ω = I t 2 ω ω Thus, R n+1 is orthogonal if and only if t = 0 or ω = 0. (c) How might one fix this matrix that is almost a rotation to make it rotation? There are several choices that could be made correct the matrix to be orthogonal. The one often seen in practice is to observe the SVD of R = UΣV T, and take ˆR = UV T ie. discarding the non-unity singular values. 2. Another update equation is R n+1 = e t(ωn ) R n. Here, ω is the cross product matrix, where ω v = ω v. The exponential map e A can be defined for square matrices using the taylor series expansion e ta = I + ta + t2 2 A2 + t3 6 A3 +... (a) Show that this update equation is a first order approximation of the ODE R = w R that it is meant to solve. R n+1 = e t(ωn ) R n = (I + tω + O( t 2 ))R n = R n + tω R n + O( t 2 ) (b) Show that the result of this update is orthogonal. (R n+1 ) T R n+1 = (e t(ωn ) R n ) T e t(ωn ) R n = (R n ) T e t(ωn ) e t(ωn ) R n = (R n ) T e 0 R n = (R n ) T R n = I 1
(c) Find a closed form expression for this update rule. We first begin by observing that ω satisfies its own characteristic polynomial. This immediately implies (ω ) 3 = ω ω, which allows us to collapse the infinite sum from the exponential mapping into something familiar. R n+1 = e t(ωn ) R n ( ) t m (ω ) m = R n m! m=0 ( [ ( 1) m t 2m+1 ( ω ) 2m = I + ω + ( 1)m t 2m+2 ( ω ) 2m ] ) (ω ) 2 R n (2m + 1)! (2m + 2)! m=0 ( = I + sin( t ω ) ω + 1 cos( t ω ) ) ω ω 2 (ω ) 2 ω R n = ( I + sin(θ)u + (1 cos(θ))(u ) 2) R n Where θ = tω and u = ω ω. It should be noted here that this update is well-known, and is often referred to as the Rodrigues rotation formula. (d) Give an intuitive description of what this update rule is doing. The angular velocity ω is the rate of rotation, and the direction of ω is the axis about which the rotation is performed. θ then is how much the body should be rotated, and u the axis of rotation. The exponential mapping gives us exactly the rotation matrix which does this. 2
Modified Equations Consider the advection equation u t + au x = 0. The numerical methods below satisfy modified equations to higher order than the advection equation itself. See Leveque 8.6 and the discussion notes for more on modified equations. Assume λ = t x = constant. A. Explicit central differencing Find a modified equation for which explicit central differencing gives an O( t 2 ) approximation. What modification to the explicit central differencing scheme does this suggest to make it a stable numerical scheme for the advection equation? Let Q n i denote the numerical approximation. The explicit central differencing scheme is given by Q n = 0 (1) Assume we have a function, v(x, t) that satisfies (1) exactly. Then v(x, t + ) v(x, t) The Taylor series expansions of the terms in v about about (x, t) are v(x + x, t) v(x x, t) + a = 0 (2) v(x, t + ) = v(x, t) + v t (x, t) + 1 2 2 v tt (x, t) + O( 3 ) v(x ± x, t) = v(x, t) ± xv x (x, t) + 1 2 x2 v xx (x, t) + O( x 3 ) Substituting these expressions into (2) and rearranging gives v t + av x + 1 2 v tt = O( 2 ) (3) We would like to approximate the v tt by a spatial derivative. From (2) we have Differentiating with respect to x and then t we get v t + av x = O() v tx + av xx = O() v tt + av xt = O() Multiplying the first equation by a and subtracting from the second, we get Substituting (4) into (3), we have Therefore the modified equation is v tt = a 2 v xx + O() (4) v t + av x = 2 a2 v xx + O( 2 ) v t + av x = 2 a2 v xx (5) 3
The modified equation has a dissipative term with a negative coefficient, and is therefore ill-posed. This suggests that to stabilize the scheme, we should add enough numerical dissipation to make the coefficient non-negative. If we add in the central difference approximation to 2 a2 v xx, we get Q n = 2 a2 Qn +1 2Qn + Qn 1 x 2 (6) which is the Lax-Wendroff scheme. Alternatively, we can observe that as long as the CFL condition x a 1 holds, 2 a2 x 2 2, so another possible scheme is 2 Q n Rearranging this expression gives = x 2 Q n +1 2Qn + Qn 1 2 2 x 2 which is the Lax-Friedrichs scheme. 1 2 (Qn +1 + Qn 1 ) = 0 B. Find a modified equation for which your proposed method gives an O( t 3 ) approximation. The Lax-Wendroff scheme is given in (6) above. (6) exactly. Then Assume we have a function, v(x, t) that satisfies v(x, t + ) v(x, t) v(x + x, t) v(x x, t) + a Expanding the terms in v in Taylor series about (x, t) and rearranging gives = v(x + x, t) 2v(x, t) + v(x x, t) a2 2 x 2 (7) v t + av x + 1 2 v tt 1 2 a2 v xx + 1 6 2 v ttt + 1 6 a x2 v xxx = O( 3 ) (8) Again, we would like to approximate the terms v tt and v ttt in terms of the spatial derivatives of v. From (8) we have that v t = av x + O() (9) By differentiating this expression twice with respect to t and applying it to replace temporal derivatives with spatial derivatives in the RHS, we get v ttt = a 3 v xxx + O() (10) Now we wish to approximate the v tt term with a spatial derivative term. From (8) we have that From (9), Combining this with (11) gives v t + av x + 1 2 (v tt a 2 v xx ) = O( 2 ) (11) v tt = a 2 v xx + O() (12) v t + av x = O( 2 ) (13) v tt = a 2 v xx + O( 2 ) (14) 4
Substituting (10) and (14) into (8), we get Therefore, the modified equation is v t + av x 1 6 a3 2 v xxx + 1 6 a x2 v xxx = O( 3 ) (15) or v t + av x = 1 6 a3 2 v xxx 1 6 a x2 v xxx v t + av x = 1 6 a x2 (1 a 2 2 x 2 )v xxx 5