16
Symbolic Code Generation & Differentiation Doug James

Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Symbolic Code Generation& Differentiation

Doug James

Page 2: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Motivation: Bending Force

Now take a second derivative!

Page 3: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Symbolic math tools

• Useful for differentiation & optimized code gen.

• Examples:

• Maple

• Matlab

• Mathematica

• ...

Page 4: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Motivation 2:Newton-Schulz Iteration

• See whiteboard

Page 5: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 1Evaluate the algebraic expression

where

Page 6: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 1

Page 7: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 1

Page 8: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 2

Page 9: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 2

Page 10: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 2

Doh!Doh!

Doh!Doh!

Doh!

Doh!

Page 11: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 3: Newton-Schulz Iteration

• See code

Page 12: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 4: Neo-Hookean material

Page 13: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 4: Neo-Hookean material

Page 14: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Example 4: Ogden material

See code output(!)

Page 15: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Automatic Differentiation:Many compilers available

Page 16: Symbolic Code Generation & Differentiation · 2009. 2. 4. · Symbolic math tools • Useful for differentiation & optimized code gen. • Examples: • Maple • Matlab • Mathematica

Automatic Differentiation:Many compilers available