29
Skirting subsets of the plane with application to marginal stability curves G. D. McBain [email protected] School of Aerospace, Mechanical, & Mechatronic Engineering The University of Sydney, AUSTRALIA CTAC 2003 – p.1/29

Skirting subsets of the plane, with application to marginal stability curves

Embed Size (px)

Citation preview

Page 1: Skirting subsets of the plane, with application to marginal stability curves

Skirting subsets of the planewith application to marginal stability curves

G. D. McBain

[email protected]

School of Aerospace, Mechanical, & Mechatronic Engineering

The University of Sydney, AUSTRALIA

CTAC 2003 – p.1/29

Page 2: Skirting subsets of the plane, with application to marginal stability curves

The problem

Approximate the margin of a predicate on the plane.

Given a point (x, y) in the plane R2,

and a PREDICATE P : R2 → {T, F},

a MARGINAL POINT of P is one for which everyneighbourhood contains a ‘true point’ and a ‘false point’.

No ‘neutral’ points (the ‘principle of excluded middle’).

Example of a predicate:Is the place at a given longitude and latitude abovesea level?The margin is the coastline.

CTAC 2003 – p.2/29

Page 3: Skirting subsets of the plane, with application to marginal stability curves

The problem (cont.)

Assume we can evaluate P (x, y) wherever, but wish tominimize the number of evaluations.

No other information about P required,

nor assumptions about the smoothness of the margin.

For nice examples, the margin consists of one or morecurves each homeomorphic to either:

an infinite line; ora circle.

but may be cusped.

CTAC 2003 – p.3/29

Page 4: Skirting subsets of the plane, with application to marginal stability curves

Example: 1 equation in 2 unknowns

One equation in two unknowns can be writtenf(x, y) = 0.

If f , x, and y are real and f is continuous, we can use apredicate like

P (x, y) ⇔ f(x, y) < 0.

Here, the margin of P is the solution curve f(x, y) = 0.

Thus, finding level curves of surfaces is an example ofthis problem.

In the coastline example, we could take here thefunction f as the height above sea level.

CTAC 2003 – p.4/29

Page 5: Skirting subsets of the plane, with application to marginal stability curves

Example: marginal stability curves

A specific practical example is a marginal stability curve.

e.g. from the Orr–Sommerfeld equation of linearhydrodynamic stability theory.

Say at Reynolds number R, waves of wavenumber α

amplify likee−iωt = e=ωte−i<ωt

where t is time and ω is (complex) frequency.

Typically ω is obtained from an eigenvalue problem.

Stability requiresmax=ω < 0

for all ω in the spectrum.

CTAC 2003 – p.5/29

Page 6: Skirting subsets of the plane, with application to marginal stability curves

Typical simple marginal stability curve

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

‘Toy’ example from Drazin (2002).CTAC 2003 – p.6/29

Page 7: Skirting subsets of the plane, with application to marginal stability curves

Another marginal stability curve

0.0

0.5

1.0

1.5

2.0

2.5

0 50 100 150 200 250 300 350 400

TO

TA

L W

AV

EN

UM

BE

R, k

REYNOLDS NUMBER, R

STABLE

UNSTABLE

A 3-D natural convection problem.

Note cusps (due to multiple modes).

CTAC 2003 – p.7/29

Page 8: Skirting subsets of the plane, with application to marginal stability curves

A preliminary: bisection

Marginal points of a predicate on the real line can be foundby BISECTION.

If ab is TRANSVERSE, so is either ac or cb.

Every transverse segment contains a marginal point.

CTAC 2003 – p.8/29

Page 9: Skirting subsets of the plane, with application to marginal stability curves

Parameterization by coordinates

The margin P (x, y) = 0 can be parameterized locally byone of the coordinates: y = g(x) or x = h(y), but. . .

STABLE

UNSTABLE?

STABLE

UNSTABLE

?

Problems:Margin-bounding property of bisection lost! andswitching required at turning points.

CTAC 2003 – p.9/29

Page 10: Skirting subsets of the plane, with application to marginal stability curves

Continuation methods

Continuation methods use knowledge of the solution toa nearby problem.

Here, use that part of the margin already calculated.

Allgower & Georg (1990) Numerical ContinuationMethods, Springer.

Two basic classes:predictor–corrector

requires derivative of functionfails at cuspslacks bisection’s bounding property

simplicial decompositiondivide domain into simplexes‘door-in, door-out’ principle retains bounding

CTAC 2003 – p.10/29

Page 11: Skirting subsets of the plane, with application to marginal stability curves

Generalizing bisection to R2

Given a and b with P (a) 6⇔ P (b) in the plane, bisectionguarantees one marginal point.

Another transverse segment a′b′ can be obtained byrotating the original.

c = a +

[

cos π6

− sin π6

sin π6

cos π6

]

(b − a)

Then if P (c) ⇔ P (a), use cb; otherwise ac.

Like bisection, but tracks instead of contracts.

CTAC 2003 – p.11/29

Page 12: Skirting subsets of the plane, with application to marginal stability curves

