57
Prof. J S Han@ANU 하루만에 배우는 MATLAB 전산구조 신기술 MATLAB MATLAB 이용한 이용한 동역학해석모델에 동역학해석모델에 대한 대한 모델차수축소기법 모델차수축소기법 February 6, 2009 Prof. Jeong Sam Han School of Mechanical Engineering Andong National University E-mail: [email protected]

한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Embed Size (px)

Citation preview

Page 1: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

MATLABMATLAB을을 이용한이용한 동역학해석모델에동역학해석모델에대한대한 모델차수축소기법모델차수축소기법

February 6, 2009

Prof. Jeong Sam HanSchool of Mechanical Engineering

Andong National University

E-mail: [email protected]

Page 2: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

2

IntroductionIntroduction

n << Nn << N

reduced no.of ∑r: ODEs

system-levelsimulation, control

MOR

n DoFs

optimization

physical system

∑: ODEs

PDEs

input data+

modeling

discretization in space

N DoFs

FEMBEM system-level

simulation, control

optimization

Page 3: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

3

Part IPart I

• Theory on Krylov-based MOR

– Concept

– Moment-matching method

– Krylov subspace

– Arnoldi process

– MOR for frequency response problems

Page 4: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

4

Concept of Concept of MModel odel OOrder rder RReductioneduction

• Original 2nd order system (N×N)

+ K(N×N)

x(N)+ = b

(N×1)M(N×N)

x(N)

.. C(N×N)

x(N)

. u(1)

MORMORx(t)≅Vz(t) V(N×n)

x(N)

z(n)

=

• Reduced 2nd order system (n×n)

Because n<<N, very efficient simulations are possible!

Mr(n×n)z

(n)Cr(n×n)

z(n)

Kr(n×n)z

(n)+ =+ br(n×1)u(1)

.. .

Projectionmatrix

Page 5: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

5

MomentMoment--Matching Method (Damped)Matching Method (Damped)

)t(u)t()t()t( bKxxCxM =++ &&&

)t()t( Lxy =

proportionaldamping orconstant damping ratio

rr

T

Tr

)(KM

VKMVCVVC

β+α=β+α=

=

MVVM Tr = KVVK T

r =bVb T

r = LVL =r

)t(u)t()t()t( rrrr bzKzCzM =++ &&&

)t()t( rzLy =

x(t)≅Vz(t)

• If the columns of V form a basis for the Krylov subspaceKn(−K−1M,K−1b)=span{K−1b,…,(−K−1M)n−1·K−1b}, then the first n moments of the original and reduced models match!

• Transfer function (for an undamped system)

∑∞

=

=

−−

=

−=

+=

0i

i2i

0i

i21i1

12

s

s)(

)s()s(

m

bKMKL

bKMLH

moment of H(s)

Projection

∑∞

=

−=

+−++−+=

0i

i0i

q0q010

)ss(

)ss()ss()s(

m

mmmH LL

∑∞

=

−=

+−++−+=

0i

i0i

q0q010

)ss(ˆ

)ss(ˆ)ss(ˆˆ)s(ˆ

m

mmmH LL

n,,2,1i,ˆ ii L==⇒ mm

• SIMO 2nd order system

Seriesexpansion

Page 6: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

6

Property of MomentProperty of Moment--MatchingMatching

• Point-matching:- Can be very inaccurate in between points

H(s)

Hr(s)

ω

H(s)

Hr(s)

ω

• Moment-matching:- Accurate around expansion points, but inaccurate on wide frequency band- A higher order reducedmodel results in a betterapproximation

Page 7: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

7

Krylov SubspaceKrylov Subspace

Krylov subspace of n-th dimension of A∈ℜN×N and v∈ℜN

Kn(A, v) = span{v, A·v, A2·v, …, An−1·v}

• A subspace spanned by the original v and the vectors produced by consecutive multiplication of the matrix A to this vector up to n-1times

• The resulting vectors form a basis of n-dimensional subspace

• Direct computation is numerically unstable because of rounding errors Arnoldi process is used to construct an orthonormal basis

• Included in 10 top algorithms of the 20th century

• Named after Russian applied mathematician and naval engineer Alexei Krylov

Page 8: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

8

OrthonormalizationOrthonormalization

• Gram-Schmidt process– To subtract from every new vector its components in the

directions that are already settled

Independent vectors a, b, cOrthogonal A, B, COrthonormal q1, q2, q3

;

)()(

;

)(

;

3

2T21

T1

TT2

1T1

T1

CCq

qcqqcqcBB

BcB

AA

AcAcC

BBq

qbqbAA

AbAbB

AAq

=

−−=−−=

=

−=−=

=

BBBcB

BB

BcB

AAAbA

AA

AbA

T

TT

T

TT

=

=

⎩⎨⎧

=≠

=jiif1jiif0

qq jTi

Page 9: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

9

Arnoldi ProcessArnoldi Process

• Given a nonzero starting vector r(=K−1b) and a matrix A(=K−1M), this algorithm produces orthonormal v1,v2,…,vn such that

span{v1,v2,…,vk} = span{r,Ar,…,Ak-1r} for k = 1,2,…,n

v1 = r/║r║2

for k = 1,2,…,n-1 vk+1 ← Avk (new vector generation)for j = 1,2,…,k (orthogonalization)

hjk ← vjTvk+1 (Gram-Schmidt coefficient)

vk+1 ← vk+1 - hjkvjhk+1,k ← ║vk+1║2

if hk+1,k = 0set flag(span{v1,v2,…,vk} is invariant under A)exit

vk+1 ← vk+1 / hk+1,k (normalization)

VTV=In where colspan{V}=Kn(K−1M, K−1b)

Page 10: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

10

Generation of New Vector (vGeneration of New Vector (vk+1k+1))

1) Let vk+1 = Avk where A= −K−1M2) Multiply K on both sides, Kvk+1 = −Mvk

