Top Banner
SVD Data Compression: Application to 3D MHD Magnetic Field Data Diego del-Castillo-Negrete Steve Hirshman Ed d’Azevedo ORNL ORNL-PPPL LDRD Meeting ORNL August 8-10, 2005
22

SVD Data Compression: Application to 3D MHD Magnetic Field Data

Jan 31, 2016

Download

Documents

Jena

SVD Data Compression: Application to 3D MHD Magnetic Field Data. Diego del-Castillo-Negrete Steve Hirshman Ed d’Azevedo. ORNL. ORNL-PPPL LDRD Meeting ORNL August 8-10, 2005. Motivation. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SVD Data Compression: Application to 3D MHD Magnetic Field Data

SVD Data Compression:Application to 3D MHD Magnetic

Field DataDiego del-Castillo-Negrete

Steve Hirshman

Ed d’AzevedoORNL

ORNL-PPPL LDRDMeeting ORNLAugust 8-10, 2005

Page 2: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Motivation• Particle based simulations with M3D require moving around

large amounts of magnetic data (broadcasting to other processors)

• Compressing these data would save computer storage and allow individual processors to store B-fields needed to push particles through all space.

• For 2-d data (3rd dimension FFT) requires data points.

• The goal is to explore the possibility of representing the same field in a basis that only requires data points with

Bi j = B(ri,z j )

N × N

λ×N

λ ~ O(1) << N

Page 3: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Proper orthogonal decomposition •We seek a tensor product representation of the field

and define the λ-truncation and error

Bi j = wk gk ri( )k=1

N

∑ fk z j( )

fk{ }

gk{ }€

Bi jλ = wk gk ri( )

k=1

λ

∑ fk z j( )

e(λ ) = Bi j − Bi jλ

[ ]j=1

N

∑i=1

N

∑2

•The proper orthogonal decomposition consist of choosing an optimalset of orthogonal eigenfunctions such that for a fixed λ e(λ is the smallest. That is, we are looking for the best low order tensor product approximation of the data in a least square sense.

•This techniqu,e also known as singular value decomposition and principal component analysis, is widely used in many areas including fluid turbulence and image processing.

Page 4: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Bi j = B θ i,φ j( ) N x N matrix

Bi jλ = wk gk θ i( )

k=1

λ

∑ fk φ j( )λ-rank approximation

wk

2λ N

λ<<N

An Example from QPS

Page 5: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Eigenfunctions for QPS |B| decomposition

Page 6: SVD Data Compression: Application to 3D MHD Magnetic Field Data

SDV works well for complicated fields and sharp variations

However…..

Page 7: SVD Data Compression: Application to 3D MHD Magnetic Field Data

SDV method has problems with non-Cartesian boundaries

Proposed alternative: Create an extension of the field in the vacuum and apply SDV compression to the total resulting field.

Page 8: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Extending the field is not trivial

SVD does not like no-differentiable functions

Slow decay

Page 9: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Grid extension algorithm

γ0 :t → x0(t),y0(t)( )

Plasma boundary represented as a parametric curve in the plane

Nested family of “rectified” boundariescreated by expanding

γk :t → xk (t),yk (t)( )

γ0

k =1,K N

Discretizing t construct a grid in the vacuum region

(t j ,γ k )

Using the grid extrapolate the boundary values along the t=constant coordinate lines using a Taylor expansion:

Where, to smooth the ghost field we impose the “Laplacian” condition

φk (t j ) = φk−1(t j ) + ∇φ |γ 0( t j )[γ k (t j ) − γ k−1(t j )]

∂γ2 φ

t= const= 0

In the last step, the data in the is used to interpolate the data

(t j ,γ k )

(rj ,zk )

Page 10: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Test of grid extension algorithm

Rank 5 approximation error

Original data

Extended data

Eigenvalues

Page 11: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Eigenfunctions

Page 12: SVD Data Compression: Application to 3D MHD Magnetic Field Data

“Crystal-Growth” Algorithm

0

10

20

30

40

50

60

70

80

90

0 20 40 60 80 100

Plasma Region (Mask=1)

“Vacuum” Region (Mask=0 initially)

Growing boundary (Mask:0->1)

Initialize Mask

Find next bdy layer

mask=0 pts with at least one nearest neighbor (mask=1)

Use Taylor series (> order 2) and symmetric layers of neighbors with mask=1 to compute smooth extrapolation for bdy points

Update mask=1 for all bdy points at end of this cycle

ANY(mask == 0) ?

Mask=0 in vacuumMask=1 in plasma

Mask=1

Mask=0

Nearest neighbors

Page 13: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Test of crystal growth algorithm

Rank 5 approximation error

Original data

Extended data

Eigenvalues

Page 14: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Eigenfunctions

Page 15: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Application to M3D magnetic field dataBr data from M3D

Eigenvalues

ErrorRank 5 error

Page 16: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Despite the relatively good decay of the eigenvalues and the error as function of the rank of the approximation, the high order eigenfunctions exhibit sharp variations. This might be due to lack of smoothness of the original data.

Br(x, y0)

∂x3Br

Page 17: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Least squares polynomial fit

• Assume matrix obtained from a smooth function [ f(x(i),y(j) ], where f(x,y) can be well approximated by polynomials.

• f(x,y) = sum( c(k,l) T(k,x) T(l,y), k=0..m,l=0..m ), T(k,x) may be k-th degree Chebyshev polynomials

• Compute coefficients c(k,l) using least squares fit with known data within the defined region

Page 18: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Least squares fit

• Resulting fitted data is globally smooth, and usually leads to fast decay of singular values

• Singular vectors appear to be smooth functions• Derivatives can be estimated from basis functions• Good compression since only the coefficients need

to be sent, values of T(k,x(i)) or T(l,y(j)) can be regenerated

Page 19: SVD Data Compression: Application to 3D MHD Magnetic Field Data
Page 20: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Conclusions•SVD decomposition is an efficient data compression technique that can be used to represent magnetic field data in particle based plasma simulations.

•For two dimensional data of size the compression rate is where λ is the number of eigenfunctions, typically

•Achieving efficient data compression requires smooth data in a rectangular domain.

•For plasmas with irregular (non-rectangular) boundaries one has first to extend the data in a differentiable way into a rectangular box.

λ ~ O(1) << N

R = 2λ /N

N 2

Page 21: SVD Data Compression: Application to 3D MHD Magnetic Field Data

Conclusions•We have discussed three data extension algorithms:

•Crystal growth•Grid extension •Truncated Chebychev x-y expansions

•We applied the methods to several examples and were able to achieve compression rates of at least R~1/10 with errors of order

10−3, 10−4

Page 22: SVD Data Compression: Application to 3D MHD Magnetic Field Data