texas a&m university, department of aerospace engineering an embedded function tool for modeling...

22
Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING D. Todd Griffith, James D. Turner, and John L. Junkins Texas A&M University Department of Aerospace Engineering College Station, TX 77840

Upload: heather-marshall

Post on 17-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN

AEROSPACE ENGINEERING

D. Todd Griffith, James D. Turner, and John L. Junkins

Texas A&M University

Department of Aerospace Engineering

College Station, TX 77840

Page 2: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Presentation Outline

•Introduction

•Overview of automatic differentiation by OCEA

•Development of higher-order GLSDC algorithms

•Examples

Page 3: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Introduction (1)

Estimation of dynamical systems broadly addresses the following challenge:

“Given your best model of a dynamical system, including sensors, and given the erroneous measured output of sensors, now what?!” (*)

(*) Junkins First Sermon on Estimation of Dynamical Systems

0 0( ) ( , ( )); ( )t t t t x f x x x

( ( ))ty h x

Dynamics model:

Measurement model:

Typically, first order differential correction method utilized:

1ˆ ˆ ˆk k k x x x

1ˆ ( )T Tk kH WH H W x y

0 ˆ( )

Ht

kx

h

x

ˆ( )k k y y h x

Page 4: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Introduction (2)

In this work, we develop higher-order (first through fourth-order) generalizations of the Gaussian Least Squares Differential Correction (GLSDC) algorithm.

These generalizations are implemented by using a Reversion of Series Solution:

2 3 4

2 3 4

1 1 1...

2! 3! 4!guess guessg g g g

dx d x d x d xx x x

ds ds ds ds

1

1

( )guesss

dxG h x

ds

2

1 22

1 11 s ss

d x dx dxG G

ds ds ds

, and so on……..

Page 5: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Presentation Outline

•Introduction

•Overview of automatic differentiation by OCEA

•Development of higher-order GLSDC algorithms

•Examples

Page 6: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Overview of automatic differentiation by OCEA (1)

• OCEA (Object Oriented Coordinate Embedding Method) – Extension for FORTRAN90 (F90) written by James D. Turner

– Automatic Differentiation (AD) equation manipulation package in which new data types are created in order to define independent and dependent variables (functions)

• OCEA description– Automatic differentiation enabled by coding rules for differentiation -

Chain rule of calculus

– Can compute first through fourth-order partial derivatives of scalar, vector, matrix, and higher order tensors

– Standard mathematical library functions (e.g. sin, cos, exp) are overloaded

– Scalars are replaced by differential n-tuple, for second-order:

2:f f f f

Page 7: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Overview of automatic differentiation by OCEA (2)

• OCEA description (cont’d)– Intrinsic operators such as ( +, - , * , / , = ) are also overloaded to enable,

for example, addition and multiplication of OCEA variables:

– Partial derivative computation is hidden to the user - takes place in the background without user intervention.

– Access to partial derivatives (e.g. Jacobian, Hessian, etc.) made simple by overloading of the “ = “ sign.

2 2:a b a b a b a b

* : * * *i j ia b a b a b a b

Page 8: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Overview of automatic differentiation by OCEA (3)

• The need for computation of partial derivatives is found in numerous applications

• Previous applications include

– Root solving and Optimization

– Automatic generation and integration of equations of motion (AAS 04-242)

• In this paper, we consider higher-order GLSDC algorithms………………….

Page 9: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Presentation Outline

•Introduction

•Overview of automatic differentiation by OCEA

•Development of higher-order GLSDC algorithms

•Examples

Page 10: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Higher-order GLSDC Algorithms (1)

( ( ))ty h xGiven the generic nonlinear measurement model...

First, we look at computing the required sensitivities for the Series Reversion Solution.

… the task is to compute partial derivatives of this model w.r.t. the unknown parameters ---> Sensitivities

, , , , 0( , )i j i s s j i s sjh h x h t t ox h

