• 검색 결과가 없습니다.

Generalized Command Mode Finite Element Method Toolbox in CEMTool

N/A
N/A
Protected

Academic year: 2022

Share "Generalized Command Mode Finite Element Method Toolbox in CEMTool"

Copied!
5
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

ICCAS2003 October 22-25, Gyeongju TEMF Hotel, Gyeongju, KOREA

Generalized Command Mode Finite Element Method Toolbox in CEMTool

Choon Ki Ahn and Wook Hyun Kwon

School of Electrical Engineering & Computer Science, Seoul National University, Seoul , 151-742, Korea (Tel: +82-2-880-7314; http://cisl.snu.ac.kr; Email:hironaka@cisl.snu.ac.kr)

Abstract: CEMTool is a command style design and analyzing package for scientific and technological algorithm and a matrix based computation language. In this paper, we present a compiler based approach to the implementation of the command mode generalized PDE solver in CEMTool. In contrast to the existing MATLAB PDE Toolbox, our proposed FEM package can deal with the combination of the reserved words such as ”laplace” and ”convect”. Also, we can assign the border lines and the boundary conditions in a very easy way. With the introduction of the lexical analyzer and the parser, our FEM toolbox can handle the general boundary condition and the various PDEs represented by the combination of equations. That is why we need not classify PDE as elliptic, hyperbolic, parabolic equations. Consequently, with our new FEM toolbox, we can overcome some disadvantages of the existing MATLAB PDE Toolbox.

Keywords: CEMTool, FEM package, Scientific Computing, Compiler based technique, General PDE solver 1. Introduction

Finite element method (FEM) provides a greater flexibil- ity to model complex geometries than finite difference and finite volume methods do. It has been widely used in solv- ing structural, mechanical, heat transfer, and fluid dynamics problems as well as problems of other disciplines. The ad- vancement in computer technology enables us to solve even larger system of equations, to formulate and assemble the discrete approximation, and to display the results quickly and convienently. This has also helped the finite element method become a powerful tool. There are many kinds of the specialized FEM package for electromagnetics, structural mechanics, heat transfer, diffusion, and something like that.

Among the numerical general-purpose packages for scientific computing, MATLAB is one of the well-known package for science and engineering that performs mathematical and en- gineering computation. As a tool to analyze the solution of PDE in MATLAB, the MATLAB PDE Toolbox [1] contains basic tools for the study and solution of PDE in two space dimensions (2-D) and time, using the finite element method.

Its command line functions and graphical user interface can be used for mathematical modeling of PDE in some ranges of engineering and science applications. However, MATLAB PDE Toolbox in command-mode has some disadvantages as follows: (1) It can deal with only constant coefficients. (2) It is unclear and difficult to assign the border lines and the boundary conditions. (3) In order to use the FEM solver functions of PDE Toolbox, we have to classify PDE as ellip- tic, parabolic, and hyperbolic equations.

As another powerful numerical general-purpose package, CEMTool integrates mathematical computing, visualization, and a powerful high-level language to provide a flexible en- vironment for technical computing [2], [3]. The powerful architecture makes it easy to use CEMTool and its compan- ion toolboxes to explore data, create algorithms, and create custom tools that provide early insights and competitive ad- vantages [4], [5], [6], [7], [8]. In this paper, we present a new FEM toolbox which overcomes the some existing dis-

This paper is supported by BK21.

advantages of MATLAB PDE Toolbox. Our FEM package in CEMTool contains the lexical analyzer and the parser to deal with the general combination of reserved words such as ”sin”, ”cos”, ”convect”, and the like. That is why we can solve the PDE represented by the combination of some reserved words and mathematical operators. In addition, with the introduction of the compiler based technique, we need not to classify the PDE we want to solve as elliptic or parabolic or hyperbolic equations. Compared to MATLAB PDE Toolbox, this is a very good feature because MATLAB PDE Toolox can deal with only constant coefficients. Since the border functions and the boundary condition functions of our FEM package are based on the geometric concept, it is easy to assign the boundary region and its conditions.

The overall procedure for the FEM analysis in CEMTool is described in Section 2. In Section 3, the detailed structure and the important features of various functions of CEMTool FEM Toolbox are discussed. The conclusion is given in Sec- tion 4.

2. The Overall Procedure for the FEM Analysis in CEMTool FEM Toolbox

Basically, the border function of CEMTool FEM Toolbox requires some information on the boundary which is repre- sented by the combination of the reserved words in x and y coordinates. After defining the boundary region, in or- der to generate the triangular mesh based on a Delaunay- Voronoi algorithm, we can employ the makemesh function of CEMTool FEM Toolbox by using the information on the maximum number of vertices as the only parameter of the makemesh function. For the assignment of the boundary conditions, the boundary condition function can be used with the information of the identification numbers and the general boundary conditions represented by some reserved words of CEMTool FEM Toolbox. In order to construct the solution of the PDE we want to solve, we need the FEM solver funtion of CEMTool FEM Toolbox with the informa- tion of the PDE which is represented by the combination of the basic mathematical operator and the reserved words such

(2)

as ”laplace” and ”sin”. Finally, the post-processing functions such as ”meshplot”, ”equi-potential plot”, and ”3D plot” can be used to visualize the solution of the PDE generated by CEMTool FEM Toolbox. The basic procedure for the FEM analysis in CEMTool FEM Toolbox can be described in Fig 1.





































 "!#$%

#'&()!*

' "!+ ,$ (

( ,&-#$./

0

0

0

0

1   

1   

1   

1   









2 !3 )!*

.)$#$/