Rectangular metric

If R2 is a parameter plane rather than geometric, a

RECTANGULAR METRIC is more appropriate.

Use tolerances as length scales. Metric:[

τ−2

x 0

0 τ−2

y

]

.

Distance:

d2(a, b) =[

b1 − a1 b2 − a2

]

[

τ−2x 0

0 τ−2y

][

b1 − a1

b2 − a2

]

Rotation matrix:

cos θ −√

g22

g11

sin θ√

g11

g22

sin θ cos θ

=

[

1

2− τx

τy

√3

2

τy

τx

√3

2

1

2

]

CTAC 2003 – p.12/29

Page 13: Skirting subsets of the plane, with application to marginal stability curves

A minimal implementation

function skirt (u, v, pred, tol)rot = [1, -sqrt(3)*tol(1)/tol(2);

sqrt(3)*tol(2)/tol(1), 1]/2;p_u = feval (pred, u);

while (true)disp (bisect (u, v, pred, tol)’);w = u + rot * (v - u);if (feval (pred, w) == p_u)

u = w;else

v = w;endif

endwhileendfunction

CTAC 2003 – p.13/29

Page 14: Skirting subsets of the plane, with application to marginal stability curves

Example: Initial transverse segment

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

stable #1 unstable #1

Find a stable and an unstable point.CTAC 2003 – p.14/29

Page 15: Skirting subsets of the plane, with application to marginal stability curves

Example: First step

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEstable ##1-2 unstable #1

unstable #2

Rotate segment and test new point.CTAC 2003 – p.15/29

Page 16: Skirting subsets of the plane, with application to marginal stability curves

Example: Second step

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEstable ##1-2

stable #3

unstable #1

unstable ##2-3

Repeat.CTAC 2003 – p.16/29

Page 17: Skirting subsets of the plane, with application to marginal stability curves

Example: nth step

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

CTAC 2003 – p.17/29

Page 18: Skirting subsets of the plane, with application to marginal stability curves

Increasing resolution

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

CTAC 2003 – p.18/29

Page 19: Skirting subsets of the plane, with application to marginal stability curves

Increasing resolution

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

CTAC 2003 – p.19/29

Page 20: Skirting subsets of the plane, with application to marginal stability curves

Increasing resolution

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLE

CTAC 2003 – p.20/29

Page 21: Skirting subsets of the plane, with application to marginal stability curves

Refinements

Termination criteria.For line-like margins:

test if margin leaves domain of interest;For circle-like margins:

test if margin returns to starting point;Cheap general alternative:

test if a step count is exceeded.

For P ⇔ f < 0, use BRENT’S METHOD.

Adaptivity.

CTAC 2003 – p.21/29

Page 22: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity: measuring accuracy

Adaptivity requires a quantification of accuracy.

Two measures of accuracy:1. How close are output points to margin?2. How close is margin to output points?

How close are output points to margin?Easy: As close as we like, by bisection.

How close is margin to output pointsDiffcult: margin is unknown.All that is known of the margin is the output points.Interpolate with line segments.Also look ahead by extrapolating with line segments.

CTAC 2003 – p.22/29

Page 23: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity

excessive deviationfrom linear projection

halve 2nd transverse edge

and try again

CTAC 2003 – p.23/29

Page 24: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity example

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEUNSTABLE

UNSTABLE

Nonpolygonal tolerance: 160. Function evaluations: 185.

CTAC 2003 – p.24/29

Page 25: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity example

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEUNSTABLE

UNSTABLE

Nonpolygonal tolerance: 40. Function evaluations: 265.

CTAC 2003 – p.25/29

Page 26: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity example

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEUNSTABLE

UNSTABLE

Nonpolygonal tolerance: 10. Function evaluations: 596.

CTAC 2003 – p.26/29

Page 27: Skirting subsets of the plane, with application to marginal stability curves

Adaptivity example

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEUNSTABLE

UNSTABLE

Nonpolygonal tolerance: 1. Function evaluations: 1486.

CTAC 2003 – p.27/29

Page 28: Skirting subsets of the plane, with application to marginal stability curves

Comparison: Adaptivity without growth

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0 50 100 150 200

WA

VE

NU

MB

ER

, α

REYNOLDS NUMBER, R

STABLE

UNSTABLEUNSTABLE

UNSTABLE

Function evaluations: 63 936 (over 40 times more).

CTAC 2003 – p.28/29

Page 29: Skirting subsets of the plane, with application to marginal stability curves

Conclusions

An extremely simple but reasonably robust and efficientalgorithm has been developed for tracing the margins ofpredicates in the plane.

Cusps on the marginal curve present no difficulty.

Directly applicable to finding level curves of real-valuedfunctions of two variables. The derivative is notrequired, and need not exist.

The algorithm has proved most useful in tracingmarginal stability curves for Orr–Sommerfeld typeproblems in linear hydrodynamic stability.

Implementation:minimal (33 lines of code, including bisection); andadaptive (99 lines of code).

CTAC 2003 – p.29/29