2, , , , , , i jk i s s jk i st t k s jh h x h x x

ox h

1st order:

2nd order:

Need to compute first and higher-order state transition matrices……..

, 0 0 , 0 0( , , ) ( , ) ( , )i s sjk i st tk sjh t t t h t t t t

Page 11: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Higher-order GLSDC Algorithms (2)

Notation for higher-order state transition matrices

1st order:

2nd order:

3rd order:

4th order:

( )( , )

( )i

ij ij oj o

tt t

t

x

x

2 ( )

, ,( ) ( )

iijk ijk o o

j o k o

tt t t

t t

x

x x

3 ( )

, , ,( ) ( ) ( )

iijkl ijkl o o o

j o k o l o

tt t t t

t t t

x

x x x

4 ( )

, , , ,( ) ( ) ( ) ( )

iijklm ijklm o o o o

j o k o l o m o

tt t t t t

t t t t

x

x x x x

Page 12: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Higher-order GLSDC Algorithms (3)

( ) ( ) ( , ( ))o

t

i i o i

t

x t x t f d x

Higher-order state transition matrix differential equations

( ) ( , ( ))i ix t f t t x

Repeated differentiation of the integral form of the equations of motion, followed by time differentiation, leads to first and higher-order state transition matrix differential equation:

,ij i s sjf

, ,ijk i s sjk i st tk sjf f

, , , , ,ijkl i s sjkl i su ul sjk i st tk sjl i st tkl sj i stu ul tk sjf f f f f

Fourth-order equations too long to show here, but are computed by continuing from above………………….

Page 13: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Higher-order GLSDC Algorithms (4)

Summary

The automatic differentiation capability allows the analyst to produce a general estimation tool because the dynamical model and the measurement model can be simply specified and differentiated. The work involved in computing and validating partial derivatives by hand is not required.

,ij i s sjf

, ,ijk i s sjk i st tk sjf f

Dynamics model partials

Measurement model partials

, ,i j i s sjh h

, , , i jk i s sjk i st tk sjh h h

Page 14: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Presentation Outline

•Introduction and previous work

•Overview of automatic differentiation by OCEA

•Development of higher-order GLSDC algorithms

•Examples

Page 15: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Ballistic Projectile Identification Problem (1)

Here, we estimate model parameters for pitch, and yaw, angle models for an aerodynamically and inertially symmetric projectile.

Models for the angles given by:

1 2

3

1 1 1 2 2 2

3 3 3 4

( , ) cos( ) cos( )

cos( )

t t

t

t k e t k e t

k e t k

x

1 2

3

1 1 1 2 2 2

3 3 3 5

( , ) sin( ) sin( )

sin( )

t t

t

t k e t k e t

k e t k

x

14 unknown parameters include:

1 2 3 4 5 1 2 3 1 2 3 1 2 3, , , , , , , , , , , , ,k k k k k x

Page 16: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Ballistic Projectile Identification Problem (2)SUBROUTINE NONLINEAR_FX( T, EB_VAR, EB_FCTN )

USE EB_HANDLINGIMPLICIT NONE

! ARGUMENT LIST VARIABLESREAL(DP)::TTYPE(EB), DIMENSION(NV), INTENT(IN ):: EB_VARTYPE(EB), DIMENSION(NF), INTENT(INOUT):: EB_FCTN

! DEFINE LOCAL + EMBEDDED VARIABLESTYPE(EB):: K1, K2, K3, K4, K5, LAM1, LAM2, LAM3, OMEG1, OMEG2,

OMEG3, DEL1, DEL2, DEL3

! ASSIGN LOCAL VARIABLESK1=EB_VAR(1);K2=EB_VAR(2);K3=EB_VAR(3);K4=EB_VAR(4);K5=EB_VAR(5)LAM1=EB_VAR(6);LAM2=EB_VAR(7);LAM3=EB_VAR(8)OMEG1=EB_VAR(9);OMEG2=EB_VAR(10);OMEG3=EB_VAR(11)DEL1=EB_VAR(12);DEL2=EB_VAR(13);DEL3=EB_VAR(14)