465 78

46578

465 78

46578









9:<;'=/#!#$

> ?

> ?

> ?

> ?

@  A

@  A

@  A

@  A









Fig. 1. The basic procedure for the FEM analysis in CEM- Tool FEM Toolbox

3. The Detailed Structure and Functions of CEMTool FEM Toolbox

3.1. Border Function

In this subsection, we will discuss the structure of the border function and its features. The first feature of our border function is that it is based on an equation based approach.

Since the border function has the lexical analyzer and the parser, it is possible to use the reserved words such as ”sin”

and ”tan” to describe the boundary region. The prototype of the border function can be described as follows:

bound(in, tm, tM, nb, xeq, yeq) (1) where the first parameter in is the identification number of the border, tmand tM stand for the minimum time and the maximum time, respectively. nb is the number of division, xeq and yeq describe the boundary in x and y coordinates, respectively. First of all, as seen in Fig 2, the border function has the lexical analyzer and the parser in order to deal with various reserved words of CEMTool FEM Toolbox. With the information on equations in x and y coordinates, the lexical analyzer generates the parsing tree. The parser can evaluate the commands or the reserved words at each node of the parsing tree. With the time information represented as tm, tM, and nb, the border function generates a sequence of points representing the boundary in x and y coordinates.

If we use some equations representing the first part of the boundary region with the time parameter ”t” in x and y coordinates as

bound(1, 0, 1, 20, ”t”, ”0”) (2) then we can assign the line from (0, 0) to (1,0) with the division number 20 as the identification number 1. The

BCDEFGH

BCDEFGH

BCDEFGH

BCDEFGH

IJGHKLCM

IJGHKLCM

IJGHKLCM

IJGHKLCM NGMOCM

NGMOCM

NGMOCM

NGMOCM

PQRSTUVWX

YZ[YZXZWTUW\]T^Z

_VRW`S

Ya

UWcb]SW` a

dVVY

`e

fCghCJFC

fCghCJFC

fCghCJFC

fCghCJFC

ijCJCMGklM

imCijCJJCCMMGGkklMlM

imCJCMGklM

Z ZY

UWoVYp STUVW]VWT^Z

_VY`ZYoRWdTUVW

q'X

Z

QR

ZWdZ Vo

