A Term Rewriting System for the Calculus of Moving Surfacesmwb33/issac2013/mwb33_issac2013.pdf · A...

33
A Term Rewriting System for the Calculus of Moving Surfaces Mark Boady, Pavel Grinfeld, Jeremy Johnson Drexel University June 27, 2013 Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Transcript of A Term Rewriting System for the Calculus of Moving Surfacesmwb33/issac2013/mwb33_issac2013.pdf · A...

A Term Rewriting System for the Calculus of

Moving Surfaces

Mark Boady, Pavel Grinfeld, Jeremy Johnson

Drexel University

June 27, 2013

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Overview

The Calculus of Moving Surfaces

The kinds of problems it can solve

Why it needs an automated approach

The implementation of our Term Rewrite System

Research Results

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

The Calculus of Moving Surfaces

We have a surface and the we know properties of the surface.

We change the shape of the surface.

How does the surface changing affect the properties of thesurface?

The Calculus of Moving Surfaces is an analytic framework forstudying surfaces with evolving shapes.

image by Steve Ford Elliott (2005)

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Acoustics

We know the acoustic properties of a concert hall.

Perelman Theater at the Kimmel Center in Philadelphia

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Acoustics

How do the acoustics change if we extend the concert hall?

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Calculus of Moving Surfaces

The Calculus of Moving Surfaces

A calculus for studying surfaces that change shapePioneered by Hadamard in 1903

The invariant time derivative ∇Allows us to study how properties change with respect to thesurface changing shape over time

The coordinate system on the surface is changing as timepasses

The CMS extends Tensor CalculusTensor Calculus gives expressions that can be evaluated in anycoordinate systemAutomation has been very successful in the Tensor Calculus

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

The Invariant Time Derivative

We have a Scalar Field F

Given a point on the surface it maps to a number

At time t, the surface is St

After h time has passed the new surface is St+h

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Calculus of Moving Surfaces

The Calculus of Moving Surfaces is a Symbolic Calculus

Analytical study of deforming surfaces

Objects represent properties of the surface

Bαβ , the curvature tensor

Describes the curvature of the surfaceThe trace is the mean curvature of the surface

The ∇ derivative is difficult to calculate

We have rules to take the ∇ derivative of each object

∇Bαβ = ∇α∇βC + CBα

γ Bγβ

Rules transform expressions into equivalent expressions thatcan be evaluated

Evaluate the expression by choosing a coordinate system

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Term Rewriting System

Encode the properties of the CMS as rewrite rules

Start with a symbolic expression

Systematically apply rules to transform the expression

Stop when no more rules can be applied (Normal Form)

Normal Forms are Simplified Expressions

An expression that is easier to evaluateAll functions only need to be evaluated on the initial surface(t = 0)

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

The contour length of the unit circle is 2π

We stretch the circle into an ellipse with eccentricity

What is the formula for the new contour length in terms of ?

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

The contour length is L(t) =St1dSt

What is the contour length, L(t = 1), of an ellipse withsemiaxes 1 and 1 + ?

Form a Taylor Series by taking derivatives of L(t)L(1) = L(0) + L(0) + 1

2L(0) + 1

6L(0) + · · ·

More terms lead to a more accurate result

L(t) = ∇

S 1dS=S

∇1− CBα

α

ds = −

S CB

ααdS

L(0) = π

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

L(t) = ∇−S CB

ααdS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

L(t) = ∇−S CB

ααdS

→S

−∇ (CBα

α ) + C 2BααB

ββ

dS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

L(t) = ∇−S CB

ααdS

→S

−∇ (CBα

α ) + C 2BααB

ββ

dS

→S

−Bα

α ∇C − C∇Bαα + C 2Bα

αBββ

dS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

L(t) = ∇−S CB

ααdS

→S

−∇ (CBα

α ) + C 2BααB

ββ

dS

→S

−Bα

α ∇C − C∇Bαα + C 2Bα

αBββ

dS

→S

−Bα

α ∇C − C∇α∇αC + CBα

γ Bγα+ C 2Bα

αBββ

dS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

L(t) = ∇−S CB

ααdS

→S

−∇ (CBα

α ) + C 2BααB

ββ

dS

→S

−Bα