! COMPUTE NONLINEAR FUNCTION USING EMBEDDED ALGEBRA

EB_FCTN(1) = K1*EXP(LAM1*T)*COS(OMEG1*T+DEL1) + K2*EXP(LAM2*T)*&

COS(OMEG2*T+DEL2) + K3*EXP(LAM3*T)*COS(OMEG3*T+DEL3) + K4

EB_FCTN(2) = K1*EXP(LAM1*T)*SIN(OMEG1*T+DEL1) + K2*EXP(LAM2*T)*&

SIN(OMEG2*T+DEL2) + K3*EXP(LAM3*T)*SIN(OMEG3*T+DEL3) + K5

END SUBROUTINE NONLINEAR_FX

Page 17: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Ballistic Projectile Identification Problem (3)

Cost for Ballistic Projectile Identification Problem

Iteration First order Second order1 0.46453E+04 0.46453E+042 0.70828E+03 0.40676E+033 0.15229E+03 0.21104E+024 0.12652E+02 0.39243E-025 0.88894E-01 0.19141E-116 0.78899E-057 0.19504E-11

Page 18: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Planar orbit example (1)

r

V

2x

1x

31

42

33

4 4

0

xx

xx

px Vx

x g px V

p

x

drag pf V VDrag model:

2 21 2

12 1tan ( / )

r x x

x x

h

EQM:

Measurements:

1 0

2 0

1 0

2 0

( ) 1000

( ) 2500

( ) 200

( ) 100

0.001

x t

x t

x t

x t

p

Truth:

Observed for 20 seconds at 1 second intervals

Page 19: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Planar orbit example (2)

Case I: Zero drag

Convergence Study for Case I

Initial guessFirst Order

Iteration CountSecond Order

Iteration Count0.9 truex , 1.0 truex 5 4

0.9 truex , 0.9 truex 5 4

0.9 truex , 0.8 truex 5 4

0.9 truex , 0.7 truex 5 4

0.9 truex , 0.6 truex 5 4

0.9 truex , 0.5 truex 6 4

0.9 truex , 0.4 truex 6 5

0.9 truex , 0.3 truex 6 5

0.9 truex , 0.2 truex 7 5

0.9 truex , 0.1 truex 7 5

0.9 truex , 0.0 truex 8 6

Page 20: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Planar orbit example (3)

Case II: With drag

Convergence Study for Case II

Initial guess

First OrderIterationCount

Second OrderIterationCount

0.9 truex , 1.0 truex , p = 0.95*ptrue 5 4

0.9 truex , 0.9 truex , p = 0.95*ptrue 5 5

0.9 truex , 0.8 truex , p = 0.95*ptrue 5 6

0.9 truex , 0.7 truex , p = 0.95*ptrue 5 6

0.9 truex , 0.6 truex , p = 0.95*ptrue 6 7

0.9 truex , 0.5 truex , p = 0.95*ptrue 6 8

Page 21: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Another look at the Reversion of Series Solution

2 3 4

2 3 4

1 1 1...

2! 3! 4!guess guessg g g g

dx d x d x d xx x x

ds ds ds ds

First-order

Second-order

And, so on…..

Page 22: Texas A&M University, Department of Aerospace Engineering AN EMBEDDED FUNCTION TOOL FOR MODELING AND SIMULATING ESTIMATION PROBLEMS IN AEROSPACE ENGINEERING

Texas A&M University, Department of Aerospace Engineering

Conclusions

•Introduced an automatic differentiation (AD) tool OCEA

•Presented higher-order Gaussian Least Squares Differentiatal Correction (GLSDC) algorithms

•Simulated two examples using first and second-order algorithms

•Future work includes:

–Simulation of third and fourth-order algorithms

–Extensions in propagation of uncertainty