3) Decompose K=LU, then LUvk+1 = −Mvk

4) Solve Lw = −Mvk for w, where Uvk+1 = w5) Solve Uvk+1 = w for vk+1

• Decomposition according to the matrix A,– Cholesky decomposition: symmetric and positive definite– LU decomposition: not symmetric– LDLT decomposition: symmetric but indefinite

Page 11: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

11

MATLAB Implementation for MATLAB Implementation for ArnoldiArnoldi

%%% perform model order reduction by arnoldi algorithm (order of n)

[L, U] = lu(K); % LU matrix factorization (K = L*U)

v = U\(L\B); % the starting vector by left divisionv = (1/norm(full(v)))*v; % normalizing the starting vector

% generate krylov vectors up to nfor j = 2:n

v(:,j) = U\(L\(M*v(:,j-1)));for k = 1:j-1

hv = v(:,k)'*v(:,j);v(:,j) = v(:,j) - hv*v(:,k);

endv(:,j) = v(:,j)/norm(v(:,j));

end

diff_v = norm(v'*v - eye(n)); % check orthonormality

r=K-1BKr=BLUr=BUr=L\Br=U\(L\B)

w=K-1MvKw=MvLUw=MvUw=L\(Mv)w=U\(L\(Mv))

Page 12: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

12

MOR for Frequency ResponseMOR for Frequency Response ProblemsProblems

colspan{V}=Kn(K−1M, K−1b) where b∈ℜN

• When a damping matrix C is modeled as a proportional damping(C=αM+βK) or a damping with a constant damping ratio (C=βcK), the above projection matrix V is enough to generate a reduced system because the damping matrix is a linear combination of Mand/or K therefore it does not contribute to the projection matrix.

x=VzOriginal system (N×N))t(u)t()t()t( bKxxCxM =++ &&&

Reduced system (n×n))t(u)t()t()t( rrrr bzKzCzM =++ &&&MVVM T

r =

KVVK Tr =

bVb Tr =

CVVC Tr =

Page 13: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

13

MATLAB Implementation for ProjectionMATLAB Implementation for Projection

%%% generate reduced system matrices by projection

Mr = full(v'*M*v);Kr = full(v'*K*v);Br = full(v'*B);Cr = full(C*v);

NAMESr = NAMES;

% damping with a proportional dampingalpha = 2E-6; beta = 2E-6;

Er = alpha*Mr + beta*Kr; % E = αM + βK

Page 14: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

14

)t(u)t()t()t( bKxxCxM =++ &&&

cc1121 )i( bxCMK =Ω+Ω−

cc2222 )i( bxCMK =Ω+Ω−

Kc xc = Fc

Process of Model Order ReductionProcess of Model Order Reduction

ANSYSFE model generation

• FULL files at Ω1 and Ω2• List of output DOFs

MATLABModel order reduction

• Reduced-order models

MATLABPost-processing

• Frequency response

})s(,)s{(}{colspan 10

10n bKMMKMV −− ++=K

M, C, K, b

Mr, Cr, Kr, br

)t(u)t()t()t( rrrr bzKzCzM =++ &&&

MVVM Tr =

KVVK Tr =

bVb Tr =

CVVC Tr =

where s0= −(2πf)2

rccrr2

r )i( bzCMK =Ω+Ω−

Page 15: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

15

MATLAB Implementation for FRFMATLAB Implementation for FRF

%%% perform frequency responses with the reduced system

nstep = (80+1); fstart = 0.; fend = 80.; % 0~80 Hz @81 frequenciesfdel = (fend - fstart)/(nstep - 1);

for k = 1:nstepkfrq = fstart + (k-1)*fdel;komg = 2*pi*kfrq; % calculation of omgega

Kc = Kr - (komg^2)*Mr + i*komg*Er; % {Kc} generation

kXc = Kc\Br; % solve {Kc}{xc}={Fc}kYc = Cr*kXc; % y=Cx

Yc(k,:) = [kfrq, kYc']; % frq, responsesend

Page 16: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

16

Structural ExamplesStructural Examples

• HDD Track Writer

– Control to position E-block tips to write data tracks on an HDD disk

– Frequency response until some kHz is important for control design and for structural improvement

– Therefore, harmonic simulation is necessary

writingtip

disk

E-block

motor

E-block

rotor

diskassemblytrack

positioner

Page 17: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

17

HDD Track WriterHDD Track Writer

1

X

Y

Z

FEM MODEL

1

ROTOR

1

ROTOR

COMBIN14: stiffness + damping

observationpoint

No. of element : 22,884No. of node : 28,752No. of constraint : 96No. of DoF : 86,160

• ANSYS FE model

Page 18: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

18

10-910-810-710-610-5

101 102 103 104-180-90

090

180

ANSYS (FM)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

Harmonic Analysis : FM vs. MORHarmonic Analysis : FM vs. MOR

10-910-810-710-610-5

101 102 103 104-180-90

090

180

MOR (n=100)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

50 hr

1,500 sec

Page 19: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

19

10-910-810-710-610-5

101 102 103 104-180-90

090

180

ANSYS (FM)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

Harmonic Analysis : FM vs. MSHarmonic Analysis : FM vs. MS

50 hr

8,000 sec

10-910-810-710-610-5

101 102 103 104-180-90

090

180

MS (m=100)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

Page 20: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

20

10-910-810-710-610-5

101 102 103 104-180-90

090

180

ANSYS (FM)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

Harmonic Analysis : FM vs. RMHarmonic Analysis : FM vs. RM

50 hr

4,500 sec

10-910-810-710-610-5

101 102 103 104-180-90

090

180

RM (n=100)

Am

plitu

de [μ

m]

y-direction

Phas

e [d

egre

e]

Frequency [Hz]

Page 21: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

21

ArrayArray--type MEMS resonatorstype MEMS resonators• FRF calculation for 6x6 MEMS resonators

– Size (μm) : φ 40~50, t 2

- No. of elements:194,880 (SOLID45)

- No. of nodes:278,160

- No. of DOFs:832,680

- Frequency range:636.5~638.5 MHz

- Elapsed time:89,696 sec. (1 day)

- No. of modes required:8,000~9,000

Page 22: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

22

ArrayArray--type MEMS resonatorstype MEMS resonators

• FRF of a 6x6 resonator

636.5 637.0 637.5 638.0 638.50.0

0.5

1.0

1.5

2.0

2.5

3.0ANSYS(N=832680)MOR(n=150)

||UR|| [

pm]

Frequency [MHz]

Page 23: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

23

PiezoelectricPiezoelectric--Structural ExamplesStructural Examples

• Angular velocity μ-sensor using Coriolis effect

F_tip

Alternating voltage (1 V) for vertical excitation (UY)

Horizontally induced vibration (UZ) proportional to ΩXbecause of Coriolis effect

ΩX

• 1,584 SOLID226 elements• 8,867 nodes (UX,UY,UZ,VOLT)

XY

Z

Page 24: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

24

μμ--GyroscopeGyroscope

• Finite element model

- No. of elements:1,584 (SOLID226)

- No. of nodes:8,867

- No. of DOFs:25,449

B.C.(fixed)

PZT4 partSOLID226

(UX,UY,UZ,VOLT)

Silicon partSOLID226

(UX,UY,UZ)

F_tip

Page 25: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

25

μμ--GyroscopeGyroscope

• Frequency response (ΩX=0)

•UY@tipF

• No. of DOFs: 25,449

vertical excitation

10-610-510-410-310-210-1100

103 104 105-180-90

090

180

ANSYS (N=25,449)MOR (n=30)A

mpl

itude

[μm

]

UY@tipF

Phas

e [d

eg]

Frequency [hz]

Page 26: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

26

Part IIPart II

• Tutorials

– Tutorial 1 : 10 DoF mass-spring system without damping

– Tutorial 2 : 10 DoF mass-spring system with proportional damping

– Tutorial 3 : HDD actuator/suspension [Hatch, 2001]

Page 27: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

27

Tutorial (1)Tutorial (1)

• 10 DoF mass-spring system (no damping)

– mi = 0.1 kg (mass21 elements in ANSYS)– ki = 50 kN/m (combin14 elements in ANSYS)

• Calculate frequency response functions using Krylov-based model order reduction

• Compare the results with those by an ANSYS original finite element model

Page 28: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

28

Tutorial (1)Tutorial (1)• System matrices (from ANSYS)

)t(u)t()t( bKxxM =+&&)t()t( Cxy =

K=

M=(10×10)

Page 29: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

29

Tutorial (1)Tutorial (1)• System matrices (from ANSYS)

)t(u)t()t( bKxxM =+&&)t()t( Cxy =

b= C=

⎪⎪⎪⎪⎪⎪

⎪⎪⎪⎪⎪⎪

⎪⎪⎪⎪⎪⎪

⎪⎪⎪⎪⎪⎪

=

)t(x)t(x)t(x)t(x)t(x)t(x)t(x)t(x)t(x)t(x

)t(

10

9

8

7

6

5

4

3

2

1

m

m

m

m

m

m

m

m

m

m

x

⎪⎪⎭

⎪⎪⎬

⎪⎪⎩

⎪⎪⎨

=

)t(x)t(x)t(x)t(x

)t(

10

8

4

2

m

m

m

m

y

@n9(4×10)

(10×1)

(10×1)

(4×1)

Page 30: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

30

Tutorial (1)Tutorial (1)

• Frequency response function (ANSYS, N=10)– Range : 0~80 Hz (@81 frequencies)

Page 31: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

31

Tutorial (1)Tutorial (1)

• Frequency response @n9 (m8) (n=2)

Page 32: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

32

Tutorial (1)Tutorial (1)

• Frequency response @n9 (m8) (n=4)

Page 33: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

33

Tutorial (1)Tutorial (1)

• Frequency response @n9 (m8) (n=6)

Page 34: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

34

Tutorial (1) : MATLAB CodeTutorial (1) : MATLAB Code

%%% set a working directory --> change it according to your caseclear all; close all;cd d:\tutorial_1

%%% read original system matrices from binary MAT-filewhos -file mk10.mat;clear all;load mk10.mat;

%%% load results by the full-size ansys modelmag_ansys = load('mag_ansys.txt');phs_ansys = load('phs_ansys.txt');

figure(1);subplot(3,1,1:2); semilogy(mag_ansys(:,1),mag_ansys(:,2:end));axis([0 80 1E-5 1E0]); grid on;legend(NAMES);xlabel('Frequency [Hz]'); ylabel('|Ux| [m]');subplot(3,1,3); plot(phs_ansys(:,1),phs_ansys(:,2:end));axis([0 80 0 200]); grid on;xlabel('Frequency [Hz]'); ylabel('Phase [Deg]');saveas(gcf,'frf_ansys.png','png');

Plot the FRF by the original ANSYS model

Read the system matrices!

Read the FRF results by ANSYS

Page 35: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

35

Tutorial (1) : MATLAB CodeTutorial (1) : MATLAB Code

%%% perform model order reduction by arnoldi algorithmn = 6; % change the order of reduced model (n<N)

s0 = -(2*pi*0.)^2; % f=0 hzKK = K + s0*M;

[L, U] = lu(KK); % LU matrix factorization (KK = L*U)

v = U\(L\B); % the starting vector by left divisionv = (1/norm(full(v)))*v; % normalizing the starting vector

% generate krylov vectors up to nfor j = 2:n

v(:,j) = U\(L\(M*v(:,j-1)));for k = 1:j-1

hv = v(:,k)'*v(:,j);v(:,j) = v(:,j) - hv*v(:,k);

endv(:,j) = v(:,j)/norm(v(:,j));

end

diff_v = norm(v'*v - eye(n)); % check orthonormality

Arnoldi process through the modified Gram-Schmidt algorithm

Page 36: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

36

Tutorial (1) : MATLAB CodeTutorial (1) : MATLAB Code

%%% generate reduced system matrices by projectionMr = full(v'*M*v);Kr = full(v'*K*v);Br = full(v'*B);Cr = full(C*v);NAMESr = NAMES;% damping with a proportional dampingalpha = 0.; beta = 0.; % no damping in tutorial_1Er = alpha*Mr + beta*Kr;

%%% perform frequency responses with the reduced systemnstep = (80+1); fstart = 0.; fend = 80.;fdel = (fend - fstart)/(nstep - 1);

for k = 1:nstepkfrq = fstart + (k-1)*fdel;komg = 2*pi*kfrq;

Kc = Kr - (komg^2)*Mr + i*komg*Er;

kXc = Kc\Br;kYc = Cr*kXc;

Yc(k,:) = [kfrq, kYc'];end

Construct a reduced system using the generated orthonomalmatrix V through projection

Perform frequency response analyses at each freqeuency 'kfrq' using the reduced system of order 'n';0~80 hz

Page 37: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

37

Tutorial (1) : MATLAB CodeTutorial (1) : MATLAB Code

% plot the harmonic responses from the reduced systemFRQ = Yc(:,1);MAG = abs(Yc(:,2:end));PHS = (180./pi)*angle(Yc(:,2:end));

% UXsfigure(2);semilogy(FRQ, MAG); grid on;legend(NAMESr);xlabel('Frequency [Hz]'); ylabel('|Ux| [m]');saveas(gcf,'mag_n.png','png');

% UXs@N9(m8)ux = [MAG(:,end-1), mag_ansys(:,end-1)];figure(3);semilogy(FRQ, ux); grid on;axis([0 80 1E-5 1E0]);legend(['n=',num2str(n)], 'ANSYS');xlabel('Frequency [Hz]'); ylabel('|Ux|@N9 [m]');saveas(gcf,'ux@n9_n.png','png');

Plot the results from the reduced models

Compare 'ux@n9' between the reduced and ANSYS results and plot them

Save the results in a matrix-format

Page 38: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

38

Tutorial (2)Tutorial (2)

• 10 DoF mass-spring system (proportional damping)

– mi = 0.1 kg (mass21 elements in ANSYS)– ki = 50 kN/m (combin14 elements in ANSYS)– E = αM + βK (α=2.5 ms−1, β=0.25 ms)

• Calculate frequency response functions using Krylov-based model order reduction

• Compare the results with those by an ANSYS original finite element model

Page 39: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

39

Tutorial (2)Tutorial (2)• System matrices (from ANSYS)

M, K, b, C, E=αM+βK

)t(u)t()t()t( bKxxExM =++ &&&)t()t( Cxy =

E=

Page 40: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

40

Tutorial (2)Tutorial (2)

• Frequency response function (ANSYS, N=10)– Range : 0~80 Hz (@81 frequencies)

Page 41: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

41

Tutorial (2)Tutorial (2)

• Frequency response @n9 (m8) (n=2)

Page 42: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

42

Tutorial (2)Tutorial (2)

• Frequency response @n9 (m8) (n=4)

Page 43: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

43

Tutorial (2)Tutorial (2)

• Frequency response @n9 (m8) (n=6)

Page 44: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

44

Tutorial (2) : MATLAB CodeTutorial (2) : MATLAB Code

• Use the MATLAB code for tutorial 1• But in order to include a damping effect, change

the values α and β for the proportional damping coefficients in the code as follows;

% damping with a proportional dampingalpha = 2.5E-3; beta = 2.5E-4;Er = alpha*Mr + beta*Kr;

Page 45: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

45

• HDD Actuator/Suspension [Hatch, 2001]

• Calculate frequency response functions using Krylov-based model order reduction

• Compare the results with those by the ANSYS full-size finite element model

Tutorial (3)Tutorial (3)

output points

TOPBTM

No. of nodes : 7,336No. of DoFs : 21,203No. of elements : 3,338 (SOLID45) + 8 (COMBIN14)

Page 46: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

46

HDD Actuator/Suspension SystemHDD Actuator/Suspension System

• Overview

Hatch (2001)

θinput

output

Page 47: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

47

Tutorial (3)Tutorial (3)• Frequency response function (ANSYS, N=21,203)

– Range : 100~10,000 Hz (@991 frequencies)– Proportional damping : α=2 μs−1, β=2 μs

Page 48: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

48

Tutorial (3)Tutorial (3)• Frequency response θ@TOP (n=10)

Page 49: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

49

Tutorial (3)Tutorial (3)• Frequency response θ@TOP (n=15)

Page 50: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

50

Tutorial (3)Tutorial (3)• Frequency response θ@TOP (n=20)

Page 51: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

51

Tutorial (3)Tutorial (3)• Frequency response θ@TOP (n=25)

Page 52: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

52

Tutorial (3)Tutorial (3)• Frequency response θ@TOP (n=30)

Page 53: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

53

Tutorial (3) : MATLAB CodeTutorial (3) : MATLAB Code

%%% set a working directory --> change it according to your caseclear all; close all;cd d:\tutorial_3

%%% read original system matrices from binary MAT-filewhos -file simo.mat;clear all;load simo.mat;

%%% load results by the full-size ansys modeluy_top_ansys = load('uy_top_ansys.txt');

figure(1);subplot(2,1,1);semilogy(uy_top_ansys(:,1), uy_top_ansys(:,2)); grid on;legend('UY@TOP (ANSYS)');xlabel('Frequency [Hz]'); ylabel('Theta');axis([100 10000 1E-8 1E-2]);subplot(2,1,2);plot(uy_top_ansys(:,1), uy_top_ansys(:,3)); grid on;xlabel('Frequency [Hz]'); ylabel('Phase [Deg]');saveas(gcf,'uy@top_ansys.png','png');

Plot the FRF by the original ANSYS model

Read the system matrices!

Read the FRF results by ANSYS

Page 54: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

54

Tutorial (3) : MATLAB CodeTutorial (3) : MATLAB Code

%%% perform model order reduction by arnoldi algorithmn = 10; % change the order of reduced model (n<N)

s0 = -(2*pi*100)^2; % f=100 hzKK = K + s0*M;

[L, U] = lu(KK); % LU matrix factorization (KK = L*U)

v = U\(L\B); % the starting vector by left divisionv = (1/norm(full(v)))*v; % normalizing the starting vector

% generate krylov vectors up to nfor j = 2:n

v(:,j) = U\(L\(M*v(:,j-1)));for k = 1:j-1

hv = v(:,k)'*v(:,j);v(:,j) = v(:,j) - hv*v(:,k);

endv(:,j) = v(:,j)/norm(v(:,j));

end

diff_v = norm(v'*v - eye(n)); % check orthonormality

Use a non-zero expansion point (f=100 hz) because of a rigid-body motion

Arnoldi process through the modified Gram-Schmidt algorithm

Page 55: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

55

Tutorial (3) : MATLAB CodeTutorial (3) : MATLAB Code

%%% generate reduced system matrices by projectionMr = full(v'*M*v);Kr = full(v'*K*v);Br = full(v'*B);Cr = full(C*v);NAMESr = NAMES;% damping with a proportional dampingalpha = 2E-6; beta = 2E-6;Er = alpha*Mr + beta*Kr;

%%% perform frequency responses with the reduced systemnstep = (990+1); fstart = 100; fend = 10000;fdel = (fend - fstart)/(nstep - 1);

for k = 1:nstepkfrq = fstart + (k-1)*fdel;komg = 2*pi*kfrq;

Kc = Kr - (komg^2)*Mr + i*komg*Er;

kXc = Kc\Br;kYc = Cr*kXc;

Yc(k,:) = [kfrq, kYc'];end

Construct a reduced system using the generated orthonomalmatrix V through projection.Damping matrix Er is also constructed!

Perform frequency response analyses at each freqeuency 'kfrq' using the reduced system of order 'n';100~10,000 hz

Page 56: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

56

Tutorial (3) : MATLAB CodeTutorial (3) : MATLAB Code

% plot the harmonic responses from the reduced systemFRQ = Yc(:,1);MAG = abs(Yc(:,2:end));PHS = (180./pi)*angle(Yc(:,2:end));

% UYsfigure(2);semilogy(FRQ, MAG); grid on;legend(NAMESr);xlabel('Frequency [Hz]'); ylabel('Theta');axis([100 10000 1E-8 1E-3]);saveas(gcf,'uy_n.png','png');

% UYs@TOPuy_top = [MAG(:,1), uy_top_ansys(:,2)];ph_top = [PHS(:,1), uy_top_ansys(:,3)];figure(3);subplot(2,1,1); semilogy(FRQ, uy_top); grid on;legend(['n=',num2str(n)], 'ANSYS');xlabel('Frequency [Hz]'); ylabel('Theta');axis([100 10000 1E-8 1E-2]);subplot(2,1,2); plot(FRQ, ph_top); grid on;xlabel('Frequency [Hz]'); ylabel('Phase [Deg]');saveas(gcf,'uy@top_n.png','png');

Plot the results from the reduced models

Compare 'θ@TOP' between the reduced and ANSYS results and plot them

Save the results in a matrix-format

Page 57: 한정삼 MOR 2k9-02-05 - Model reductionmodelreduction.com/.../ModelReductionWithMATLAB.pdf · Prof. J S Han@ANU 하루만에배우는MATLAB 전산구조신기술 MATLAB을이용한동역학해석모델에

Prof. J S Han@ANU

하루만에배우는 MATLAB 전산구조신기술

57

Final RemarksFinal Remarks

• Model Order Reduction with MATLAB is

– Very accurate!

– Highly efficient!

– Useful to mechanical + control systems

– Applicable to many engineering areas

• Please contact me at [email protected] you want any questions and collaboration!