α ∇C − C∇Bαα + C 2Bα

αBββ

dS

→S

−Bα

α ∇C − C∇α∇αC + CBα

γ Bγα+ C 2Bα

αBββ

dS

→S

−Bα

α ∇C − C∇α∇αC + C 2Bαγ B

γα + C 2Bα

αBββ

dS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

−Bαα ∇C

Temp0:=contract(prodlist(

intTensor( -1 ),

BAb, C1)

, [1,2]):

Temp0:=Temp0:-apply([θ,0]):−C∇α∇αC

Temp1:=contract(prodlist(

intTensor( -1 ),

C0, ddSA( ddSa( C0 )))

, [1,2]):

Temp1:=Temp1:-apply([θ,0]):

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

C 2Bαγ B

γα

Temp2:=contract(prodlist(

intTensor( -1 ),

BAb, BAb, TensorExp(C0, 2))

, [1,4 , 2,3]):

Temp2:=Temp2:-apply([θ,0]):C 2Bα

αBββ

Temp3:=contract(prodlist(

BAb, BAb, TensorExp( C0, 2))

, [3,4 , 1,2]):

Temp3:=Temp3:-apply([θ,0]):S

−Bα

α ∇C − C∇α∇αC + C 2Bαγ B

γα + C 2Bα

αBββ

dS

total:=lin_com(Temp0, Temp1, Temp2, Temp3):

solution:=int(total,theta=0..2π);

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Contour Length

Reach Normal Form for Expression

L(t) =S

−Bα

α ∇C − C∇α∇αC + C 2Bαγ B

γα + C 2Bα

αBββ

dS

Select Coordinate System and Export to Maple

Evaluate to get final answer

L(0) = 14

We use these terms to form a Taylor Series

L(t = 1) =2 + + 1

82 − 1

163 + 17

5124 − 19

10245 + · · ·

π

L(t = 1) = 2π0

(1 + ) 2 cos2 θ + sin2 θdθ

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

What is the series in for the simple Laplace-Dirchleteigenvalues on an ellipse with semi-axes 1 and 1 + ?

Solve the system of equations for unknowns u and λ

u + λu = 0u|S = 0Ω u2dΩ = 1

The Laplace-Dirchlet eigenvalues are given by the Taylor series

λellipse(1) = λ(0) + λ(0) + 12λ

(0) + 16λ

(0) + · · ·λ(0) = λcircle

The accuracy of the answer depends on the number ofderivatives

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Rules

Properties of the Covariant Derivative∇α(FG ) → G∇α(F ) + F∇α(G )∇α(x1) → 0∇α(F + G ) → ∇α(F ) +∇α(G )∇α(

i F

···i ······i ··· ) →

i ∇α(F ···i ···

···i ··· )Properties of the Partial Derivative∂FG∂t → F

∂G∂t + G

∂F∂t

∂x1∂t → 0∂(F+G)

∂t → ∂F∂t + ∂G

∂t∂

i F···i······i···

∂t →

i∂F ···i···

···i···∂t

∂∇αF∂t → ∇α

∂F∂t

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Rules

Differential Table∇Z i

α → N i∇αC

∇N i → −Z iα∇αC

∇Bαβ → ∇α∇βC + CBα

γ Bγβ

∇C x1 → x1Cx1−1∇C

∇x1 → 0∇F → ∂F

∂t + CN i∇iF

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Rules

Properties of ∇∇

i F···i ······i ···

i

∇F ···i ···

···i ···

∇ (FG ) → G∇ (F ) + F ∇ (G )∇(F + G ) → ∇F + ∇G

∇∇αA → ∇α∇A+ CBγα∇γA

∇∇αAβ → ∇α∇Aβ + CB

γα∇γA+ R

β.γαA

γ

∇∇αAβ → ∇α∇Aβ + CBγα∇γAβ − R

γ.βαAγ

Additional RulesAx1Ax2 → Ax1+x2

A+ 0 → A

A(F + G ) → AF + AG

0A → 0

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

These rules are sufficient to find arbitraty combinations ofderivatives in boundary perturbation problems

The rules are confluent

Order of application does not change final answer

The rules are terminating

A normal form will be reached for any input

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Implementation

Implemented a custom TRS in JAVA

