Gustaf Soderlind Numerical Analysis, Lund...

16
Scientific Computing and Computational Science What’s the difference? Gustaf S¨ oderlind Numerical Analysis, Lund University

Transcript of Gustaf Soderlind Numerical Analysis, Lund...

Page 1: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Scientific Computing and Computational Science

What’s the difference?

Gustaf Soderlind

Numerical Analysis, Lund University

Page 2: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

What is Computational Science?

Computational X

X = Physics / Biology / Fluid Dynamics / Electromagnetics /Science & Engineering / Mechanics / Chemistry / Physiology..

Characteristics

◮ Application driven

◮ Bridges gap between theory and experiment

◮ Sometimes replaces experiment

◮ Of ever increasing importance

◮ “Standard” software and computational methodology

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 3: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

What is Scientific Computing?

Independent research area combining mathematics, numericalanalysis, computer science, software engineering

Provides basic methodology behind Computational X

Focal points

◮ Analysis and construction of computational methods

◮ Stability, accuracy, efficiency, theorem & proof

◮ Algorithm and software design

◮ Advanced computers and computing

◮ Special needs in special applications

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 4: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Scientific computing Kepler problem

Constant step size vs adaptive symplectic integration method

Special construction of Hamiltonian step size control system

Same average work (10,000 steps) but 30 times betteraccuracy and numerical precession completely suppressed

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 5: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Example of interaction Hip joint prosthesis model

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 6: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Example of interaction Hip joint prosthesis model

Reaction–diffusion model

∂t

[

TC

]

=

[

∇ · (D∇T ) + Q(C ,T )G (C ,T )

]

◮ Heat transfer/polymerization

◮ Coupled nonlinear PDE/ODE model

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 7: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Example of interaction Hip joint prosthesis model

Finite element discretization

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 8: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Example of interaction Hip joint prosthesis model

Computational results

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 9: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

A simplified test problem Diffusion, ut = uxx

Finite difference discretization u(tn, xj) ≈ unj

un+1

j − unj

∆t=

unj−1 − 2un

j + unj+1

∆x2

Putting µ = ∆t/∆x2 we obtain recursion

un+1

j = unj + µ · (un

j−1 − 2unj + un

j+1)

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 10: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

N = 30 points in [0, 1] with M = 187 time steps on [0, 0.1]Stable solution at µ = .514

00.02

0.040.06

0.080.1

0

0.2

0.4

0.6

0.8

10

0.2

0.4

0.6

0.8

1

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 11: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

N = 30 points in [0, 1] with M = 184 time steps on [0, 0.1]Unstable solution at µ = .522

00.02

0.040.06

0.080.1

0

0.2

0.4

0.6

0.8

1−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 12: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Why does that happen?

Answer – discretization methods produce approximationsthat do not exactly replicate mathematical behavior

Necessary to understand basic principles of scientificcomputing to be successful in computational science

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 13: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

The bottom line

Volvo knows how to construct a good car. . .

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 14: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

The bottom line

Volvo knows how to construct a good car. . .

. . . but that doesn’t make you the perfect driver!

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 15: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

The bottom line

Volvo knows how to construct a good car. . .

. . . but that doesn’t make you the perfect driver!

Consider obtaining a driver’s license!

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012

Page 16: Gustaf Soderlind Numerical Analysis, Lund Universitycbbp.thep.lu.se/compute/Kickoff_2012_talks/G_Soderlind.pdf · Independent research area combining mathematics, numerical analysis,

Take-home message

In scientific computing you often encounter Murphy’s Law

Don’t expect to be successful in computational science

with black-box codes – you’ll need to understand how

and why they work, and what to do when they don’t

Consider getting a basic training in scientificcomputing – you’ll need it!

G Soderlind, Numerical Analysis Compute kick-off 2 March 2012