[VUWTX YZ[YZXZWTUW\

T^Z _VRW`SYa

Fig. 2. The structure of the border function

x y

1 1

bound(1,0,1,20,"t","0")

bound(1,0,1,20,"1","t") bound(2,0,1,20,"1-t","1")

bound(1,0,1,20,"0","1-t") 1

1 1 2

Fig. 3. The description of rectangular region with the iden- tification numbers 1 and 2

rectangular region represented as bound(1, 0, 1, 20, ”t”, ”0”);

bound(1, 0, 1, 20, ”1”, ”t”);

bound(2, 0, 1, 20, ”1 − t”, ”1”); (3) bound(1, 0, 1, 20, ”0”, ”1 − t”);

can be described in Fig 3 with the identification numbers 1 and 2. With the border function of CEMTool FEM Toolbox, we can describe the circle region by using the command as

bound(1, 0, ”2 ∗ pi”, 20, ”cos(t)”, ”sin(t)”) (4) In this case, we can represent the boundary region of the circle by using only one command as seen in Fig 4.

x y

1 1

bound(1,0,2*pi,20,“cos(t)",“sin(t)")

Fig. 4. The description of the circle region with the identi- fication number 1

3.2. Automatic Mesh Generating Function

The automatic mesh generating function of CEMTool FEM Toolbox is based on a Delaunay-Voronoi algorithm in order to generate the triangular mesh. Since this function needs only one parameter to generate the mesh, it is very easy to use. The prototype of the mesh generation function can be described as follows:

makemesh(nbmax) (5)

(3)

Circle Rectangle

Fig. 5. The mesh generation result in the rectangular region and the circle region

where nbmaxis the maximum number of elements to gener- ate. The makemesh function requires the maximum number of elements as the parameter and generates a sequence of in- formation representing the points of triangles and the rules of connection. If we want to generate the triangular mesh with the maximum number of elements 100 in the rectangu- lar region and the circle region, respectively, we can use the following command

makemesh(100); (6)

and obtain the mesh generation result in Fig 5. In addition, for a specific region seen in Fig 6, we can generate the tri- angular mesh by using the appropriate combination of the border functions of CEMTool FEM Toolbox.

1 x 1

Mesh Generation Result

Fig. 6. The mesh generation result in a specific region

rstuvwx

rstuvwxrstuvwx

rstuvwx

ymzwx{|s}

ymzymzwxwx{{||s}s}

ymzwx{|s}

~€%€‚ƒ€„„…†‡%†ˆ~€

‰†Š‡‹Œƒ%Ž†‡‹…~…†‡ 

w}s}



w}s}



w}s}



w}s}

~€‘…‹€‡~…ˆ…ŽŒ~…†‡

‰

€ƒ

“”•z–w}{

“”•z–w}{

“”•z–w}{

“”•z–w}{

—<”z–u˜u”z

—<”z–u˜u”z

—<”z–u˜u”z

—<”z–u˜u”z

™szs}w˜”}

™szs}w˜”}

™szs}w˜”}

™szs}w˜”}

Œ‘„€šŠ €%†ˆm‡†‹€„

Œ„„†Ž…Œ~€‹%›"…~,~€

‰

†Š‡‹Œƒ%Ž†‡‹…~…†‡„

Œ%„ €%†ˆœŒŠ€„,†ˆ~€

‰†Š‡‹Œƒ%Ž†‡‹…~…†‡„

Fig. 7. The structure of the boundary function

3.3. Boundary Condition Function

In this subsection, we will discuss the boundary condition function of CEMTool FEM Toolbox. The boundary con- dition function of CEMTool FEM Toolbox has the lexical analyzer and the parser to handle the general boundary conditions represented by the combination of the reserved words of CEMTool FEM Toolbox. In this function, we can deal with the boundary conditions such as Neumann con- dition, Dirichlet condition, Mixed condition, and something

x y

1 1

1 1

1 2

bc(1,2,"id(u)*100 + dnu(u)=0")

bc(1,"dnu(u)=0") bc(2,"dnu(u)=1")

Fig. 8. The boundary conditions of the rectangular region

like that. In contrast to MATLAB PDE Toolbox, we can as- sign the boundary conditions for the parts of the boundary region specified by each identification number. As seen in Fig 7, in the lexical analyzer, the expression of the boundary con- dition is broken into tokens and recognized as symbols. The parser evaluates all the symbols of the parsing tree. With the identification number, the boundary condition generator makes an array which contains the values of the boundary conditions and another array which includes the information on nodes associated with the boundary conditions. The pro- totype of the boundary condition function can be described as follows:

bc(in, ”id(u) ∗ f + dnu(u) ∗ g = h”) (7) where in stands for the identification number and ”id(u)*f + dnu(u)*g=h” describes the expression of the boundary condition for each identification number. f , g, and h are the generic expressions. In order to assign the boundary conditions of the rectangular region defined by (3), we can use the following commands

bc(1, ”dnu(u) = 0”) bc(2, ”dnu(u) = 1”);

bc(1, 2, ”id(u) ∗ 100 + dnu(u) = 0”);

where the first command and the second command represent Neumann conditions for the regions specified by the identifi- cation numbers 1 and 2, respectively, and the final command describes the mixed condition at the corner of the regions specified by identification numbers 1 and 2. The diagram for this assignment is given in Fig 8.

žŸ ¡¢£¤

žŸ ¡¢£¤

žŸ ¡¢£¤

žŸ ¡¢£¤

¥¦£¤§¨Ÿ©

¥¦£¤§¨Ÿ©

¥¦£¤§¨Ÿ©

¥¦£¤§¨Ÿ© ª£©«Ÿ©

ª£©«Ÿ© ª£©«Ÿ© ª£©«Ÿ©

¬­®c¯°±²¯³³´µ¶j·¯

·¸¹¹µc³µº»¯

¼¼¼¼££ ££½½½½¡¡ ¡¡¦¦ ¦¦¾¾ ¾¾c¿¿¿¿ÀÀ ÀÀŸŸŸŸ

Á¤ŸÂmŸ¦¿

Á¤ŸÂmŸ¦¿

Á¤ŸÂmŸ¦¿

Á¤ŸÂmŸ¦¿

¼£¿©¡ 

¼£¿©¡ 

¼£¿©¡ 

¼£¿©¡ 

¥¥ ¥¥«« ««««««ŸŸ ŸŸÂ ÂÂ<Ãà Ãä¤ ¤¤¡¡ ¡¡¦¦¦¦¾¾ ¾¾

ÄŤơ¦¾c¿ÀŸ

ÄŤơ¦¾c¿ÀŸ

ÄŤơ¦¾c¿ÀŸ

ÄŤơ¦¾c¿ÀŸ

ž¡¦Ÿ£©

ž¡¦Ÿ£©ž¡¦Ÿ£©

ž¡¦Ÿ£©

ÁÇÈ£¿¡Å¦ ÁÇÈ£¿¡Å¦ ÁÇÈ£¿¡Å¦ ÁÇÈ£¿¡Å¦

¬­®c³µºÉ¹´µ¶c¸¹

¯¸ÊËm¶µÌ¯ ¹Ë¯<´¶Íµ²Îj¸¹´µ¶<µÍ

ʵµ²Ì´¸¹¯³͵²

¯¸ÊË<¶µÌ¯

¹Ë¯<ϵÉ̸²Ð

ʵ̴¹´µ³

Fig. 9. The structure of the FEM solve function

3.4. FEM Solve Function

The FEM solve function of CEMTool PDE Toolbox can solve various kinds of PDE such as elliptic equations, hyperbolic

(4)

femsolve(“-laplace(u)=1”) femsolve(“-laplace(u)=1”)

Poisson Equation

PDE solution at every node PDE solution at every node Fig. 10. The solutions of Poisson equation at every node

equations, and parabolic equations. The only one parame- ter of this function is the the PDE expression we want to solve. As seen in Fig 9, after making the parsing tree in the lexical analyzer, the parser evaluates the reserved words or the mathematical operators from the bottom of the pars- ing tree. With the information of coordinates for each node and the boundary conditions for the region specified by the border functions, the FEM solve function makes the element matrix and the force vector at every element. For the to- tal system matrix and the total system vector, this function assembles the element matrices and the force vectors. Since the obtained system is a linear equation, we can calculate the solutions of PDE at every node by using the linear solver in Fig 10. The prototype of the FEM solver function can be described as follows:

f emsolve(”P.D.E.”) (8)

where P.D.E. represents the expression of the partial differ- ential equation we want to solve. Consider the example on solving Poisson equation as

−∇2u= 1 (9)

If we assume that we use the rectangular boundary region defined by (3), we can employ the following command to solve the above Poisson equation

f emsolve(” − laplace(u) = 1”) (10) where laplace is the reserved word that stands for Laplacian.

 Mesh Plot

 Mesh Plot  Equi-potential Plot Equi-potential Plot

Fig. 11. The meshplot and the equiplot in a rectangular region

Since we employ the compiler technique in the FEM solve function, compared to MATLAB PDE Toolbox, we need not classify the PDE we want to solve as elliptic equations, parabolic equations, and hyperbolic equatioins.

Fig. 12. The CEMTool FEM 3D plot

3.5. Post-processing Functions

In order to visualize the solutions of PDE in a user-defined region, CEMTool FEM Toolbox has the powerful plot func- tions. The meshplot function shows the triangular mesh gen- erated by the makemesh function without the information on height. Also, the equiplot function of CEMTool FEM Tool- box can visualize the equi-potential lines with the informa- tion on height in 2-dimensional coordinates. The mesh gen- eration result and the equi-potential lines in the rectangular region defined by (3) are given in Fig 11. Another feature of the post-processing functions of CEMTool FEM Toolbox is the FEM 3D plot. The FEM 3D plot uses OpenGL library for the enhanced 3D graphic. This function shows the tri- angular meshes and the equi-potential lines in 3-dimensional coordinates with the information on height. In Fig 12, the 3D plot for Poisson equation (9) in the rectangular region defined by (3) is given. In addition, The FEM 3D plot has the various functions such as rotation, transition, zoom-in , zoom-out, and more.

4. Conclusion

In this paper, we present an equation based approach to the implementation of generalized PDE solver in CEMTool.

Our FEM package can overcome the existing disadvantages of MATLAB PDE Toolbox with the introduction of the lex- ical analyzer and the parser. Due to the these techniques, in contrast to MATLAB PDE solver, we can deal with the com- bination of the reserved words. In order to perform the FEM analysis, we need not classify PDE as elliptic equations, hy- perbolic equations, and parabolic equations. Also, it is easy to assign the border lines and the boundary conditions with our proposed FEM Toolbox.

References

[1] Partial Differential Equation Toolbox : User’s Guide,”

The Mathworks, Inc., 2002.

[2] S. H. Han, S. K. Choi, K. H. Lee, J. S. Lee, and W.

H. Kwon, “OThe implementation and the application of CEMTool,” in proceedings of the 14th KACC, 1999.

[3] W. H. Kwon, K. B. Kim, S. K. Choi, H. J. Kim, and S.

H. Han, “The technical trend and the practical appli- cation of the real-time control system design in CEM- Tool,” ICASE Magazine, vol. 5, pp. 18-26, 1999.

[4] W. H. Kwon, K. B. Kim, and S. G. Choi, “Control System Design and Analysis with CEMTool for Control

(5)

Education,” Transaction on Control, Automation, and Systems Engineering, March, 1999.

[5] W. H. Kwon, K. B. Kim, and S. G. Choi, “Control System Design and Analysis with SIMTool and CEM- Tool for Control Education,” Transaction on Control, Automation, and Systems Engineering, March, 2000.

[6] C. K. Ahn, S. H. Han, Y. S. Lee, and W. H. Kwon,

“On the Implementation of GUI Based Finite Element Method Library in CEMTool,” In the proceedings of KIME Annual Conference, 2002.

[7] C. K. Ahn, T. I. Lee, S. H. Han, Y. S. Lee, and W. H.

Kwon, “On the Implementation of PDE Solver using Fi- nite Element Method in CEMTool,” In the proceedings of KIEE Annual Conference, 2003.

[8] C. K. Ahn, S. H. Han, and W. H. Kwon, “An Equation Based Approach to the Implementation of Generalized PDE Solver in CEMTool,” Submitted to 16th Interna- tional Conference on Computer Applications in Indus- try and Engineering , Las Vegas, Nevada USA, 2003.

참조

관련 문서

특히 화상 환자들의 경우 피부 기증을 통한 동종피부이식 수술을 통해 생존율이 높 아졌다고 하는데 아직까지는 피부조직의 대부분을 해외로부터의 수입에 의존하는 , 것이 현실

노인에서의 수면 무호흡으로 인한 장기적 합병증이 중년 환자와 비교하여 차이가 있는지 여부는, 노인의 수면 무호 흡을 하나의 특정질환으로 간주할 것인지 아니면 노인의

혼합제를 사용하여도 천식 조 절이 되지 않는 경우 경구 약제인 류코트리엔 조절제 그리 고 (또는) 테오필린을 추가하여 사용한다. 류코트리엔은 효 과 면에서는

 The Dutch physicist Pieter Zeeman showed the spectral lines emitted by atoms in a magnetic field split into multiple energy levels...  With no magnetic field to align them,

Modern Physics for Scientists and Engineers International Edition,

12) Maestu I, Gómez-Aldaraví L, Torregrosa MD, Camps C, Llorca C, Bosch C, Gómez J, Giner V, Oltra A, Albert A. Gemcitabine and low dose carboplatin in the treatment of

Levi’s ® jeans were work pants.. Male workers wore them

웹 표준을 지원하는 플랫폼에서 큰 수정없이 실행 가능함 패키징을 통해 다양한 기기를 위한 앱을 작성할 수 있음 네이티브 앱과