Inheritance for related objects and rulesExpression Subtree Matching

Equivalence modulo

AssociativityCommuntativityIndex JugglingIndex RenamingExample: Bα

βBβγ B

γαB

δδ = Bγ

γBδβBβαB

βδ

Maple Library for Evaluation

Built on existing Array manipulation tools

Code Generation

Objects used by the TRS are also used for code generationSelect a coordinate systemGenerate Maple code for evaluation in coordinate system

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

λ(t) =−

SC∇iu∇i

udS

λ(0) =− λ

λ(t) =∇−

SC∇iu∇i

udS

=

S

C

2B

αα∇i

u∇iudS −

S

∇C∇i

u∇iu

dS

S

2C∇i ∂u

∂t∇iu

dS −

S

2C 2

Ni∇ju∇j∇iu

dS

λ(0) =3

2λ+

1

4λ2

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

λ(t) =

SC

3B

αβB

βα∇i

u∇iudS −

S2C 3

NjN

k∇iu∇i∇k∇judS

+

S4C 3

BααN

j∇iu∇i∇judS −

S4∇C∇i ∂u

∂t∇iudS

S2C 3

NjN

k∇i∇ju∇k∇iudS −

SC

3B

ββB

αα∇i

u∇iudS

+

S4C 2

Bαα∇i ∂u

∂t∇iudS +

SC

2∇iu∇iu∇α∇αCdS

S4C 2

Nj∇iu∇i∇j

∂u

∂tdS +

S3CBα

α ∇C∇iu∇iudS

S4C 2

Nj∇i ∂u

∂t∇j∇iudS −

S2C∇i∇2

C∇iudS

S∇2

C∇iu∇iudS +

S2C 2

Zjα∇iu∇i∇ju∇α

CdS

S2C∇i

∂u

∂t∇i ∂u

∂tdS −

S6C∇CN

j∇iu∇i∇judS

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Expression Swell

Taking repeated derivatives causes expression swellHigher order derivatives provide a more accurate seriesNumber of terms grows exponentially

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Expression Swell

The time to evaluate also increases with the order ofderivatives

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

λ(0) =− λ

λ(0) =3

2λ+

1

4λ2

λ(0) =− 3λ− 3

2λ2

λ4(0) =15

2λ+

15

2λ2 +

87

128λ3 − 21

256λ4

λ5(0) =− 45

2λ− 75

2λ2 − 1305

128λ3 +

315

256λ4

λ6(0) =315

4λ+

1575

8λ2 +

27405

256λ3 − 11155

1536λ4 − 2665

1536λ5 +

145

1024λ6

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Laplace-Dirchlet Eigenvalues

λ (ε) =λ+−1

2λ ε2 +

− 3

16λ+

1

32λ2

ε4 +

− 3

32λ+

1

64λ2

ε6

+

− 7

128λ+

3

512λ2 +

29

16384λ3 − 7

32768λ4

ε8

+

− 9

256λ+

1

1024λ2 +

87

32768λ3 − 21

65536λ4

ε10 + O(ε12)

Expanded Series to higher order then previously calculated

Found errors in previously published lower terms

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Conclusions

The Calculus of Moving Surfaces is an Analytic Framework forstudying the deformation of surfaces.

It can be used to study the properties of surfaces that changeshape.

Boundary VariationsShape OptimizationsBiological Models (Modeling Blood Cell Membranes)Fluid Film Dynamics (Modeling Soap Films)

We have implemented the first TRS for the CMS

Enables research to use the CMSEasily extensible TRS

We have used our system find a more accurate series for theLaplace-Dirchlet Eigenvalues on an ellipse.

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces

Future Work

What is the series in 1N for the simple Laplace-Dirchlet

eigenvalues on a regular polygon with N sides? (Grinfeld andStrang 2004)

λN = λ1 + 4ζ(2)

N2 + 4ζ(3)N3 + 28ζ(4)

N4 + · · ·

Manipulation of Fourier SeriesImplement Additional Rules from the CMSImprove Efficiency and Decrease Expression SwellEliminate Redundent Calculations

Mark Boady, Pavel Grinfeld, Jeremy Johnson A Term Rewriting System for the Calculus of Moving Surfaces