220 likes | 373 Views
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.
E N D
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 • 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
Proper orthogonal decomposition • We seek a tensor product representation of the field and define the l-truncation and error • The proper orthogonal decomposition consist of choosing an optimal • set of orthogonal eigenfunctions such that for a fixed l, • e(l) 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.
An Example from QPS N x N matrix l-rank approximation
Eigenfunctions for QPS |B| decomposition
SDV works well for complicated fields and sharp variations However…..
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.
Extending the field is not trivialSVD does not like no-differentiable functions Slow decay
Grid extension algorithm Plasma boundary represented as a parametric curve in the plane Nested family of “rectified” boundaries created by expanding Discretizing t construct a grid in the vacuum region 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 In the last step, the data in the is used to interpolate the data
Test of grid extension algorithm Original data Eigenvalues Extended data Rank 5 approximation error
“Crystal-Growth” Algorithm Initialize Mask Mask=0 in vacuum Mask=1 in plasma 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 Mask=0 ANY(mask == 0) ? Mask=1 Nearest neighbors
Test of crystal growth algorithm Original data Eigenvalues Extended data Rank 5 approximation error
Application to M3D magnetic field data Br data from M3D Eigenvalues Rank 5 error Error
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.
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
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
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 l 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.
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