Finite Elements Using Maple: A Symbolic Programming Approach [1 ed.] 978-3-642-62755-2, 978-3-642-55936-5

Providing the user with a unique insight into the finite element method, along with symbolic programming that fundamenta

215 84 18MB

English Pages 326 [335] Year 2002

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Front Matter....Pages I-XV
Introduction to Maple....Pages 1-44
Computational Mechanics....Pages 45-58
Approximation Methods....Pages 59-133
Interpolation....Pages 135-177
The Finite Element Method....Pages 179-222
Fluid Mechanics Applications....Pages 223-249
Solid Mechanics Applications....Pages 251-318
Back Matter....Pages 319-325
Recommend Papers

Finite Elements Using Maple: A Symbolic Programming Approach [1 ed.]
 978-3-642-62755-2, 978-3-642-55936-5

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

A. Portela • A. Charafi Finite Elements Using Maple

Springer-Verlag Berlin Heidelberg GmbH

Engineering

ONLINE lIBRARY

http://www.springer.deleng inel

A. Portela • A. Charafi

Finite Elements Using Maple A Symbolic Programming Approach

lst ed. 2002. Corr. 2nd printing

,

Springer

Professor Artur Portela New University of Lisbon Civil Engineering Department Faculty of Science and Technology Quinta da Torre 2825-114 Caparica Portugal e-mail: [email protected]

Dr. Abdellatif Charafi University of Portsmouth Computational Mathematics Group School of Computer Science and Mathematics Mercantile House Portsmouth POl 2EG United Kingdom e-mail: [email protected] Additional material to this book can be downloaded from http://extras.springer.com. ISBN 978-3-642-62755-2

Library of Congress Cataloging-in-Publication-Data applied for Die Deutsche Bibliothek - CIP-Einheitsaufnahme Portela, Artur: Finite elements using maple : a symbolic programming approach 1 A. Portela ; A. Charafi.Berlin; Heidelberg ; New York; Barcelona ; Hong Kong ; London ; Milan ; Paris; Tokyo: Springer, 2002 (Engineering online Iibrary) ISBN 978-3-642-62755-2 ISBN 978-3-642-55936-5 (eBook) DOI 10.1007/978-3-642-55936-5

This work is subject to copyright. AII rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of iIIustrations, recitations, broadcasting, reproduction on microfilm or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German copyright Law of September 9,1965, in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are Iiable for prosecution under the German Copyright Law.

http://www.springer.de © Springer-Verlag Berlin Heidelberg 2002 OriginalIy published by Springer-Verlag Berlin Heidelberg New York in 2002

The use of general descriptive names, registered names trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typesetting: data delivered by authors Cover design: de'blik, Berlin Printed on acid free paper 62/3020/M - 5 4 3 2 1 O

To Eliane, Saffa, Felipe and lbrahim, who make life a gift.

Maple and Maple V are registered trademarks of Waterloo Maple Inc.

Preface

Almost alI physical phenomena can be mathematicalIy described in terms of differential equations. The finite element method is a tool for the approximate solution of differential equations. However, despite the extensive use of the finite element method by engineers in the industry, understanding the principles involved in its formulation is often lacking in the common user. As an approximation process, the finite ・ャセョエ@ method can be formulated with the general technique of weighted residuals. This technique has the advantage of enhancing the essential unity of alI processes of approximation used in the solution of differential equations, such as finite differences, finite elements and boundary elements. The mathematics used in this text, though reasonably rigorous, is easily understood by the user with only a basic knowledge of Calculus. A common problem to the courses of Engineering is to decide about the best form to incorporate the use of computers in education. Traditional compilers, and even integrated programming environments such as Turbo Pascal, are not the most appropriate, since the student has to invest much time in developing an executable program that, in the best of cases, will be able to solve only one definitive type of problems. Moreover, the student ends up learning more about programming than about the problem that he/she wants to solve with the developed executable program. The use of electronic spread sheets does not improve substantialIy this panorama since, beyond stil! demanding a significant effort of programming, they do not have the didactic characteristics necessary to the education in Engineering. Maple is a computational environment with symbolic, numerical and graphical programming capabilities that alIows a radical change in the way computers are used in education. Effectively, Maple software can be used in the form of non-declarative programming which means that the user telIs the system what to do, without telling it how to do. Thus, Maple opens to the student the possibility of investing less time in programming and much more time in the study of the problem under consideration. Maple software embodies advanced technology that includes symbolic computation, infinite precision numerics and a powerfullanguage for solving a wide range of mathematical problems encountered in modelling and simulation, as well as in technica! education. Over a million world-wide users have adopted Maple system

VIII

Preface

as their preferred platform for exploring and managing complex problems in engineering, science, mathematics and education. Virtually every major university and research institute in the world, including Massachusetts Institute of Technology, Stanford, Oxford and Waterloo, have adopted Maple software as an essential tool to enhance their education and research activities. This textbook illustrates how Maple can be used in a finite element introductory course. Providing the user with a unique insight into the finite element method, along with symbolic programming that fundamentally changes the way applications can be developed. This book is an essential tool written to be used as a primary text for an undergraduate or early postgraduate course, as well as a reference book for engineers and scientists who want to develop quickly finite-element programs. The book is split into 7 chapters and 1 appendix. Chapter 1 presents a brief introduction of the computational system Maple, referring only to the aspects considered relevant in programming the finite element method which include mainly symbolic programming and graphic visualization. Chapter 2 presents an introduction to Computational Mechanics which deals with the mathematical modelling process of physical systems. The chapter begins with the presentation of the essential objective of the whole modelling process, the substitut ion of the continuous model of the physical system by a discrete model that is represented by a system of algebraic equations. A classification of physical systems, based on the type of the differential equation that defines the respective continuum model, is presented. As a consequence of the difficulty in obtaining analytical solutions of the differential equation that represents the continuous model of the physical system, the discretization process is then introduced to generate discrete models which lead to approximate solutions. Chapter 3 deals with the formulation of weighted residual approximation methods. The general equation of weighted residuals is presented as the start ing point of their formulation. The chapter considers first the case of approximation functions with a global definition and indirect discretization, setting up their admissibility conditions. Domain and boundary models are defined on the basis ofthe possibility ofthe approximation function satisfying the boundary conditions. The methods of Galerkin, least squares, moments and collocation, obtained by defining the appropriate weighting functions, are presented. Integration by parts of the general weighted residual equation is used to obtain weaker admissibility conditions for the approximation function, leading to the weak and transposed forms of the weighted residual equation. Approximation functions with a piecewise continuous definition and direct discretization are then considered, as well as their respective admissibility conditions. Finally, the models of finite differences, finite elements and boundary elements are presented, as representative of the direct methods with piece-wisely defimid continuous approximation.

Preface

IX

Chapter 4 presents some topics of interpolation. The chapter begins with general aspects of interpolation with both global and piecewise functions. The difficulty of spline interpolation is contrasted with the simplicity of finiteelement interpolation. Finite element interpolation functions, defined in terms of generalized coordinates, are first introduced along with the convergence conditions, referred to as conditions of compatibility and completeness. Finite elements with interpolation in terms of shape functions are then considered. Natural coordinates as well as curvilinear coordinates are introduced leading to the formulation of parametric finite elements. Chapter 5 introduces the finite element method. A steady-state continuous model, with a scalar variable, is considered for two--dimensional problems. Linear triangular isoparametric finite elements are used. The finite element package Cgt_fem, specially developed using Maple, is used to present the basic steps in the application of the finite element method. Chapter 6 applies the finite element method to problems of Fluid Mechanics. A description of continuous models relative to perfect-fluid flows, free-surface flows and flow through porous media is first presented. Finally, the finite element method is applied to sol ve steady-state problems, with the Maple package CgtJem. Chapter 7 formulates and applies the finite element method to problems of Solid Mechanics. The presentation, confined to the linear theory, deals with the so--ca!led assumed-displacement formulation. The chapter begins with a summary of the general continuous model that is the three-dimensional theory of elasticity, presenting the concepts of static and kinematic admissibility. The correspondence between the work theorem, specified for a virtual displacement, and the equation of weighed residuals is then presented. The minimum total potential energy is used to show that the finite element model is more rigid than the exact solution. Asymptotic models, derived from the three-dimensional model, are established for both one-dimensional and two--dimensional structural elements. The essential aspects of finite-element meshes are analyzed focusing, in particular, on the respective topology optimization. Maple package CstJem, specially developed for the finite element analysis of two--dimensional elasticity problems with linear triangular isoparametric elements, is then presented aud applied to the solution of severa! problems. Appendix A presents details of the content of the companion CD-ROM. AH the application examples ofthe book are included in the CD-ROM, where the results are presented in colour and with animations. The approach followed in this book allows the reader to have an integrated view of the mathematical modelling aspects of physical systems. Furthermore, the unity in the formulation of the finite difference, finite element and boundary element approximation methods emerges clearly in this text. The finite element method is now well established as a tool for numerical solution of mathematical models in Engineering. However, the use of symbolic compu-

x

Preface

tation in Maple system delivers new benefits in the analysis that may have a real impact on teaching the method. FinalIy, the authors wish to thank alI those who made this book possible, specialIy our families for giving us the time, which should have been theirs, to write this book. New University of Lisbon, Portugal University of Portsmouth, United Kingdom

Artur Portela Abdelatiff Charafi

Contents

1.

Introduction to Maple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Basics................................................. 1.2 Entering Commands .. . .. .. . . . . . . . . . . .... .. . .... . . ... . . . 1.3 Fundamental Data Types . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . 1.4 Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Names................................................ 1.6 Basic Types of Maple Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6.1 Sequences....................................... 1.6.2 Lists............................................ 1.6.3 Sets............................................ 1.6.4 Arrays.......................................... 1.6.5 Tables.......................................... 1.6.6 Strings.......................................... 1.7 Evaluation Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7.1 Levels of Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7.2 Last-Name Evaluation ............................ 1.7.3 One-Level Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7.4 Special Evaluation Rules .... . . . . . . . . . . . . . . . . . . . . .. 1.7.5 Delayed Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.8 Aigebraic Equations .................................... 1.9 Differentiation and Integration . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.10 Solving Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.11 Expression Manipulation ....... . . . . . . . . . . . . . . . . . . . . . . . .. 1.12 Basic Programming Constructs. . . . . . . . . . . . . . . . . . . . . . . . . .. 1.13 Functions, Procedures and Modules. . . . . . . . . . . . . . . . . . . . . .. 1.14 Maple's Organizat ion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.15 Linear Algebra Computations . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.16 Graphics .............................................. 1.17 Plotter: Package for Finite Element Graphics ............. 1.17.1 Example ............... . . . . . . . . . . . . . . . . . . . . . . . .. 1.17.2 Example ........................................ 1.17.3 Example ........................................

1

1 1 3 3 4 5 5 6 6 7 7 8 8 8 9 9 10 10 11 12 14 15 16 16 19 20 31 34 39 41 42

XII

Contents

2.

Computational Mechanics ................................ 2.1 Introduction........................................... 2.2 Mathematical Modelling of Physical Systems . . . . . . . . . . . . . .. 2.3 Continuous Models .............................. ,. . . . .. 2.3.1 Equilibrium..................................... 2.3.2 Propagation..................................... 2.3.3 Diffusion........................................ 2.4 Mathematical Analysis ................................. , 2.5 Approximation Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2.6 Discrete Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2.7 Structural Models ................ . . . . . . . . . . . . . . . . . . . . ..

45 45 45 47 47 49 51 52 52 55 56

3.

Approximation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.1 Introduction........................................... 3.2 Residuals.............................................. 3.3 Weighted-Residual Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.3.1 Example........................................ 3.4 Approximation Functions ............................... , 3.5 Admissibility Conditions ................................ 3.5.1 Example........................................ 3.6 Global Indirect Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.6.1 Satisfaction of Boundary Conditions . . . . . . . . . . . . . . .. 3.6.2 Domain Methods of Approximation . . . . . . . . . . . . . . . .. 3.6.3 Galerkin Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.6.4 Least Squares Method ............................ 3.6.5 Moments Method ................................ 3.6.6 Collocation Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.6.7 Example........................................ 3.6.8 Example........................................ 3.7 Integration by Parts .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3.7.1 Strong, Weak and Transposed Forms ................ 3.7.2 One-Dimensional Case... . . .. .. . . . .... ...... .... .. 3.7.3 Example........................................ 3.7.4 Higher-Dimensional Cases . . . . . . . . . . . . . . . . . . . . . . . .. 3.7.5 Example........................................ 3.8 Local Direct Discretization .............................. 3.8.1 Nodes and Local Regions. . . . . . . . . . . . . . . . . . . . . . . . .. 3.8.2 Satisfaction of Boundary Conditions . . . . . . . . . . . . . . .. 3.8.3 Finite Difference Method . . . . . . . . . . . . . . . . . . . . . . . . .. 3.8.4 Finite Element Method ........................... 3.8.5 Boundary Element Method . . . . . . . . . . . . . . . . . . . . . . .. 3.8.6 Example........................................ 3.8.7 Example........................................ 3.8.8 Example ........................................

59 59 60 61 61 62 62 63 64 65 66 66 67 67 68 70 82 84 84 85 85 86 88 88 89 89 90 93 96 98 113 132

Contents

XIII

4.

Interpolation . ............................................ 4.1 Introduction ........................................... 4.2 Globally Defined Functions .............................. 4.2.1 Polynomial Bases ................................. 4.2.2 Example ........................................ 4.2.3 Example ........................................ 4.2.4 Conclusions ...................................... 4.3 Piecewisely Defined Functions ............................ 4.3.1 Spline Interpolation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 4.3.2 Finite Element Interpolation ....................... 4.4 Finite Element Generalized Coordinates ................... 4.4.1 Convergence Conditions ........................... 4.4.2 Geometric Isotropy ............................... 4.4.3 Finite Element Families ........................... 4.5 Finite Element Shape Functions .......................... 4.5.1 Natural Coordinates .............................. 4.5.2 Curvilinear Coordinates ........................... 4.5.3 Example ........................................ 4.6 Parametric Finite Elements .............................. 4.7 Isoparametric Finite Elements ............................ 4.7.1 Convergence Conditions ........................... 4.7.2 Evaluation of Element Equations ................... 4.7.3 Numerical Integration ............................. 4.8 Linear Triangular Isoparametric Element .................. 4.8.1 Example ........................................ 4.8.2 Example........................................ 4.8.3 Example........................................ 4.8.4 Example........................................

135 135 136 136 137 138 142 143 143 144 145 145 146 146 148 150 156 157 161 162 162 164 166 168 169 171 174 176

5.

The Finite Element Method .............................. 5.1 Introd uction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 5.2 Steady-State Models with Scalar Variable ................. 5.2.1 Continuous Model ................................ 5.2.2 Weighted Residual Galerkin Approximation .......... 5.2.3 Discrete Model ................................... 5.3 Finite Element Mesh .................................... 5.3.1 Linear Triangular Isoparametric Element ............ 5.3.2 Total Potential Energy ............................ 5.3.3 Internal Potential Energy Density .................. 5.3.4 Mesh Topology ................................... 5.4 Local Finite Element Equations .......................... 5.5 Global Finite Element Equations ......................... 5.6 Exact Boundary Conditions .............................. 5.7 Solution of the System of Equations ...................... 5.8 Computation of Derivatives ..............................

179 179 179 180 183 185 186 187 188 188 189 190 192 193 194 194

XIV

Contents 5.9 Finite Element Pre- and Post- Processing .................. 5.10 Cgt_fem: Package for Finite Element Analysis ............. 5.10.1 Data Preparation ................................. 5.11 Example .............................................. 5.12 Example .............................................. 5.13 Example .............................................. 5.14 Example ..............................................

196 197 197 198 208 213 217

6.

Fluid Mechanics Applications ............................. 6.1 Introduction ........................................... 6.2 Continuous Models of Fluid Flow ......................... 6.2.1 Incompressible Fluids ............................. 6.2.2 Inviscid Fluids ................................... 6.2.3 Irrotational Flows ................................ 6.2.4 Steady-State Flows ............................... 6.2.5 Bernoulli's Energy Conservation .................... 6.2.6 Velocity Potential ................................ 6.2.7 Stream Function ................................. 6.3 Confined Flows ......................................... 6.4 U nconfined Flows ...................................... 6.5 Groundwater Flows ..................................... 6.5.1 Darcy's Hypothesis ............................... 6.5.2 Dupuit's Hypothesis .............................. 6.6 Example .............................................. 6.6.1 Flow U nder a Dam ............................... 6.6.2 Problem's Solution ............................... 6.7 Example .............................................. 6.7.1 Flow in an Unconfined Aquifer ..................... 6.7.2 Problem's Solution ...............................

223 223 223 223 224 224 224 225 226 226 227 228 229 229 231 232 232 233 240 240 241

7.

Solid Mechanics Applications ............................. 7.1 Introduction ........................................... 7.2 Continuous Models ..................................... 7.3 Fundamental Continuous Model: Elasticity Theory ......... 7.3.1 Strain-Displacement Equations ..................... 7.3.2 Equilibrium Equations ............................ 7.3.3 Stress-Strain Equations ........................... 7.3.4 Boundary Conditions ............................. 7.3.5 Elastic Fields .................................... 7.3.6 The Work Theorem ............................... 7.3.7 Theorem of Virtual Displacements .................. 7.3.8 Theorem of Total Potential Energy ................. 7.4 Finite Element Model ................................... 7.4.1 Weighted Residual Equation ....................... 7.4.2 Theorem of Work ................................

251 251 251 252 253 253 254 254 255 256 256 256 257 257 258

Contents

7.5

7.6 7.7 7.8 7.9

7.10

7.11

7.4.3 Theorem of Virtual Displacements .................. 7.4.4 Discretization .................................... Mesh Topology ......................................... 7.5.1 Total Strain Energy .............................. 7.5.2 Distribution of the Strain Energy Density ........... Constrained Displacements .............................. Application of the Finite Element Model .................. Three-Dimensional Equilibrium States .................... 7.8.1 Constant-Strain Tetrahedron Element ............... Two-Dimensional Equilibrium States ...................... 7.9.1 Plane Stress and Plane Strain ...................... 7.9.2 Asymptotic Model: Plane Elasticity ................. 7.9.3 Constant-Strain Triangular Isoparametric Element .... 7.9.4 CsLfem: Package for Finite Element Analysis ....... 7.9.5 Data Preparation ................................. 7.9.6 Example ........................................ 7.9.7 Example ........................................ 7.9.8 Example ........................................ 7.9.9 Example ........................................ One-Dimensional Equilibrium States ...................... 7.10.1 Asymptotic Model: Theory of Bars ................. 7.10.2 Truss Element ................................... 7.10.3 Skew Elements ................................... 7.10.4 Beam Element ................................... Further Study ..........................................

xv 259 259 261 261 262 262 264 265 265 267 267 269 270 273 274 275 281 284 292 302 303 312 314 315 318

A. The Companion CD-ROM ................................ 319 References .................................................... 321 Index ......................................................... 323

1. Introduction to Maple

1.1 Basics Maple is a symbolic computational system. This means that it does not require numerical values for all variables, as numerical systems do, but manipulates information in a symbolic or algebraic manner, maintaining and evaluating the underlying symbols, like words and sentence-like objects, as well as evaluates numerical expressions. As a complement to symbolic operations, Maple provides the user with a large set of graphic routines, numerical algorithms and a comprehensive programming language. This chapter presents a brief introduction to those aspects of Maple that are relevant in the study of the finite element method. Hence, it is important to work through this chapter, carefully studying the examples. The set of notes presented here are not meant to replace neither Maple's Learning Guide [lJ nor Maple's Programming Guide [2]. For a quick information on how to get started using Maple, and its worksheet interface, the reader should consult Maple's help facility on the following subjects: • Overview of basic features - a description of the main features of Maple that the reader needs to know to get started using Maple. • Using help - a description of the various ways to use Maple's online help. • Worksheet interface - a description of the Maple worksheet. • Overview of menu bar - a description of the menu bar and the various sets of menus available. • Toolbar - a description of the buttons on the various toolbars. • Style guide - displaying a list of the various character styles used on the help pages. • Exit maple - a description of how to leave Maple. • New user's tour - an overview of the functionality and a quick tour of the features of Maple.

1.2 Entering Commands Maple is essentially an interactive computational system in which the user enters commands and the computer responds to those commands. The system A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

Introduction to Maple

2

displays a prompt, the> sign, when it is ready for input. The commands given to the system are typically assignments, manipulation of algebraic expressions and function calls. Notice that Maple is case sensitive. Statements must be terminated with a semicolon, the; sign, or with a colon, the : sign, in order to let the system parser know that a command reached the end. While the semicolon causes the system to print back the result of the given command, the colon suppresses the output. To extend a command over several lines, the user should hit the Enter key to start a new line. Multiple commands on the same line are allowed, provided each one ends with a valid terminator. The following examples show the input/output dialogue with Maple. They also show that Maple performs arithmetic both numerically and symbolically. Notice that the> sign is displayed by the system when it is waiting for input. > 3*5; 15 > 2+8+1 > +3+4; 18 4*x+2+1+x; > 5x+3 HMRIセ[@ > MRセ[@ -2**2;

-4 4

-4 While typing an expression, the user can backspace to any point and retype from there on, or use the arrow keys or the mouse to move the cursor and delete characters or insert additional ones. When entering a command, the cursor does not have to be at the end of the line, in order for Maple to process it. If a given command is not recognized, for instance by misspelling or calling a function that is not yet defined, the system returns the input as it is, with no explanation. The order of precedence for arithmetic operators is defined as that of most common programming languages. Parentheses can be used to define a specific order of operations, as shown in the previous example. Help on any Maple topic can be accessed on-line by preceding the topic with a question mark as shows the following command. Help can also be accessed from the appropriate Maple interface window. > ?precedence Reference to the immediately previous result that is the last evaluated expression, is done with the % mark. Similarly, reference to the second to last and third to last evaluated expressions is done, respectively by the %% and %%% marks. > x+1;

1.4 Mathematical Functions

3

x+1 >

%+2: %+%%+3;

>

%%%;

2x+7 x+1

1.3 Fundamental Data Types Integer numbers, rational numbers, irrational numbers and floating-point numbers are the fundamental data types. Except for the case of floatingpoint numbers, the system arithmetic is exact to as many digits as necessary. The function evalf gives a floating-point approximation to an exact result. > 4/2; 1/2+1/3; 2 5 6 > %; evalf(%); evalf(%%,20); evalf[15] (%%%); 5 6

.8333333333 .83333333333333333333 .833333333333333 The global variable Digits controls the accuracy of the floating-point arithmetic. Its value can be changed as needed by the user. Different data types in the same expression are usually converted to floating-point evaluation. > 1/3+0.5; 0.5+2-(1/2); evalf(%);

.8333333333 .5 + v'2 1.914213562

1.4 Mathematical Functions Table 1.1 lists some of Maple's functions that are most commonly used. For a complete listing, the user should consult Maple's help facility, typing the command > ?inifunctions > sin(alpha*x); In(exp(2)); sqrt(-l); 4*arctan(1); sin(o: x)

Introduction to Maple

4

2 I 1f

Table 1.1. Common mathematical functions Maple Name

Description

abs

absolute value

sqrt

square root

exp

exponential function

In, log

natural logarithm

log 10

base 10 logarithm

sin, cos, tan, esc, sec, cot

trigonometric

sinh, cosh, tanh, csch, sech, coth

hyperbolic

1.5 Names Maple's objects are represented by symbols. Names, or variables, are used to assign any Maple object. Unassigned names have no value other than their own name. Some symbols are readily recognized by the system. The capitalization of the English spelling of a Greek letter determines always the case of the output, except for the letter Pi, which is the mathematical constant 3.1415 ... that must not be confused with the Greek letter defined by the symbol 1f. The I symbol is a Maple constant that represents the imaginary unit A and, as in the case of Pi, should not be used as a symbolic variable. The system gives a warning whenever the user tries to assign values to these constants. >

sin(beta*x); tan(Pi); exp(l); sin(,8 x)

o e >

1-2; sqrt(-l); arctan(l); -1 I 1

-1f

4 For a complete listing of the system reserved symbols, the user should consult Maple's help facility, typing the following command:

1.6 Basic Types of Maple Objects

>

>

5

?ininames x:=3*5-1/2j

29 x.'-2 > >

a: =z=y+4j Xj aj abcj

a:= z = y + 4 # The name abc is unassigned.

29 2

z=y+4 abc >

> >

y:=1+u-2j u:=3j Yj y:= 1 + u 2 u:= 3 10 'this is a name':=x+l/2j this is a name := 15 'this is a name'+10j

25

1.6 Basic Types of Maple Objects This section introduces the basic types of Maple objects, which are sequences, lists, sets, arrays, tables and strings.

1.6.1 Sequences Maple objects separated by commas make up a sequence. The order and repetition of objects is preserved. >

restart: 1,2,a,b,2,x+y,y=2*xj

>

1, 2, a, b, 2, x d,e,f:=z,2,3*x+yj

>

d, e, seq(2*d+l, d=1 .. 5)j

>

f

:=

+ y, y = 2 x

z, 2, 3 x

+y

3,5,7,9, 11 >

yes:=%j yes [2] j yes := 3, 5, 7, 9, 11

5

Introduction to Maple

6

1.6.2 Lists

A list is a sequence of objects enclosed by square brackets. The order and repetition of objects is preserved. > restart: > yes:=[a,b,cJ,[a,a,c,bJ;

yes >

:=

[a, b, c], [a, a, c, bJ

yes [2J; yes [2J [3J; yes [2J [J ;

[a, a, c, bJ

>

c a, a, c, b lst:=yes[2J; lst:=[lst[J,x+yJ;

lst >

>

:=

[a, a, c, bJ

lst := [a, a, c, b, x nops(lst); op(4,lst); 5 b member(c,lst,'i'); i; true

+ yJ

3 1.6.3 Sets

A set is a sequence of objects enclosed by curly brackets. The order and repetition of objects are not preserved. > restart: > nice:={a,a,b,c,b,a,2*x+y+z};

>

nice := {a, b, c, 2 x + y nice[lJ; nice[2J; nice[J; a b a, b, c, 2 x + y + z nice union {a,b,k};

>

{a, b, c, k, 2 x nice intersect {a,b,k};

>

{a, b}

+ z}

+ y + z}

1.6 Basic Types of Maple Objects

7

1.6.4 Arrays

The array object is a generalization of the list concept, in which each element is associated with an index, but is no longer restricted to one dimension. > restart: > mat:=array(1 .. 2,1 .. 2); mat := array(1..2, 1..2, [])

>

mat [1,2] :=x+y; mat[2,1] :=4; matl,2 := x

+y

mat2,1 := 4

>

mat; print(mat); mat

セ。ZLy@

[rna:" >

mat:=array([[5,x+y],[4,7]]);

ュ。エセ@ >

1

[:

xセy@ 1

mat[1,2]; mat[2,1]; evalm(mat); x+y 4

1.6.5 Tables

A table is an extension of the array concept that can have symbolic indices. > restart: > tb:=table([i=me,j=you,k=him]); tb := table([i = me, j = you, k = him])

>

tb[i]; tb[k]; me him

>

indices(tb); entries(tb);

[i], [j], [k] [me], [you], [him]

Introduction to Maple

8

1.6.6 Strings

A string is created by enclosing any number of characters in double quotes. > restart: > str: ="this string"; >

str := "this string" str[3]; str[6 .. 11]; str[6 .. -3]; str[l .. -8]; "i" "string" "stri" "this"

>

> >

st:="whatch" 1 I" "Ilstr; st := "whatch this string" length(st); 18 substring("abcdefgh" ,-5 .. -1 ); "defgh"

1. 7 Evaluation Rules Evaluation is a key issue in any symbolic system. It refers to the replacement of assigned names in an expression by their respective value. 1. 7.1 Levels of Evaluation

As a rule, Maple does full evaluation of names. Under full evaluation, all the assigned names in an expression are replaced by their respective value. If this value itself has an assigned value, Maple performs a substitution again, recursively, until no more substitutions are possible. > restart: > a:=b+l; b:=c; c:=5;

a:= b+ 1 b:= c c:= 5 >

>

a;

6 eval(a,l); eval(a,2); eval(a,3); eval(a); b+l c+l

1. 7 Evaluation Rules

>

abc:=abc+l;

9

6 6 # This can lead to an infinite recursion

Error, recursive assignment

Exceptions of the full-evaluation rule include last-name evaluation for special data structures like matrices, tables and procedures, one-level evaluation for local variables inside a procedure and delayed evaluation with single quotes. 1.7.2 Last-Name Evaluation The data structures array, table, matrix and proc have a special evaluation rule called last-name evaluation. > restart: > d:=e; e:=f; f:=array([[1,2], [3,4]]);

d:= e e:= f

>

d·,

>

eval(d);

f #

Forcing full evaluation.

1.7.3 One-Level Evaluation Local variables of a procedure use one-level evaluation. > restart: > test:= procO > local x, y, z·, > > > > > >

x:=y+1; y:=z; z:=5; x·, end proc: testO;

y+l

10

Introduction to Maple

1. 7.4 Special Evaluation Rules The following functions evaluate their arguments to their respective names. > restart: > g:=h; h:=i; g:= h

h:= i >

g; evaln(g); i g

>

assigned(g); assigned(var);

true false 1.7.5 Delayed Evaluation The use of single quotes delays evaluation one level. > restart: > i:=3; i:= 3 > i; 'i'+5; %; 3 i+5 8 > '3+'i'-1'; %; %; 2 + 'i' 2 +i 5 > is(evaln(i)='i');

true A name can be unassigned, or cleared, by assigning it to its own name. > i; i:='i'; i;

3 i:= i i

The command restart clears all previously assigned names at once. > i:=22; restart; i; i:= 22

1.8 Algebraic Equations

11

1.8 Algebraic Equations Maple's solve command is a general-purpose equation solver. > restart: > solve (x-a-2*x+b=c*y, x);

b - cy

+a 2

-1 >

x;

>

solve (x-3-13*x+12, x);

>

1,3, -4 eqns:={x+2*y=3, y+l/x=l};

x

eqns:= {x+2y >

= 3,

1 y+ -

x

= I}

sltn:=solve(eqns,{x,y}); 1 sltn:= {x = -1, y = 2}, {x = 2, y = "2}

>

eval(eqns, sltn[l]); eval(eqns, sltn[2]); {I

= 1, 3 = 3}

{I = 1, 3 = 3} >

x, y; x,y

>

assign(sltn[l]); x, y;

-1,2 > >

restart: sltn:=solve(x-4+x+l, x);

sltn := RootOf(_Z4 + _Z + 1, index = 1), RootOf(_Z4 + _Z + 1, index = 2), RootOf(_Z4 + _Z + 1, index = 3), RootOf(_Z4 + _Z + 1, index = 4) >

>

?RootOf allvalues(sltn[l]);

1 1 -v'6J%2- 12 12

6 J%2%1 + 288 J%2 + 72 v'6 (108 + 12 I J687)(1/3) (108 + 12 I v'687) (1/3) J%2

%1 := (108 + 12 I v'687)

%1 +48 (108 + 12 I v'687)(1/3) evalf(sltn[l]); .7271360845 + .9340992895 I

12

Introduction to Maple >

fsolve (x-4+x+l=O , x, complex); -.7271360845 - .43001428831, -.7271360845 + .43001428831, .7271360845 - .93409928951, .7271360845 + .93409928951

>

%[4];

>

.7271360845 + .93409928951 fsolve(cos(x)-x, x); .7390851332

1.9 Differentiation and Integration A few simple, but important, examples of Maple's differentiation and integration are presented here. > >

restart: expr:=x-4/y; diff(expr, x); X4

expr:= y x3

4-

>

Y diff(expr,x,x)=diff(expr,x$2); x2 12-

Y

>

Diff(expr,x); value(%);

>

g:=unapply(expr,x,y);

x2

= 12Y

g:= (x, y) >

セᆳ

X4

y

diff(g,x$2); diff(g(x,y),x$2);

o QRセ@ >

Y

D[l] (D[1] (g))=D[l,l] (g); ((x, y)

>

2

セ@

x2 12-) Y

= ((x, y) セ@

x2 12-) y

D[1] (g); D[1,1] (g); D[1,1,1] (g); D[2] (g) ;

1.9 Differentiation and Integration

13

x3 (x, y) ----; 4 Y

x2 (x, y) ----; 12y

x (x, y) ----; 24y X4

(x, y) ----;-2" y

>

2D(f) f + 3D(y) y2 D(ln)(x) = diff(ln(x),x); 1

>

1

x x D(sin); D(ln); D(ln)(S); D(cos-2+Pi+x-3+z-S); cos 1

a----;-

a

1

>

5 - 2 sin cos + 3 D (x) x 2 + 5 D (z) int(x-2,x); Int(x-2,x); value(%); 1

3"x

Z4

3

JX dX 2

1 3

-x >

3

Int(x-a,x=-l .. l); value(%);

1

1 xadx

-1

1 +e(I7ra)

+ セ@ >

x(a+1)) x(a+1)) x(a+1)) lim - a+ @セ lim - + @セ lim - - a+ @セ lim -x(a+1)) -a+1 x-+O- a + 1 x-+O+ a+1 x-+O+ a+1 a+1

x-+O-

subs(a=2,%); value(%);

-1 + -1 e(2 I 7r) + ( lim 3

>

3

1

x-+O- 3 2

x 3)

+ (lim

x-+O+

1

__ 3

x 3)

3 Int(exp(-a*t-2), t=-infinity .. infinity); value(%);

14

Introduction to Maple

i: o セ@

{

e(-at 2 )

dt

csgn(a)

>

assume(a>O); value(%);

>

about (a) ;

=1

otherwise

Originally a, renamed a-: is assumed to be: RealRange(Open(O),infinity)

a:= 'a'; # clear assumptions made on a a:= a Int(exp(-x-3), x=O .. l); value(%);

> >

11 セ@ >

e(-1/2)

wィゥエ。ォ・イmHセ@

セ@

4 evalf(%%,25);

6' 3'

e(-x 3 )

1)

dx

+ ・HセQORI@

wィゥエ。ォ・イmHセ@

セ@

6' 3'

1)

.8075111821396714528583332

1.10 Solving Differential Equations The following examples show the essential aspects of the solution of differential equations with Maple. > restart: > eqt:=diff(x(t),t)+alpha*x(t)=O;

eqt >

:=

(Zt x(t))

+ ax(t) =

dsolve({eqt, x(O)=a}, x(t));

x(t) =

ae(-at)

>

evaHeqt, %);

>

0=0 x:=unapply(rhs(%%),t); x(b); x := t ----* ae(-nt) ae(-nb)

>

x:='x';

0

1.11 Expression Manipulation

15

>

x :=x eqt:=diff(x(t),t$2)+omega-2*x(t)=0;

>

eqt:= 22 x(t)) +w 2 x(t) = 0 dso1ve({eqt, x(O)=a, D(x) (O)=v}, x(t));

(tt

x(t) = > >

v sinew t)

+ a cos(wt)

w

infolevel[dsolve]:= 3; infoleveldsolve := 3 diff(x(t),t$2)+sin(x(t))=0;

(tt

22 x(t)) + sin(x(t)) = 0 The result of a dsolve call with the numeric option is a function. > dsolve({%, x(0)=1, D(x) (O)=O}, x(t), type=numeric);

dsolve/numeric:

entering

DEtools/convertsys: converted to first-order system Y'(x) f(x,Y(x)) namely (with Y' represented by YP)

[YP 1 DEtools/convertsys: original functions:

= Y2 ,

= -sin(Yd]

YP 2

correspondence between Y[i] names and

[Y1 = x(t), Y 2 =

ft x(t)]

dsolve/numeric: vector Y of initial conditions at xO = array(1 .. 2,[(1)=1.,(2)=0.])

O.

dsolve/numeric: the procedure F(x,Y,YP) for computing Y'(x) f(x,Y(x)) is: proc (N, t, Y, YP) YP[1] := Y[2]; YP[2] := -sin(Y[l]) end proc

proc(rkf45_x) ... end proc >

%(0.5);

[t = .5, x(t) = .896032547122954214,

tt x(t) = -.410878513754335872]

1.11 Expression Manipulation A few examples of the most commonly used commands are presented here. > restart: > (x-2-4)/(x+2); simplify(%);

>

x2 - 4 x+2 x-2 factor(x-4-16); expand(%); (x - 2) (x

+ 2) (x 2 + 4)

Introduction to Maple

16

X4

-16

>

expand(sin(alpha+beta));

>

sin( 0:) cos(f3) + cos( 0:) sin(f3) (1+a-x)*(x+a)-2; expand(%); collect(%,x); sort(%,a);

(l+a-x)(x+a?

+ 2 x a + a2 - a x 2 + x a 2 + a3 - x 3 + (-a + 1) x 2 + (a 2 + 2 a) x + a3 + a2 a3 + a2 + (-a + 1) x 2 + (a 2 + 2 a) x - x 3

x -x 3

2

>

convert([a,b,c], 'set');

>

map(f, [a,b,c]);

>

[f(a), f(b), f(c)] map (Diff, [sin (x), ln (x), x-2], x);

{b, a, c}

[tx sin(x), tx In(x), tx x >

2]

t:=map(value,%); 1

t:= [cos(x), -, 2x] >

x

nops(t); op(2,t); 3 1

x

1.12 Basic Programming Constructs For a complete description of programming constructs use Maple's help facility, typing the following command: > ?statements Please check the help facility for advise on achieving better performance from the developed Maple code.

1.13 Functions, Procedures and Modules The arguments of the function and procedure definition are known as formal parameters. They are unrelated to any other variables used in the Maple session. > restart: > f:=x->x-2+x+l; g:=(x,y)->x-2+y+l;

1.13 Functions, Procedures and Modules

f g := >

:= x

17

+X +1 ---+ x 2 + y + 1

---+ X 2

(x, y)

f(2)j f(z)j g(l,a)j

7 z2

+z+1 2+a

>

h:=unapply(a*x-2+y+2,x,Y)j h := (x, y)

>

---+

a x2

+y+2

h(a,3)j

+5 A procedure is a prearranged group of encapsulated commands. The command below assigns to the symbol grp a user-defined procedure. > grp:=proc(x,y) > description "this proc is a simple test" j > local Sj > global gj > s:=x+y+gj > sqrt (s) > end proc: For a complete description of variables, please type the following commands: > ?locals > ?globals > g:=3: grp(2,a)j g:=b: grp(2,a)j a3

V5+a v2+a+b > > > >

pr:=proc(x,y) if is(x>y) then [x,yJ else x,y end if end proc: pr(5,3)j pr(a,b)j

[5,3] a, b For large-scale application development, or for programming generic algorithms, Maple provides modules. A module can be thought of as a collection of procedures and other data that are "exported", as well as private ("local") data that are not accessible to the user of the module. Modules are created by executing a module definition, beginning with the new keyword module. Two utility functions, exports and member, aid in manipulating modules.

18

Introduction to Maple

The exports function returns a sequence of the names of all the exported members of a module. The member function can determine if a given member is exported by a module. Outside of a mdule, members are referred to by the syntax moduleName:- memberName. By first executing the command with{moduleName), all of the members of a module can be referred to by their memberName alone. > restart; > m: =module () > export a,b,c,d: > local e: global f; > a:=2; b:=i: > c:=(x,y)->x+y: > d:=procO > [a, b] > end proc: > e:=procO >

3

end proc: > f:=eO > end module; m := moduleO local e; export a, b, c, d; global f; end module > a:=nice; m:-a; evalb( a = m:-a ); a := nice >

2

false >

m:-a:=5: a; m:-a; nice 5

>

withe m );

Warning, the assigned name a now has a global binding

[a, b, c, d] >

a,b,c(2,4),d(),e(),f;

5, 1, 6, [5, 1], eO, 3 The visibility of exports is, in some sense, "transitive". > m: =module 0 > export s ,p; > s:=moduleO > export e', > e:=2

1.14 Maple's Organization

>

end module; p:=procO s:-e end proc end module: m:-s:-e;

>

m:-pO;

> > > > >

19

2 2

To make a library and save it to Maple's repository, give the following commands: > MyPackage:=module() > export £1,f2; > local loc1; > option package; > f1:=proc() loc1 end proc; > f2:=proc(v) loc1:=v end proc; > loc1:=2; > end module: > savelib( 'MyPackage' ): > restart: > with( MyPackage );

[11 ,12] To delete MyPackage from Maple's repository type the command: > MyPackage:='MyPackage'; MyPackage := MyPackage

1.14 Maple's Organization From the user point of view, Maple commands fall into three categories: (a) built-in commands, which are included in the kernel, (b) demand-loaded commands, which are automatically loaded when invoked, and (c) commands which are grouped together in packages and must be explicitly loaded. > ?package Related functions in Maple are grouped into packages and can be accessed by using the notation: package[function](command). > restart: > A: =linalg [matrix] (2,2, [1,2,3,4]); > B:=linalg[matrix] (2,2,[0,1,1,0]);

Introduction to Maple

20

>

linalg[multiply] (A,B); linalg[det] (%);

>

2 A:=array([[1,2], [3,4]]); B:=array([[O,1] ,[1,0]]);

A-

B

0-

{セャ@ {セ@ 1

The with command allows accessing the functions in a library package by their short names. > with(linalg,multiply,det);

[multiply, det] >

multiply(A,B); det(%);

2

1.15 Linear Algebra Computations Maple can perform linear algebra computations, but the user has to choose the methods and know how to interpret the results. There are two choices for performing calculations in linear algebra: the linalg package and the Linear Algebra package. While linalg routines operate on three principal data structures: matrices, vectors and scalars, Linear Algebra routines operate on Matrices, Vectors, as well as scalars. This is a consequence of Maple's implementation of data structures. While the implementation of matrices and vectors is based upon Maple's table data structure, the implementation of Matrices and Vectors is based upon Maple's rtable data structure. As a result, linalg arrays, matrices and vectors are not interchangeable with LinearAlgebra Arrays, Matrices and Vectors. The online documentation, regarding linear algebra, uses the convention that "matrix" (lowercase "m") refers to a table-based matrix used by routines in the linalg package, and

1.15 Linear Algebra Computations

21

"Matrix" (uppercase "M") refers to an rtable-based Matrix used by routines in the Linear Algebra package. The convention is similar for "vectors" and "Vectors". Before proceeding, the user is advised to consult the following topics of Maple's help facility: • LA_general - for more information about linear-algebra computations in Maple. • Introduction to the linalg package - for more information about linalg package. • Introduction to the LinearAlgebra package - for more information about Linear Algebra package. > restart: > with(linalg): Define a matrix and check its dimensions. > A:=array([[1,2,3],[4,5,6],[7,8,9]]); rowdim(A),coldim(A);

A:=

456 123

[ 789

1

3, 3 Extract two rows 1 and 2 and column 3. Define new matrices out of them. > row(A,1 .. 2); col(A,3); > submatrix(A,l .. 2,1 .. 3),subvector(A,1 .. 3,3);

[1, 2, 3], [4, 5, 6]

[3,6,9] [

123] , [3,6,9] 456

Define another matrix. > B:=array([[1,5,3], [8,2,1], [9,3,6]]); > matrix(3,3, [1,5,3,8,2,1,9,3,6]);

B:=

イセ@ セ@ セャ@

936

イ セ@ セャ@

936 Compute A + Band 3 * A - 5 * B. > evalm(A+B)=matadd(A,B); evalm(3*A-5*B)=matadd(A,B,3,-5);

Introduction to Maple

22

[Qセ@ セ}@

{Qセ@ セ@ セ}@

16 11 15

16 11 15

-2 -19 -6] [ -28 5 13 -24

[-2 -19 -6] 5 13

= -28

9 -3

-24

9 -3

Invert a matrix. >

inverse(B); multiply(B,%)=evalm(B &* %); -3 1 1 - 56 8 168 13 1 -23 56 8 168 -1 -1 19 -- 28 4 84

{ セ}@

{セ}@

001 001 Compute the determinant, the rank and the trace of a matrix. The rank is the number of independent rows or columns. The trace is the summation of the diagonal terms. > det(B); rank(B); trace(B); -168 3 9 Define an identity matrix. > C:=array(l .. 3,1 .. 3,identity); evalm(%); C := array ( identity, 1..3, 1..3, [])

100] [a1a 001 Define a near-singular matrix. >

S:=array([[l,lJ, [1,1.000001JJ);

sNセ@

[:

loセA@

1

1.15 Linear Algebra Computations

23

Compute condition numbers. The condition number represents the degree of singularity of a matrix. The condition number of a singular matrix is infinity, while the condition number of the identity matrix is the unity. > cond(S) ,cond(B) ,cond(C); evalf(%);

.400000400010 7 , 112: , 1 .400000400010 7 , 9.214285714, l. Compute eigenvalues. The eigenvalue problem of a matrix is defined as A ¢ = .x ¢ , in which .x is an eigenvalue of the matrix A and ¢ is the associated eigenvector. > eigenvalues(B); 3 1 3 1 12, -2 + 2 V65, -2 - 2 V65 >

v :=

3

v:=eigenvectors(B); 3

1

[-2 + 2 V65, 1

[-2 - 2 V65,

[167 1, { 1, 116

35

+ 116 V65,

[ 167 35 1, { 1, 116 - 116

375 39 セ@ -116 - 1164}]'

375 -116

V65,

>

v[lJ [lJ; # The first eigenvalue 3 1 -- + - V65 2 2 v[lJ [2J; # Its multiplicity

>

v[1J [3]; # Its eigenvectors

>

セ@

39

+ 1164}]'

[12, 1, {[1, 1, 2]}]

1

{[1, >

3

セ@

+ 13156 V65, -

セZ@

39 116

-

4}

seq([seq(v[iJ [jJ ,j=1. .3)J ,i=2 .. 3); 1

[-2 - 2 V65,

[167 35 1, { 1, 116 - 116

V65,

375 -116

39

セ@

+ 1164}]'

[12, 1, {[1, 1, 2]}]

Decompose a matrix into a combination of upper and lower triangular matrices (LU) with LUdecomp. > LUdecomp(B,L='l',U='u',det='d',rank='ran'): > eval(l) ,eval(u) ,d,ran;

100] [1 5 3 [8 1 0 , 0 -38 -23 >

9 21 1 0 19 multiply(l,u)=eval(B);

0 84 19

, -168,3

Introduction to Maple

24

{ セ}@

{セ}@

936 936 For the singular-value decomposition of a matrix A, that is, A = U dV use the command Svd. The procedure Svd is compatible with the Fortran library Linpack. >

d:=evalf(Svd(B,U,V)); eval(U); eval(V); d:= [14.11780981, 5.002994676, 2.378547967] -.2720290702 .8802942288 -.3886930096] [ -.5519516185 -.4736106454 -.6863252636 -.7882573157 .02783931240 .6147156878 -.8345457276 -.5312892168 -.1458259126] [ -.3420375115 .7071300330 -.6188517247 -.4319071305 .4665821306

>

d:=diag(seq(d[i] ,i=1 .. 3));

d :=

[

>

0] 0

14.11780981 0 0 5.002994676

o >

.7718531894

0

2.378547967

multiply(U,d,transpose(V))=eval(B); 1.000000000 5.000000000 3.000000000] [ 8.0000000002.000000001 1.000000001

153] [ 821

8.999999996 2.999999999 5.999999997

936

multiply(transpose(U),B,V)=eval(d);

[

[

14.11780981

.210-8

.110- 8

O.

5.002994675

O.

. 1310- 8

.610- 9

2.378547967

14.11780981

0 5.002994676

o o

]

0] 0

0 2.378547967 For the QR decomposition of a matrix A, that is A = QR, in which Q is a matrix with orthonormal columns and R is an upper triangular matrix, use the command QRdecomp.

1.15 Linear Algebra Computations

>

25

R:=QRdecomp(B,Q='Q'); evalm(Q);

セ@

y'146

R .-

0

16:6 y'146

y'146

713 y'118406 119:4506 y'118406

o

XQセ@

0

y'8IT

1 341 3 y'146 - - y'118406 - - y'8IT 146 118406 811 4 23 21 - y'146 - - - y'118406 - - y'8IT 73 59203 811

>

3 1:6 y'146 118 406 y'118406 evalm(Q &* R)=evalm(B);

{ セャ@

1 8 191 y'8IT

{セャ@

936 936 Solve a linear system of equations with the command linsolve. > linsolve(B,[1,2,3]);

>

3 [1 4' 114' evalm(B &* %)=[1,2,3];

セ}@

[1, 2, 3] = [1, 2, 3] The Linear Algebra package is a group of linear algebra commands that contains nearly all of the functionality of the linalg package, but also has additional commands for creating special types of Matrices, and improved Matrix algebra. Also, especially when calculating with large numeric Matrices, it is much more powerful and efficient. The fundamental data structures used by routines in the LinearAlgebra package are Vectors and Matrices. Their implementation is based upon Maple's rtable data structure. As a result, lists, table-based and rtable-based arrays, linalg matrices, and linalg vectors are not interchangeable with Vectors and Matrices. Maple's alliance with the Numerical Algorithms Group (NAG) has resulted in the incorporation of additional numerical algorithms in Maple, for use by the Linear Algebra package. Additionally, the Linear Algebra command calling sequences can be used in a standard format or by including options that specify certain Matrix properties. Including these options in the calling sequence aids Maple's algorithm selection for computation. As a result, the efficiency of computations on large Matrices with numeric entries is greatly improved. > restart:

Introduction to Maple

26

>

with(LinearAlgebra): ; # This is a column Vector (1 column).

>

;

>

# This is a row Vector (3 columns).

[1, 2, 3] >

«1,2,3>1

,

A:=ScalarMatrix(3,3);

300] A:= [ 030 >

003 B:=«1,0,2>11

{セ}@

222 Matrix([[l,O,O], [0,1,0], [2,2,2]]);

{ セ@ セ}@

>

222 V:=; Vector [column] ([10,0,0]);

27

1.15 Linear Algebra Computations

vセ@ {iセ@

1

{iセャ@ >

A+B; A+l00;

400 040 [225 1 [10301030 001 o >

0103

A.B.V; 4 .V;

[:J

>

7.6; 7. .6; 7*6;

nl 42 42. 42

>

A-2; (A+B)-(-l);

900 090 [009 1

Introduction to Maple

28

1

-

o

0

o

セ@

0

4

-1 -1 1

--10 10 5

Solve a system of equations Ax = b. > A:=«2.2,4.0,-6.1>I1

b:=;

>

LinearSolve(A,b);

l l

7.4

-l. 79059829059829000] 2.01442307692307754

-1.88728632478632452

>

A.%;

2.1 0000000000000096 ]

5.90000000000000124 3.

If preserving the factored form for later use is required (for example, to solve a set of systems having the same matrix coefficients but different right hand sides), then solving the system can be completed by the following sequence of steps. > p,l,u:=LUDecomposition(A,output=['P' ,'L','U']); > evalf(p.l.u,10); >

A;

1.15 Linear Algebra Computations

29

001

o. 1.0

[1.0 p, l, u:= [ 0 1 0 1 ,-.655737704918032850 1 00

-.360655737704918100 .287206266318537906 1.0

-6.09999999999999964

o.

[

0.1. , 0

3.

7.400000000000000341

3.76721311475409860 -.147540983606556430

O.

O.

-.488772845953002466

o. -3.2000000001 2.200000000 [ 4.000000000 1.800000000 -5.000000000 -6.100000000

3.0

7.400000000

2.2 0 -3.21 [ 4.0 1.8 -5 -6.1 3 > >

7.4

x1:=LinearSolve([p,1,u],b); x2:=LinearSolve([p,1,u] , p,lu:=LUDecomposition(A,output='NAG'); 3] [ -6.09999999999999964 3. 7.40000000000000034] p, lu:= [ 2 , -.655737704918032850 3.76721311475409860 -.147540983606556430 3 > >

-.360655737704918100 .287206266318537906 -.488772845953002466

x1:=LinearSolve([p,lu],b); x2:=LinearSolve([p,lu],

Eigenvalues(A); map(Re,%); -.340033818696219181 + O. [ 4.67624558072662388 + O. I

I]

7.06378823796958600 + O. I -.340033818696219181] [ 4.67624558072662388 7.06378823796958600 Compute the eigenvalues and the eigenvectors of a matrix. > >

egval,egvec:=Eigenvectors(A); egval,egvec:=seq(map(Re,i),i=%); -.340033818696219181 + O. [ egval, egvec := 4.67624558072662388 + O. I

I] ,

7.06378823796958600 + O. I [.783195981999999957 + O. I, .331788907700000024 + O. I, .349933366899999986 + O. I] [-.0114173377999999999 + O. I, .907742822500000046 + O. I, .771138785700000051 + O. I] [.621670087799999993 + O. I, -.256747130200000006 + O. I, -.531875560599999964 + O. I] -.340033818696219181]

egval, egvec

:=

[ 4.67624558072662388

,

7.06378823796958600 .783195981999999957 .331788907700000024 [ -.0114173377999999999 .907742822500000046 .621670087799999993 >

.349933366899999986] .771138785700000051

-.256747130200000006 -.531875560599999964

A.egvec[1 .. -1,2]=egval[2].egvec[1 .. -1,2];

1.16 Graphics

r

1.55152641358000020 4.24482836229999983

-1.20061263294999998

31

1

r

1.55152641336623876 4.24482836215193782

1

-1.20061263296199305

1.16 Graphics Maple graphics fall into two major categories which are, respectively, twodimensional and three-dimensional graphics. Animation is among the facilities available in each category. The packages plots and plot3d are used frequently enough. For details of these packages, please type the following commands: > ?plots > ?plots[animate] > ?plots[animate3d] > ?plot[options] > ?plot3d[option] As a simple example, consider the following commands: > restart: [0,0],[1,5],[2,-2],[3,1]: > plt1:=plot([%] ,color=blue,thickness=3); pltl := PLOT(CURVES([[O., 0.], [1., 5.], [2., -2.], [3., 1.]]), COLOUR(RGB, 0., 0., 1.00000000), THICKNESS(3), AXESLABELS("", ""), VIEW(DEFAULT, DEFAULT)) > plt1;

5 4

3

2

o -1

-2

32

Introduction to Maple

> >

plt2:=plot(x-2,x=0 .. 4,color=gold,thickness=3): plots [display] ({pltl,plt2});

16 14 12 10

8 6 4 2

o -2

3

4

Procedures plot and plot3d produce, respectively PLOT and PLOT3D data structures describing the images to be displayed. These data structures are understood by Maple's prettyprinter that prints the plots in a "pretty" form just like it does to any other Maple object. Since PLOT and PLOT3D structures are Maple expressions, they can be manipulated, saved, and printed like any other expression. For a complete description of the form and content of the data structures type the following command: > ?plot[structure] > PLOT(CURVES([[O. ,0.], [1. ,5.], [2. ,-2.], [3. ,1.]]), > >

AXES LABELS ( " " , " ,,) , COLOUR (RGB , O. ,0. , 1. ) , THICKNESS(3),VIEW(DEFAULT,DEFAULT));

1.16 Graphics

33

5 4

3 2

a

3

-1

-2

PLOT3D(POLYGONS([[0,0,OJ, [l,O,OJ, [l,l,OJ ,[O,l,OJJ, [[O,O,OJ, [O,l,OJ, [O,l,lJ, [O,O,lJJ, [[l,O,OJ, [l,l,OJ, [l,l,lJ, [l,O,lJJ, [[O,O,OJ, [l,O,OJ, [l,O,lJ, [O,O,lJJ, [[O,l,OJ, [l,l,OJ, [l,l,lJ, [O,l,lJJ, [[O,O,lJ, [l,O,lJ, [l,l,lJ, [O,l,lJJ), LIGHT(0,0,0.0,0.7,0.0), LIGHT(100,45,0.7,0.0,0.0), LIGHT(100,-45,0.0,0.0,0.7), AMBIENTLIGHT(0.4,0.4,0.4), TITLE(CUBE),STYLE(PATCH),COLOR(ZHUE))j >

CUBE

34

Introduction to Maple

The package plottools is quite useful since it can generate basic graphical objects for use in plot structures PLOT and PLOT3D. In addition, they can be viewed with the command display, as show the following examples. > ?plottools > arl:=plottools[arrow]\ > ([O,O],[10,10],.2,.4,.1,color=green): > ar2:=plottools[arrow]\ > ([10,10],vector([O,10]),.2,.4,.1,color=red): > plots [display] (arl,ar2,axes=none);

1.17 Plotter: Package for Finite Element Graphics The package Plotter was specially developed to represent graphically the results of finite element computations. The package, as well as the procedure for its installation in Maple's repository, are included in the companion CDROM. Since the other packages included in the companion CD-ROM use procedures of Plotter, this package must be saved into Maple's repository before any other package is used. The procedures of Plotter produce PLOT and PLOT3D data-structures, which describe the images to be displayed. This section shows a few examples of application of Plotter procedures. > restart; > with(Plotter): > start_2D_plot();

1.17 Plotter: Package for Finite Element Graphics > > >

>

> > >

35

move_pen([100,O]);new_thickness(2); move_pen([150,50],1);new_axes(2); new_color(O,O,1);draw_symbol([120,10]); new_color(1,O,1);draw_symbol([140,30] ,1); new_color(1,O,O);draw_symbol([140,45] ,2); new_color(O,1,1);draw_symbol([120,40] ,3); show_2D_plot(); 50

40 30 20 10

110

120

130

140

150

The data structure that was produced by the previous command is stored in the global variable draw. Check its contents with the following command: > draw;

{CURVES([[100., 0.], [150.,50.]], COLOR(RGB, 0, 0, 0), THICKNESS(2), LINESTYLE(O)), POINTS([120., 10.]' SYMBOL(DEFAULT), COLOR(RGB, 0, 0, 1)), POINTS([140., 30.]' SYMBOL(BOX), COLOR(RGB, 1,0, 1)), POINTS([140., 45.]' SYMBOL( CROSS), COLOR(RGB, 1,0,0)), POINTS([120., 40.]' SYMBOL( CIRCLE), COLOR(RGB, 0, 1, 1))} > start_2D_plot();pen_down(); > move_pen([100,O]);pen_up(); > new_thickness(3);new_color(.7,.1,.2); > new_pen_style(3); > move_pen([O,O]);move_pen([O,75] ,1); > new_color(O,O,l);draw_text([O,O] ,'xyz');

Introduction to Maple

36

>

new_color();draw_symbol([50,50J,2); new_color(O, 1,0) ; draw_text ([50, 50J , "abc" , [-lJ) ; new_color(l,O,l); draw_text([50,50J,convert(85.3,string),[12,25J,14); nds:=[-100,20J, [-50,20J, [-100,70J: new_color();new_pen_style();new_thickness(); move_pen(nds[3J,0);seq(move_pen(nds[iJ,1),i=1 .. 3); show_2D_plot();

>

show_2D_plot([-90,-10J,[10,80J);

> >

> > > >

>

1.17 Plotter: Package for Finite Element Graphics

クセ@

> > > > >

>

start_2D_plot(); new_color(0,1,0);new_arrow([0,0],[10,10] ,.2,.4,.1); new_color(1,0,0);new_arrow([10,10],[0,10],.2,.4,.1); new_color(O,O,l); new_arrow([8,15],[-5,0],.4,.8,.1); show_2D_plot();



Define data for a simple triangular finite element mesh. > nods:=[[O,O], [0,5], [5,0], [5,5], [10,0], [10,5]]:

37

38

Introduction to Maple > elems:=[[1,4,2],[4,1,3],[5,4,3],[4,5,6]]: The following commands plot the mesh and number the nodes. > start_2D_plot(); > draw_title('A Simple Mesh'); > for elem in elems do > n:=elem[1 .. 3]: > x,y:=seq([seq(nods[n[i]] [j] ,i=1. .3)] ,j=1. .2): > move_pen([x[3],y[3]],0); > seq(move_pen([x[i] ,y[i]] ,1),i=1 .. 3) > end do: > new_color(O,O,l): > for node in nods do > member(node,nods,'i'): > draw_text([node[l] ,node [2]] ,convert (i ,string) , >

[-1])

>

end do: show_2D_plot();

>

A Simple Mesh

ャlMセ@

To actually see an animation, the user must click on the picture and then use the tool-bar buttons to give animation commands. The following commands plot a moving finite element mesh. > start_2D_animation();draw_title('A Moving Mesh'): > for i to 100 do > j:=2.0*i/l00: if j>l then j:=2-j end if:

1.17 Plotter: Package for Finite Element Graphics >

> > > > > > > > > > > >

>

> >

39

new_color();new_pen_style();new_thickness();new_axes(); for e in elems do n:=e[1 .. 3]: x,y:=seq([seq(nods[n[k]] [d],k=1 .. 3)] ,d=1 .. 2): move_pen([x[3],y[3]],O); seq (move_pen ( [x [k] , y [k]] ,1) , k=1. .3) end do: trans:=[seq(-2*j*abs(d-l),d=1 .. 2)]: new_pen_style();new_plot_style();new_plot_shading(); for e in elems do n:=e[1..3]: x,y:=seq([seq(nods[n[i]] [d]+trans[d],i=1 .. 3)],d=1 .. 2): new_color(O,l,O);new_thickness();plot_element(x,y) end do: upgrade_frames() end do: show_2D_animation(NULL);

A Moving Mesh

1.17.1 Example

The following commands, grouped in a procedure, plot an exploded view of a triangular finite element mesh, with numbered nodes and elements. # Exploded view of the mesh > plot_mesh:=proc() > global nods,elemsj > local node,elem,n,x,y,i,j,xg,yg;

40

Introduction to Maple

>

> > > >

> > > >

> >

> > >

> > > > >

> > > > > > >

use Plotter in start_2D_plot(); draw_title('Finite Element Mesh'); for elem in elems do; n:=elem[1 .. 3]; x,y:=seq([seq(nods[n[i]] [j],i=l .. 3)] ,j=l .. 2); xg,yg:=add(x[i] ,i=1 .. 3)/3,add(y[i] ,i=1 .. 3)/3; member(elem,elems,'i');new_color(l,O,O); draw_text([xg,yg],convert(i,string),[O,O]); new_color () ; x:=[seq(0.7*(x[i]-xg)+xg,i=1 .. 3)]; y:=[seq(0.7*(y[i]-yg)+yg,i=1 .. 3)]; move_pen([x[3],y[3]],0); seq(move_pen([x[i] ,y[i]] ,1),i=1 .. 3) end do; new_color(O,O,l); for node in nods do member(node,nods,'i'); draw_text([node[l] ,node [2]] ,convert(i,string)) end do; draw_Iabel(["Node Numberl,"Element Number II] , [[0,0,1], [1,0,0]]); show_2D_plot(NULL); end use end proc: plot_mesh () ;

1.17 Plotter: Package for Finite Element Graphics

41

Finite Element Mesh 4

2

6

4

1

2

3

3

1

Node Number

5

EI'ement Number

1.17.2 Example

A finite element mesh can be plotted as an animation that shows the mesh deforming between two different sets of nodal values. The following commands, grouped in a procedure, plot a deforming triangular finite element mesh. セZ@ 3d deformed animation > animate_3D_def: =proc 0 > global uvals; > local frms,i,j; > use Plotter in > start_3D_animation(); > draw_title(IIFinite Element Mesh"); > frms:=80; > for i to frms do > j:=2.0*i/frms; > if j>l then j:=2-j end if; > deform_mesh([seq(uvals[k]*j,k=l .. nops(uvals))]); > upgrade_frames() > end do; > show_3D_animation(NULL); > end use > end proc: > deform_mesh:=proc(zv::list) > global elems,nods;

42

Introduction to Maple

>

> > > > > > > > > > >

> >

local elem,n,h,x,y,i,j,k; use Plotter in j:=O;new_pen_style();new_plot_style();new_plot_shading(); for elem in elems do n:=elem[1 .. 3];j:=j+l; h:=[seq(zv[n[i]] ,i=l .. 3)]; x,y:=seq([seq(nods[n[i]] [k] ,i=1 .. 3)],k=1 .. 2); new_color();new_thickness(l); plot_element(x,y,h);plot_element(x,y, [0,0,0]); end do; end use; NULL end proc: animate_3D_def();

Finite Element Mesh

1.17.3 Example

A rotation of the finite element mesh can be plotted as an animation. The following commands, grouped in a procedure, plot a rotating triangular finite element mesh. > animate_3D_rot:=proc() # 3d rotated animation > global nods,uvals; > local view,alpha,frms,xr,yr,i,j,zb;

1.17 Plotter: Package for Finite Element Graphics

> > >

>

> > > > >

> > >

> > > > > >

> >

> > > > >

> > > > >

> > > > >

>

use Plotter in start_3D_animation()j draw_title("Finite Element Mesh")j xr,yr:=seq(add(nods[i] [j],i=l .. nops(nods»/ nops(nods),j=l .. 2)j frms:=80jalpha:=2.0*Pi/frmsjzb:=Oj for i to frms do rotate_mesh(uvals,[xr,yr],alpha*i,zb)j upgrade_frames() end dOj show_3D_animation(NULL)j end use end proc: rotate_mesh:=proc(zv::list,rotc::list, alpha::algebraic,zb::algebraic) global elems,nodsj local nval,csa,sna,elem,n,h,x,y,i,j,k,xx,yy,xr,yrj xr,yr:=rotc[]j csa,sna:=evalf(cos(alpha»,evalf(sin(alpha»j use Plotter in new_color(l,O,O)jnew_pen_style()jnew_thickness(l)j new_plot_style()jnew_plot_shading(l)jj:=Oj for elem in elems do n:=elem[l .. 3Jjj:=j+lj h:=[seq(zv[n[i]],i=1 .. 3)]j x,y:=seq([seq(nods[n[i]] [k] ,i=l .. 3)] ,k=l .. 2)j xx:=[seq(csa*(x[i]-xr)+sna*(y[i]-yr),i=l .. 3)]j yy:=[seq(-sna*(x[i]-xr)+csa*(y[i]-yr),i=l .. 3)]j x,y:=xx,yyj new_color(l,O,O)jplot_element(x,y,h)j new_color(l,l,O)jplot_element(x,y,[zb,zb,zb]) end dOj end usej NULL end proc: animate_3D_rot()j

43

44

Introduction to Maple

Finite Element Mesh

2. Computational Mechanics

2.1 Introduction Mathematical modelling of a physical system is an iterative process that basically involves the definition of a continuous model, equivalent to the physical system, and a discrete model. Discretization plays a fundamental role in the mathematical modelling process, generating solutions that approximate the exact solution of the continuous model. Computational mechanics deals with approximate solutions of the equations of continuum mechanics, that is solid mechanics and fluid mechanics, systematically obtained through the use of discrete models. Among these, the models of finite differences , finite elements and boundary elements are the most important ones.

2.2 Mathematical Modelling of Physical Systems When exploiting the properties of matter and the sources of energy available in nature, in order to be useful to man, engineering deals with the properties and behaviour of physical systems. The complexities involved in taking into account all the parameters relative to a given physical system lead the engineer to defining an equivalent system with only a few parameters essential and truly characteristic of the physical system under study, usually known as state variables. The mathematical definition of such an equivalent system is thus the first step in the process of mathematical modelling of physical systems, graphically represented in Fig. 2.l. In general, the equivalent system is defined by a set of differential equations, obtained through the use of fundamental principles of continuum mechanics. Equilibrium and constitutive relationships of the state variables are enforced for a typical differential element of the domain of the problem. Compatibility, representing additional constraints on state variables, must be enforced as a rule, although in some cases it is automatically satisfied by the implicit interconnectivity of differential elements of the continuum. The system of differential equations, valid in the domain of the problem, is combined A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

Computational Mechanics

46

PHYSICAL SYSTEM eInfinite number of parameters

,

Simplification: selection of fundamental parameters characteristic of the problem

EQUIVALENT SYSTEM eFinite number of parameters

t

Physical Laws: application of fundamental principles of Continuum Mechanics

CONTINUOUS MODEL eSystem of differential equations e Infinite degrees of freedom e Exact solution

t

DISCRETE MODEL

Discretization: definition of degrees of freedom at a finite number of nodes through FDM, FEM or BEM

eSystem of algebraic equations eFinite number of dewees of freedom eApproximated solution

セ@

check

Figure 2.1. Mathematical-modelling process of physical systems

with specific defined boundary and initial conditions, leading to the complete definition of the continuous differential model, mathematically equivalent to the physical system. Continuous models have an infinite number of degrees of freedom, since the field variable is continuously distributed on the whole domain of the problem. Apart from a few rare exceptions that are nothing but typical academic problems, it is extremely difficult or practically impossible to determine the exact solution, in the mathematical sense, of continuous models because of the complexity of the geometry of the domain of real problems. Whenever the exact solution can be found, it is obtained analytically with formal methods, also known as exact methods. Although formal methods still have the virtue of the mathematical elegancy, research efforts are nowadays directed towards the formulation and application of discrete models which deal with approximation methods. Discrete models are obtained by considering additional simplifying assumptions which, when introduced in a continuous model, allow the field variable to be expressed through a finite number of parameters, the degrees of freedom of the model. As a consequence, discrete models are naturally

47

2.3 Continuous Models

approximated and have a finite number of degrees of freedom. The methods used to obtain a solution of these models use tools of numerical analysis and are, consequently, called numerical methods. As represented in Fig. 2.2, the discretization process leads to the replacement of the initial problem, the solution of a system of differential equations, by another problem which is solving an algebraic system of equations that will be carried out on a computer. CONTINUOUS MODEL



oInfinite number of degrees of freedom defined at each point of the domain

t oContinuous conditions of Equilibrlnm and Compatibility

t oSystem of differential equations

+ oAnalytical Methods

t -Exact solution

DISCRETE MODEL

- -

-

セ@

セ@

'JJ. n r-

セ@

I

oFinite number of degrees of freedom defined at nodes of the mesh

t oReduced conditions of Equilibrium and Compatibility

t セ@ セ@

N

> セ@

-



r-

oSystem of algebraic equations

t

セ@

0

Z

r- oNumerical Methods t

r--

r- -Approximated solution '---

Figure 2.2. Features of the discretization process

2.3 Continuous Models Under the point of view of continuum mechanics, physical systems can be classified through their respective continuous model, in accordance with the type of differential equation used to describe the model. Following [3J, continuous models can be classified as steady-state or equilibrium models, vibration or propagation models and diffusion models, as represented schematically in Fig. 2.3. 2.3.1 Equilibrium

In the first place, there is a great number of physical systems that can be described by steady-state or equilibrium mathematical models, which are typically represented by Laplace equation. Both in solid and fluid mechanics,

48

Computational Mechanics

CONTINUOUS MODELS

Equations

Figure 2.3. Classification of continuous models

this equation is generalized by Poisson equation. Indeed, it is well known that any solution of Poisson equation can be obtained adding up a particular solution to the solution of the corresponding Laplace equation. What is considered really characteristic of steady-state models is the fact that the time is not a variable of these models. As a consequence, equilibrium models have a steady-state solution, in contrast with all the other models whose solution is time-dependent and is thus referred to as transient solution. Example. Consider the two-dimensional problem of steady-state seepage of water under an impermeable dam. The domain of the problem is defined by the permeable layer of the soil, bounded by the impermeable layer and two additional arbitrary boundaries enclosing the near field of the dam. The state variables used to mathematically describe this physical problem are, in the simplest case, the total flow potential or hydraulic head cp, the isotropic soil permeability K and the flow velocity with components u and v. To derive the continuous model, consider a point of the domain, mathematically defined as a differential element of widths dx, dy and unit thickness. The equilibrium condition enforces that the total flow into the differential element is equal to the total flow leaving the element. This means that the water flux through the differential element is null:

au av udy+vdx= (u+ axdx)dy+(v+ aydx)dx, or

au ax

av

+ ay = O.

Note that the equilibrium condition of this problem is nothing other than the continuity condition, or mass conservation, of fluid mechanics.

2.3 Continuous Models

49

Constitutive equations establish a relationship between the velocity and the gradient of the flow potential. This relationship is enforced through Darcy's law as

8¢ u=-K8x

and

8¢ v=-K 8y '

The continuous model is obtained when the constitutive equations are introduced in the equilibrium equation leading to

8 2¢ 8 2 ¢ 8x2 + 8y2 = O. Two kinds of boundary conditions can be specified for this problem. On impermeable boundaries the normal velocity q, is prescribed as q

= un x + vny = q,

in which nx and ny are the components of the normal to the boundary, outwardly directed. On permeable boundaries, the known value of the total potential ¢, is prescribed as

¢=¢. 2.3.2 Propagation

Another important type of physical systems is described, in Continuum Mechanics, through propagation or vibration mathematical models, whose representative equation, the wave equation, contains a second-order time derivative of the field variable. This equation is used to describe, for instance, lateral vibrations of membranes, as well as the propagation of elastic and hydraulic waves. Example. Consider the problem of a simply supported bar with length l, initially at rest, under the action of a constant axial load P that is suddenly applied at its free end x = l. The domain of the problem is defined by the axis of the bar, bounded by the two end points that correspond to the intersection of the axis with the respective end cross sections. The state variables used to mathematically describe this physical problem are, in the simplest case, the cross-sectional displacement u, the longitudinal strain E:, the cross-sectional stress a, the elasticity modulus E, the mass density p and the cross-sectional area fl. To derive the continuous model, consider a point of the domain, mathematically defined as a differential element of the bar with length dx. The equilibrium condition enforces d'Alambert's principle which requires that the inertia force of the differential element is equal to the resultant of the elastic forces of the element. Mathematically this condition is expressed as

Computational Mechanics

50

or

aa a2 u ax = p at 2 · Compatibility can be enforced by the relationship between the strain and the displacement as E

=

au ax.

The constitutive equation establishes a relationship between the stress and the strain. This relationship enforces Hooke's law as

a=EE, or a

au

= E ax'

when compatibility is introduced. The continuous model, obtained when the constitutive equation is introduced in the equilibrium equation, is written as

a2 u ax 2

a2 u c2 at 2 ' 1

in which c = JEI p. Two kinds of boundary conditions can be specified for this problem. At the boundary point that corresponds to the loaded cross section x = l, equilibrium is prescribed as P

= Da(l, t) =

DE

au ax (l, t),

and, at the other boundary point x

u(O, t) = 0,

for

t

for

= 0,

t > 0, the displacement is prescribed as

> 0.

Initial conditions specify, for this problem, displacements and velocities along the bar, respectively as

u(x,O) = and

°

2.3 Continuous Models

51

2.3.3 Diffusion

Finally, there is a third group of physical systems that can be described through diffusion mathematical models, whose representative equation, the diffusion equation, contains a first-order time derivative of the field variable. Diffusion models are a special case of the general dispersion models which describe time evolution in a continuum of the amount of a given constituent, through processes such as diffusion, advection, convection and decay. Among these models are, for instance, those used to describe the hydrodynamic transport of pollutants in studies of environmental impact assessment. Example. Consider the problem of a plane wall at an initial constant temperature T. A uniform constant heat flux q is suddenly applied on the surface of the wall while the other surface is kept at temperature T. Assume the wall has constant thickness l making this is a one-dimensional heat-conduction problem. The domain can be as the axis x of a circular cylinder, with cross sectional area D, defined through the thickness of the wall. The domain is bounded by the two end points, one at x = and the other at x = l, that correspond to the intersection of the axis with the surfaces of the wall. The state variables used to mathematically describe the problem are, in the simplest case, the temperature T, the heat flux q, the thermal conductivity K, the mass density p and the heat capacity per unit of mass c. To derive the continuous model, consider a point of the domain defined as a differential element of the cylinder with length dx. The equilibrium condition requires that, in the time interval L1t, the net heat flux through the differential element is equal to the heat stored in the element. This condition is expressed as

°

aq L1t[qD - (q + ax dx)D]

= cpDdxL1T.

Assuming that the time interval L1t tends to zero, this condition is given by

aq aT -=-pcax at . The constitutive equation correlates linearly the heat flux and the thermal gradient. This relationship enforces Fourier's law of heat conduction as aT q = -K ax. The continuous model, obtained when the constitutive equation is introduced in the equilibrium equation is written as

K a 2T pc ax 2

aT at·

The boundary conditions can be specified as

aT ax (O,t)

q

= - K'

for

t

> 0,

Computational Mechanics

52

at the boundary point that corresponds to the surface where the heat flux is applied and

T(l, t) = T,

for

t

> 0,

at the other boundary point. For this problem, initial conditions specify the temperature along the axis as

T(x, 0)

= T.

2.4 Mathematical Analysis The mathematical analysis of the three referred types of models requires the use of a criterion in order to classify differential equations. Such criterion, which in the case of two independent variables is based on the method of characteristics, defines elliptic, hyperbolic and parabolic equations. Based on a different method, this classification criterion can be generalized to the case of equations with three or more independent variables, as in [4]. A particular solution of a differential equation cannot be obtained without enforcing the particular conditions of the respective problem. In general, these particular conditions can be of two kinds: initial conditions and boundary conditions. Initial conditions are applicable to equations in which the time variable is explicitly defined, such as the case of parabolic and hyperbolic equations, are enforced throughout the domain of the problem. Boundary conditions are enforced at every instant on the boundary of the domain. Hence, while steady-state models use only boundary conditions, propagation and diffusion models use boundary as well as initial conditions. For a problem that deals with the solution of partial differential equations to be well-posed, it needs to satisfy three conditions: • Existence セ@ there is, at least, one solution. • Uniqueness セ@ there is, at most, one solution. • Stability セ@ the solution depends continuously on the defined conditions, in such a way that small disturbances of the defined conditions induce small variations in the solution. Quite different from the determining the solution of the problem, these aspects still continue to drive the attention of mathematicians who try to find the existence and uniqueness of the solution. These proofs are important in the interpretation of the numerical results of the approximate solutions, as remarked in [5].

2.5 Approximation Methods Approximation methods are the essential tools that lead to discrete models. An approximation method is direct when the unknowns of the corresponding

2.5 Approximation Methods

53

discrete model are directly identified with field variables, defined at the nodes of the discretization. Otherwise, the approximation method is said to be indirect. Approximation methods are introduced in this text through weighted residuals, see [6]. A modern formulation, based on the weighted residual equation and the respective admissibility conditions is presented here as the common basis of all methods of approximation. The admissibility conditions, generally defined for both the approximation and weighting function, are simply restrictions on the continuity and completeness of these functions. The continuity of functions and their derivatives that appear in the integrals of the weighted residual equation is necessary, in order that such integrals have a finite value. Completeness of the approximation function is required to guarantee the convergence of the approximate solution to the exact one. The weighting functions can be chosen arbitrarily which is a direct consequence of the way they are introduced in the strong form of the weighted residual equation. However, if integration by parts of the domain term of the weighted residual equation is carried out, admissible continuity restrictions must be imposed on the weighting functions. The approximation function must always satisfy admissibility conditions. Besides satisfying these restrictions, the approximation function can be chosen in such way that it exactly satisfies some or none of the boundary conditions. Regarding this possibility, approximation methods can be divided into the following three categories: • Domain methods - the approximation function satisfies exactly all the boundary conditions. As a consequence, there are no residuals on the boundary and the weighted residual equation contains only one term which is the domain integral that includes the domain residual. Thus, only the domain must be discretized. • Domain/Boundary methods - the approximation function satisfies exactly only some of the boundary conditions. In this case, there are no residuals on the part of the boundary where exact boundary conditions are defined and the weighted residual equation contains the domain integral as well as boundary integrals that correspond to nonzero boundary residuals. Consequently, both the domain and the part of the boundary with nonzero boundary residuals must be discretized. • Boundary methods - the approximation function does not satisfy exactly any of the boundary conditions. Thus, all the boundary residuals are not null and the weighted residual equation contains the domain integral as well as boundary integrals relative to all the boundary residuals. The weighting function is conveniently chosen as to satisfy the differential equation, allowing the domain integral to be cancelled out or reduced to a point value. Thus, the weighted residual equation contains only boundary terms and, consequently, only the boundary must be discretized.

54

Computational Mechanics

Integration by parts can be carried out on the domain integral of the weighted residual equation, in any of the referred approximation methods. As a result of this integration, derivatives of the approximation function are transferred to the weighting function and boundary integrals are generated, simultaneously. Hence, the aim of the integration by parts is to weaken the admissible continuity conditions of the approximation function. This feature is essential in the formulation of strong, weak and transposed forms of the weighted residual equation, used respectively in domain, domain/boundary and boundary methods. Independently of the possibility of carrying out integration by parts on the domain integral, a specific approximation method becomes completely defined when the weighting functions are chosen. Galerkin, least squares, moments and collocation methods are distinct approximation methods that correspond to different ways of defining the respective weighting functions. Figures 2.4 and 2.5 represent graphically the weighted residual approach of the global indirect approximation and piecewise local direct approximation, respectively.

WEIGHTED RESIDUAL EQUATION

Global Indirect Approximation Functions

Definition of Weighting Functions Galerkin, Collocation, Least Squares, Moments and other methods Figure 2.4. Global indirect approximation

Traditionally, the formulation of approximation methods has been based on variational calculus, where it requires the minimization of a functional that is sometimes quite difficult or even impossible to obtain. Besides this difficulty, the variational formulation cannot deal with an arbitrary number and type of boundary conditions, contrarily to what happens in the weighted residual formulation. Finally, it must be stressed that, in continuum mechan-

2.6 Discrete Models

55

WEIGHTED RESIDUAL EQUATION

Local Direct Approximation Functions

Definition of Weighting Functions Galerkin, Collocation, Least Squares, Moments and other methods Figure 2.5. Piece-wise local direct approximation

ics, the problems are expressed usually through differential equations, instead of functionals.

2.6 Discrete Models The discretization process aims to replace the initial problem which consists in finding the solution of a system of differential equations by another problem which is finding the solution of a system of algebraic equations. It is done by defining, through an appropriate choice of the approximation function, a finite number of degrees of freedom which are the unknowns of the system of algebraic equations. Direct approximation, in which unknowns are directly identified with field variables defined at the nodes of the discretization, has a special practical interest, because of its direct physical meaning. In this case of approximation, the weighted residual formulation of discrete models is based on the use of approximation functions defined piece-wisely. Three typical classes of discrete models can be identified with this type of approximation: • Finite difference models - domain models of approximation that require the discretization of only the domain of the problem. These models generate a banded matrix for the coefficients of the algebraic system of equations.

56

Computational Mechanics

• Finite element models - domain/boundary models of approximation which require the discretization of the domain and part of the boundary. These models also generate a banded matrix for the coefficients of the algebraic system of equations. • Boundary element models - boundary models of approximation which require a discretization of only the boundary. These models generate a full matrix for the coefficients of the algebraic system of equations. However, the size of this matrix is much lower than the size of the matrices generated by the other models. Each one of these models has some advantage over the others. The finite difference model is the one that has the simplest implementation. However, the difficulty of this method in the treatment of smooth curved boundaries constitutes its main drawback. Such difficulty is naturally overcome by the finite element and boundary element models, which are considered as the most efficient discrete models. While the finite element model is undoubtedly the most popular discrete model, the boundary element model, well known for its efficiency in dealing with singularities, unbounded domains, degenerated geometries and moving boundaries, is actually the most modern tool for the analysis of physical systems. All the three models can be combined in the solution of the same problem, since all of them generate systems of algebraic equations. The most effective combination is the one that implements simultaneously, in the same problem, the finite element model and the boundary element model.

2.7 Structural Models The modern theory of structures consists of the following basic models, schematically represented in Fig. 2.6: • A fundamental three-dimensional continuous model, considered mathematically exact, that can be used to simulate the mechanical behavior of structures with an arbitrary geometry. This model is used in the generation of all other continuous models which represent simplified or asymptotic models of the generating exact model. • All the continuous models, asymptotic of the exact generating model, which can be used to simulate the mechanical behavior of different structures with particular geometries, such as trusses, frames, grids, plates and shells. • Discrete models, obtained from the exact model as well as from each one of the different asymptotic models. The three-dimensional model of elasticity theory is the fundamental tool used in the structural analysis. Indeed, the analysis of elastic structures with an arbitrary geometry can be carried out through the integration of the threedimensional equations of elasticity theory. However, the difficulties encountered in such integration lead to the formulation of mathematical models,

2.7 Structural Models

57

CONTINUOUS MODELS EXACT MODEL

ASYMPTOTIC MODELS

Figure 2.6. Models of Structural Analysis

still continuous, that are specially adequate for the analysis of structures with particular types of geometry. These models, asymptotic of the exact three-dimensional model of elasticity theory, are formulated in terms of generalized variables and refer to domains with smaller number of dimensions than the exact three-dimensional model. Continuous structural models can be classified as follows: • Three-dimensional model - this is the model of the theory of elasticity, mathematically exact, generator of the other continuous models. It is applicable to structural elements in which none of its dimensions is quite different from the others. Plane strain and axially-symmetric elasticity are particularizations of the three-dimensional model. • Two-dimensional model - this is the model of the theory of shells. It is applicable to structural elements in which one of the dimensions, the thickness, is much smaller than the others. The material of the structure is confined to the neighbourhood of a surface, the middle surface of the shell, which bisects its thickness everywhere. Whenever this middle surface is plane, the theory of shells leads to the theory of plates and plane stress theory. Therefore, these theories are particularizations of the two-dimensional model. • One-dimensional model - this is the model of the theory of bars. it is applicable to structural elements in which two of its dimensions, the dimensions of the cross section, are much smaller than the third one. The material of the structure is confined to the neighbourhood of a line, the axis of the

58

Computational Mechanics

bar. Trusses, frames and grids are particularizations of the one-dimensional model. One and two-dimensional models introduce fields of generalized variables, governed by equations simpler than the general three-dimensional ones, and thus, are considered as asymptotic of the exact three-dimensional model. Like the exact model, asymptotic models formulated in terms of generalized stresses, strains and displacements, define three groups of equations: • Equilibrium equations - used to define static admissibility of elastic fields. • Strain-displacement or compatibility equations - used to define kinematical admissibility of elastic fields. • Stress-strain or constitutive equations - used to define the mechanical behavior of the structural material. The analysis of structures through the use of asymptotic continuous models is not yet a simple task. In general, it is necessary to introduce discretization as an additional process of simplification. Discretization, whose essential features were already introduced in this text, constitutes the characteristic method of structural analysis. Discrete models, obtained through the use of simplifying assumptions introduced in continuous models, allow the elastic structural field to be expressed in terms of a finite number of degrees of freedom of the respective generalized variables. As a consequence, the system of differential equations of continuous models is replaced by a system of algebraic equations, in which the unknowns are the degrees of freedom of the discretization. Thus, discretization is an approximation method of structural analysis. Finite differences, finite elements and boundary elements constitute the most important discrete models of the theory of structures.

3. Approximation Methods

3.1 Introduction Once a continuous model of a physical problem is set up and a formal solution of this model cannot be obtained, a discrete model is then formulated, in order to obtain an approximate solution of the differential equation that describes the continuous model. Choosing an approximation method is an important task in the formulation, since it affects the accuracy of the solution and the efficiency of the process. In this Chapter, approximation methods are introduced using weighted residuals. Depending on where the boundary conditions are exactly satisfied by the approximation function, the weighted residual formulation divides the approximation methods into the following three categories: • Domain methods - the approximation functions satisfy exactly all the boundary conditions. Consequently, there are no residuals on the boundary and the weighted-residual equation contains only one term, which is the domain integral. Thus, only the domain must be discretized. • Domain/Boundary methods - the approximation functions satisfy exactly only some of the boundary conditions. In this case, there are no residuals on some part of the boundary and the weighted-residual equation contains the domain integral as well as the boundary integrals that correspond to nonzero residuals. Consequently, both the domain and part of the boundary must be discretized. • Boundary methods - the approximation functions do not satisfy any boundary condition. Thus, all the boundary residuals are nonzero and the weighted-residual equation contains the domain integral as well as all the boundary integrals. The weighting function is conveniently chosen allowing the domain integral to be cancelled out or reduced to a point value. Thus, the weighted-residual equation contains only boundary terms and, consequently, only the boundary must be discretized.

In each of these approximation methods, a specific technique of approximation becomes completely defined when the weighting functions are chosen. The most relevant approximation techniques which correspond to different ways of defining the respective weighting functions in the weighted-residual equation are presented in this chapter. A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

Approximation Methods

60

3.2 Residuals Let .1 be a domain, with boundary r divided into r = n u r2 . Consider the differential equation

Luo - g

=0

r1

and

r2 ,

in .1,

such that (3.1)

with boundary conditions

Cuo - h

=0

on

n

(3.2)

and (3.3) where L, C and D are linear differential operators; g, hand l are functions with prescribed value and Uo is the exact solution. Since (3.1) to (3.3) have their respective right hand side identically null, the equation

L

(Luo - g) W Ll dLl +

r (Cuo-h)Wr,dr+

ir,

jr, (Duo-l)Wr,dr=O,

(3.4)

where W Ll, W r l and W r, are arbitrary weighting functions, holds. Consider an approximate solution u, that is

uo=u+E,

(3.5)

where E is the approximation error. When (3.5) is substituted into (3.1) to (3.3), the following residuals are generated:

= Lu - g =I- 0,

(3.6)

Rr, = Cu - h =I- 0

(3.7)

Rr, = Du - l =I- O.

(3.8)

RLl

and

Since these residuals are not null, the substitution of (3.5) into (3.4) leads to the equation

(3.9)

3.3 Weighted-Residual Equation

61

3.3 Weighted-Residual Equation Taking into account that the smaller are the residuals the better is the approximation specified in (3.5), the residuals are forced to be null in an average sense. This is achieved by distributing them in the domain and on the boundary in accordance with arbitrary weighting functions. In other words, the sum of the integrals of the weighted residuals, expressed in (3.9), is set to zero as

{ RLl W Ll dLl +

} Ll

jr

Rrl W r, dr 1

+

j

r2

Rr2 W r 2 dr =

o.

(3.10)

Equation (3.10) is known as the strong weighted residual equation. It enforces the orthogonality between the residuals and the respective arbitrary weighting functions. 3.3.1 Example

Consider the differential equation

d2uo dx 2

+ Uo + x = 0

in 0 < x < 1,

with an essential boundary condition Uo

=u

at

ru

and a natural or nonessential boundary condition

duo

_

d;; = q at

rq .

When the exact solution Uo is replaced by an approximated solution u, residuals are generated as

Rx

d2 u

= dx 2 + u + x

in 0 < x < 1,

and

du Rrq = dx - q = q - q at

rq ,

which lead to the strong weighted residual equation

Approximation Methods

62

3.4 Approximation Functions The first kind of approximation functions, to be be considered here, defines an indirect discretization with global trial functions. It is usually expressed as n

U

=

CXl¢l

+ ... + CXn¢n = セcxゥᄁG@

(3.11) i=l

where {¢d i=l ... n represents a linearly independent set of n globally defined trial functions, taken from a complete sequence, and (CXi)i=l ... n represent undetermined generalized coefficients, the unknowns to be determined as the solution of the problem. Since these coefficients are not identified with the field variable u, the approximation is known as indirect. In addition, the approximation is global because the trial functions ¢i are defined everywhere in the domain .1. The second kind of approximation functions that will be studied here defines a direct discretization with local interpolation functions. This approximation is usually expressed as n

U

= u1N1 + ... + unNn = セ@

UiNi,

(3.12)

i=l

where (Ui)i=l ... n represents undetermined point values of the field variable, the unknowns to be determined as the solution ofthe problem, and {NiL=l ... n represents a set of n piecewise locally defined interpolation functions, usually a complete set of mutually-orthogonal normalized polynomials. Since the unknowns are identified with the field variable u, the approximation is known as direct. In addition, the approximation is local because the interpolation functions Ni are locally defined in a particular region of the domain .1. Other kinds of approximation can be defined. Among them, it is worth mentioning the indirect discretization with piecewise locally defined trial functions and the direct discretization with globally defined interpolation functions. Although important, these types of approximation will not be studied in this introductory text.

3.5 Admissibility Conditions Admissibility conditions are restrictions that must be imposed on the approximation function, required by the evaluation of the weighted residual equation as well as by convergence conditions. The conditions of admissibility are expressed in terms of completeness and continuity. Completeness is a necessary condition that guarantees the convergence of the approximation function to the exact solution. A sequence of linearly

3.5 Admissibility Conditions

63

independent functions cPi, as defined in (3.11), is complete if a measure of the distance between the exact and the approximate functions can be given by n

L aicPi I
v(x):=eval(v(x»: Compare the results obtained with the exact solution > u(x):=1/24*p*x*(x-3-2*1*x-2+l-3)/EI: > u_O:=subs(p=10,EI=100,1=1,u(x»: > u_O:=plot(-u_O*1000,x=O .. 1,color=green,legend=IExact", > thickness=3): > du_O:=-diff(%%,x): > du_O:=plot(du_O*1000,x=O .. 1,color=green,legend=IExact", > thickness=3): > uu:=subs(p=10,EI=100,1=1,v(x»: > uu:=plot(-uu*1000,x=O .. 1,color=red, > legend="Least Squares - 2 terms",thickness=3): > plots [display] (u_O,uu,axes=BOXED, > title="Simply Supported Beam - Deflection*1000");

Approximation Methods

76





orted Beam - Deflection*1000 セ

MG@

-0.2 -0.4 -0.6 -0.8 -1 -1.2

L -________

0.2

____ セ@

0.4 x Legend

0.6

セ@

__ セ@

0.8

Exact Least Squares - 2 terms

> > > > >

du:=-diff(%%%,x): du:=plot(du*1000,x=O .. 1,color=red, legend="Least Squares - 2 terms",thickness=3): plots [display] (du_O,du,axes=BOXED, title="Simply Supported Beam - Rotation*1000");

orted Beam - Rotation*1000

4

2

a -2 -4 セ@

______________________________

0.2

0.4 x Legend

0.6

セ@

0 .8

Exact Least Squares - 2 terms

Maximum deflection at half span > u=simplify(subs(p=10,EI=100,1=1.,x=1/2,u(x))); > v=simplify(subs(p=10,EI=10Q,1=1.,x=1/2,eval(v(x))));

77

3.6 Global Indirect Discretization

u

v

= .001302083333 = .001301726422

Moments Method. Two terms were considered in the expansion of the approximation function. Results show that the solution obtained with this method is not as good as the solutions obtained with Galerkin and leastsquares methods. > restart:n:=2: > v(x):=sum(alpha[i]*phi[i](x),i=1 .. n);

+ 0:2 (/J2(X)

>

v(x) := 0:1 (/JI(X) R(x):=diff(v(x),x$4)-p/EI;

>

セ@ セ@ ( P (ax4 (/JI (x)) + 0:2 (ax4 1>2 x)) - EI W(x):=sum(x-(2*i-1)*beta[i],i=1 .. n);

R(x) :=

0:1

W(x) := x /31 + x 3 /32 The weighted residual equation leads to the set of conditions > eqs:=seq('int'('R(x)'*x-(2*i-1),x=O .. 1)=O,i=1 .. n); eqs:= 11R(X)XdX

= 0, 11R(X)X3dX = 0

Consider trial functions that satisfy the admissibility conditions > for i from 1 to n do > phi[i] (x):=sin«2*i-1)*Pi/l*x) > end do;

1>l(X) 1>2(X)

:= :=



7rX

sm(-Z )

sin(3 7rZx)

Solve the system of equations > eqs:=eval(eqs):eqs[1];eqs[2]; 1 -p [4

2' セ@ >

1

1080:2 7r 3

EI - p [4

+ 20:1 7r 3 EI + 540:2 7r 3 EI EI [2 -

240:1

EI7r +

m

40:1 7r 3

=0

EI - 72 0:2 EI7r

=0

solve({eqs},{seq(alpha[i] ,i=1 .. n)});assign(%);

{o: = __1_p[4(-12+7r2) 0: ]セー{THMKSWイRIス@ 2 576 7r3 EI ,1 64 7r 3 EI Compare approximate and exact solutions > v(x):=eval(v(x)): > u(x):=1/24*p*x*(x-3-2*1*x-2+1-3)/EI: > u_O:=subs(p=10,EI=100,1=1,u(x)): > u_O:=plot(-u_O*1000,x=O .. 1,color=green,legend="Exact", > thickness=3):

78

Approximation Methods

> > >

> > > > >

du_O:=-diff(%%,x): du_O:=plot(du_O*1000,x=O .. 1,color=green,legend=IExact", thickness=3): uu:=subs(p=10,EI=100,1=1,v(x)): uu:=plot(-uu*1000,x=O .. 1,color=red, legend="Moments - 2 terms",thickness=3): plots [display] (u_O,uu,axes=BOXED, title="Simply Supported Beam - Deflection*1000");





orted ]セ Beamセ] - Deflection*1000 ]セ



MG@

-0.2 -0.4 -0.6 -0.8 -1

-1.2 0.2

0.4 x Legend

0.6

0.8

Exact Moments - 2 terms

> > > > >

du:=-diff(%%%,x): du:=plot(du*1000,x=O .. 1,color=red, legend="Moments - 2 terms",thickness=3): plots [display] (du_O,du,axes=BOXED, title="Simply Supported Beam - Rotation*1000");

3.6 Global Indirect Discretization

79

4

2

o -2 -4 セ]M

______________________________ 0.2

0.4 x Legend

0 .6

セ@

0 .8

Exact Moments - 2 terms

Maximum deflection at half span > u=simplify(subs(p=10,EI=100,1=1.,x=1/2,u(x))); > v=simplify(subs(p=10,EI=100,1=1. ,x=1/2,eval(v(x)))); U=

.001302083333

v = .001278576938 Collocation Method. Two terms were considered in the expansion of the approximation function. Results show that the solution obtained with this method is the worst when compared with the solutions obtained with the other methods. > restart:n:=2: > v(x):=sum(alpha[i]*phi[i] (x),i=l .. n); >

v(x) := Ctl (/>I (x) R(x):=diff(v(x),x$4)-p/EI;

R(x) >

:= Ctl

(::4

¢l(X))

+ Ct2 (/J2(x)

+ Ct2

(::4 ¢2(X)) - :/

W(x):=sum(delta*(x-x[i])*beta[i] ,i=l .. n);

W(x) := b (x - Xl) (31 + b (X - X2) (32 The weighted residual equation leads to the equations > eqs:=seq(subs (x=x [i] ,'R(x)')=O,i=l .. n);

eqs := R(xd = 0, R(X2) = 0 Consider trial functions that satisfy the admissibility conditions > for i from 1 to n do phi[i] (x):=sin((2*i-l)*Pi/l*x) > end do;

Approximation Methods

80

. nx ¢1(X) := sm(-l ) nx ¢2(X) := sin(3 - l ) Compute the residue at collocation points which where chosen arbitrarily > R(x):=eval(R(x));

>

._ 0:1 sin( nlx) n 4 l4 R(x) .seq(1/(2*n)*i,i=1 .. n);

セ@ > >

+

810:2 sin(3 nlx) n 4 l4

l

セ@

4 ' 2

P

EI

l

eqs:=seq(subs(x=%[i] ,R(x))=O,i=1 .. n): eqs:=eval(eqs):eqs[1];eqs[2]; 1 0:1 y'2 n 4 2" l4

81

+

2

m 4 0:2 V 2 n p l4 - EI

=0

0:1 n 4 810:2 n 4 p -l4- l4 - EI

=0 Solve the system of equations > solve({eqs},{seq(alpha[i],i=1 .. n)});assign(%); {

__1_ P l4 ( -1 + y'2) _ セ@ P l4 (1 + y'2) } 162 n4 EI ' 0:1 - 2 n 4 EI

0:2 -

Compare approximate solution with the exact solution > v(x):=eval(v(x)): > u(x):=1/24*p*x*(x-3-2*1*x-2+l-3)/EI: > u_O:=subs(p=10,EI=100,1=1,u(x)): > u_O:=plot(-u_O*1000,x=O .. 1,color=green,legend=IExact", > thickness=3): > du_O:=-diff(%%,x): > du_O:=plot(du_O*1000,x=O .. 1,color=green,legend=IExact", > thickness=3): > uu:=subs(p=10,EI=100,1=1,v(x)): > uu:=plot(-uu*1000,x=O .. 1,color=red, > legend="Collocation - 2 terms",thickness=3): > plots [display] (u_O,uu,axes=BOXED, > title="Simply Supported Beam - Deflection*1000");

81

3.6 Global Indirect Discretization

a セ

Gセ

orted Beam - Deflection*1 000 セ セ]M ]セM

ML@

-0.2 -0.4 -0.6 -0.8 -1 - 1.2

0 .2

0.4 x Legend

0.8

0 .6

Exact Collocation - 2 terms

> > > > >

du:=-diff(%%%,x): du:=plot(du*1000,x=O .. 1,color=red, legend="Collocation - 2 terms",thickness=3): plots [display] (du_O,du,axes=BOXED, title="Simply Supported Beam - Rotation*1000");

orted Beam - Rotation*1000 4

2

a -2 -4 セ@

__________________

0.2

0.4 x Legend

0.6

セ@

____ 0.8 セ@

Exact Collocation - 2 terms

Maximum deflection at half span > u=simplify(subs(p=10,EI=100,1=1.,x=1/2,u(x))); > v=simplify(subs(p=10,EI=100,1=1.,x=1/2,eval(v(x))));

Approximation Methods

82

U

v

= .001302083333 = .001236588796

Conclusions. Regarding accuracy, Galerkin and least-square methods lead to the best approximation, as shown in Table 3.1. The reason for this behaviour resides in the weighted residual equation, in the way the residual is cancelled out. While this cancellation is carried out point wisely in the collocation method, it is enforced in a weighted mean-value sense over the domain in all the other methods. Nevertheless, the method of collocation has the advantage of presenting the simplest formulation. Table 3.1. Deflection at half span Method

Deflection

Exact

.001302083333

Galerkin

.001301726422

Least-Squares

.001301726422

Moments

.001278576938

Collocation

.001236588796

3.6.8 Example

Find the deflection of a fixed-end beam, with span I and and constant bending stiffness El, under the action of a uniformly distributed load with density p. Assume that this problem is mathematically described by the differential equation

a4

ax 4 Uo =

p E I for 0


>

restart: eq:=diff(u(x),x$4)=p!EI;

:1

::4

>

> >

> > > > >

eq := u(X) = conds:=u(O)=O,u(l)=O,D(u) (O)=O,D(u) (1)=0; conds := u(O) = 0, u(l) = 0, D(u)(O) = 0, D(u)(l) = 0 dsolve({eq,conds},u(x)):assign(%): u(x):=simplify(u(x)); 1 px2 (x 2 - 2lx + l2) EI u(x) := 24 u_O:=subs(p=10,EI=100,1=1,u(x)): u_O:=plot(-u_0*10000,x=0 .. 1,color=green, legend=IExact", thickness=3): plots [display] (u_O,axes=BOXED, title="Fixed-End Beam - Deflection*10000"); Fixed-End Beam - Deflection*10000

a -0.5 -1 -1.5

-2 -2.5

a

0.2

0.4 x Legend

0.6

0.8

Exact

> > > > >

du_O:=-diff(%%%,x): du_0:=plot(du_0*10000,x=0 .. 1,color=green, legend=["Exact"],thickness=3): plots [display] (du_O,axes=BOXED, title="Fixed-End Beam - Rotation*10000");

84

Approximation Methods



イMセ



Mセ@

6 4 2

o

-2 -4 --6 MX セM@

0 .2

0.4

x

0.6

Legend

0 .8

Exact

Approximate solutions were obtained with all the methods described in the current section. The function of approximation was chosen as satisfying the admissibility conditions of the problem. All the programs used are included in the companion CD-ROM.

3.7 Integration by Parts When domain/boundary and boundary methods of approximation are considered, the same techniques used in the case of domain methods can be applied to define the weighting function. However, before choosing this function, it is usually convenient to carry out an integration by parts of the domain term of the weighted residual equation. The objective of performing this integration by parts is to obtain weaker admissibility conditions for the approximation function. In fact, each integration by parts simply transfers one derivative from the residual RLl to the weighting function WLl. As a consequence, the degree of continuity, required by the admissibility conditions of the approximation function u, can be lowered, while new admissibility conditions of continuity must be imposed on the weighting function WLl. 3.7.1 Strong, Weak and Transposed Forms If no integration by parts is carried out, the weighted residual equation expresses its strong form. This designation is based on the level of admissible continuity conditions required to be satisfied by the function of approximation.

3.7 Integration by Parts

85

whenever integration by parts is performed, the weighted residual equation presents a special form that depends on the number of derivatives transferred from the residual function to the weighting function of the domain integral. Two special cases are usually considered. They are respectively the weak and the transposed forms of the weighted residual equation. In the weak form, the approximation function and the weighting function, in the domain term of the weighted residual equation, are submitted to the same order of differentiation. This requires a self-adjoint differential operator. In this case, the weak form represents the best compromise between the admissible continuity conditions required for both the approximation function u and the weighting function W Ll. The weak form of the weighted residual equation is always used in domain/boundary methods of approximation. When successive integrations by parts are carried out on the domain term until all the derivatives of the approximation function are transferred to the weighting function, the transposed form of the weighted residual equation is obtained. In this form, continuity conditions of admissibility are required only for the weighting function W Ll and no longer for the approximation function u. The transposed form of the weighted residual equation is always used in boundary methods of approximation. Finally, note that, although possible, integration by parts is not used in domain methods of approximation. Hence the strong form of the weighted residual equation is usually used in domain methods of approximation. 3.7.2 One-Dimensional Case

In the one-dimensional case, integration by parts is performed as

I

b

a

u(x) セ@

8v(x)

dx

= [u(x) カHクIjセ@

-

Ib a

セ@

8u(x)

v(x) dx,

(3.39)

III which u and v are continuously differentiable functions defined in the interval a :S x :S b.

3.7.3 Example

Consider the equation

I

a

b

82U 8x2 Wdx

= 0,

(3.40)

assumed as the strong form of the weighted residual equation of a given problem, in which u is the approximation function and W is the weighting function. Discuss the admissible continuity conditions for both u and W. In the strong form (3.40), suitable for domain methods, the function of approximation is required to be C 1 continuous, since it is submitted to a second order derivative. However, the weighting function is not required to have any admissible continuity, since it is not submitted to any differentiation.

Approximation Methods

86

One integration by parts of (3.40) leads to

[ au ax

w] b-lb auax oW dx ax a

=

0

(3.41)

'

a

in which one derivative of the approximation function u was transferred to the weighting function W. In this equation, both functions u and Ware required to be CO continuous. Thus, (3.41) represents the weak form of the weighted residual equation, systematically used in domain/boundary methods of approximation. Full integration by parts of (3.40), that is one additional integration by parts of the domain term of the weak form (3.41), leads to the equation

[ au ax W

]b [oW]b Ib 02W u ax + OX dx = 0, a -

a

a U

(3.42)

2

where another derivative of the approximation function u was transferred to the weighting function W. In the domain term of this equation, the function u is not submitted to any admissible continuity condition, while the function W is required to be C 1 continuous. Equation (3.42) represents the transposed form of the weighted residual equation, always used in boundary methods of approximation. 3.7.4 Higher-Dimensional Cases

Integration by parts can obviously be extended to higher-dimensional spaces. For the sake of simplicity, consider a two-dimensional domain .1, represented in Fig. 3.2, with a closed boundary r, where f(x, y), g(x, y), h(x, y) and

dy

ex

x

セ@

a

a

dt

dx

n.ex = n x=cosa = dy/dr n.e y = n y= sin a = -dx/dr

Figure 3.2. Components of the unit normal to the boundary

u(x, y) are continuously differentiable functions. The direct application of the one-dimensional integration formula (3.39), in the x dimension, allows writing the equation

3.7 Integration by Parts

i ヲセ@

dxdy

=

l

87

i セ@

fgdy -

(3.43)

gdxdy.

Consider now the unit normal to the boundary, defined by

=

n

dy dx dT ex - dT e y .

(3.44)

From this equation, the differential element dy can be expressed as dy

= n 'exdT,

(3.45)

where the operator· represents the dot product. When (3.45) is substituted into the boundary integral of (3.43), the following equation is obtained

l i ヲセ@

ag fax dxdy

L1

r

= ir fgn· exdT -

1of L1

ax gdxdy.

(3.46)

Similarly, in the other dimension, the following equation can be obtained

dxdy

=

l

fhn· e y dT -

i セ@

hdxdy.

(3.47)

The addition of expressions (3.46) and (3.47) leads to

i

f

Hセ@

+ セI@

dxdy

If(gex+hey).ndTor

i

f'V . v dxdy =

l

(3.48)

=

i HセYKィI@

f v . n dT -

with v = ge x + hey. Taking v integration formula

dxdy,

i

'V f . v dxdy,

(3.49)

= 'Vu, (3.49) leads to the two-dimensional

(3.50) widely used in the weighted-residual approximation. In the boundary integral of (3.50), the normal derivative is defined as

au an

au

au

= 'Vu· n = ax nx + ay

n y.

(3.51)

Approximation Methods

88

3.7.5 Example

Consider the equation

i HセZ@

+ セZI@

Wdi1

(3.52)

= 0,

assumed as the strong form of the weighted residual equation of a given problem, in which u is the approximation function and W is the weighting function. Discuss the admissible continuity conditions for both u and W. In the strong form (3.52), suitable for domain methods, the function of approximation is required to be C 1 continuous, since it is submitted to a second order derivative. However, the weighting function is not required to have any admissible continuity, since it is not submitted to any differentiation. One integration by parts of the strong form leads to the expression

J onau W r

dr -

r (au oW + au OW) }Ll ox ox ay ay

di1 =

°,

(3.53)

where one derivative of the approximation function u was transferred to the weighting function W. In this equation, both of the functions u and Ware required to be CO continuous. Thus, (3.53) represents the weak form of the weighted residual equation, systematically used in domain/boundary methods of approximation. Full integration by parts of (3.52), that is one additional integration by parts of the domain term in the weak form (3.53), leads to the equation

J onau W JuoWon r

dr -

r

dr +

J

Ll U

(02W ox2 + 02W) oy2

di1

=

0,

(3.54)

where another derivative of the approximation function u was transferred to the weighting function W. In the domain term of this equation, the function u is not submitted to any admissible continuity condition, while the function W is required to be C 1 continuous. Thus, (3.54) represents the transposed form of the weighted residual equation, systematically used in boundary methods of approximation.

3.8 Local Direct Discretization In general, the application of a global indirect approximation is not convenient, since the unknowns do not have a direct physical meaning. Another drawback of the global indirect approximation is in the definition of the approximation function which can be required to satisfy a priori some of the boundary conditions. Furthermore, in order to improve the solution accuracy, it may be necessary to use higher order terms in the approximation function that can introduce instabilities due to their global definition. As a consequence of these difficulties, the use of global indirect approximation is usually limited to simple academic problems. The obvious alternative to overcome these difficulties is the use of a local direct approximation.

3.8 Local Direct Discretization

89

3.8.1 Nodes and Local Regions

Local direct approximation methods are based on the discretization of both the domain and the boundary of the problem with a finite number of nodes. A node is a pre-defined point in the domain or on the boundary, where the field variable u is set as primary unknown of the model. A set of nodes defines a local region where the approximation function is piece-wisely defined. In a local region, the approximation function already defined in (3.12) is rewritten here as n

U

= U1 N 1 + ... + unNn =

L

UiNi,

(3.55)

i=l

where n denotes the total number of nodes in the local region, (Ui)i=l ... n represents unknown nodal values of the field variable and {Ni };=l ... n represents a set of piecewise locally defined interpolation functions, a complete set of mutually orthogonal normalized polynomials. Local regions mayor may not overlap in accordance with a specific approximation method. To improve the solution accuracy a finer discretization can be used with more nodes than the previous one, or alternatively, the same discretization can be used, but the degree of the approximation function should be increased in each local region. 3.8.2 Satisfaction of Boundary Conditions

Nodal values, the values of the nodal unknowns, can be required to exactly satisfy some or none of the boundary conditions. Based on this feature, local direct approximation methods can be divided into domain, domain/boundary and boundary methods, exactly as in the case of global indirect approximation methods. In domain methods, all the boundary conditions are exactly satisfied. As a consequence, boundary residuals are identically zero and the strong form of the weighted residual equation contains only a domain term. Thus, discretization is carried out only in the domain. Domain methods of approximation are typically represented by the finite difference method. In domain/boundary methods, some of the boundary conditions - the essential ones - are exactly satisfied. Consequently, the strong form of the weighted residual equation contains the domain and the boundary terms that correspond to the boundary residuals of nonessential boundary conditions. Thus, after obtaining the weak form, these methods require the discretization of the domain and the boundary where essential boundary conditions are specified. Domain/boundary approximation methods are typically represented by the finite element method. In boundary methods, none of the boundary conditions is exactly satisfied and thus, the strong form of the weighted residual equation contains

Approximation Methods

90

the domain as well as all the boundary terms. After obtaining the transposed form of the weighted residual equation, an appropriate choice of the weighting function cancels out, or reduces to a point value, the domain term. Consequently, discretization is carried out only on the boundary. Boundary approximation methods are typically represented by the boundary element method. Besides the definition of the approximation function, a specific method of approximation becomes completely defined when the weighting function is finally chosen. Among all the possibilities, Galerkin, least-squares and collocation are the most usual methods of defining the weighting function. In order to clearly show the approximation of local direct methods, consider, for the sake of simplicity, the one-dimensional problem given by the differential equation

[Puo ax 2

+ Uo = 0

in 0

< x < l,

(3.56)

with an essential boundary condition Uo

= u at x = 0

(3.57)

and a nonessential boundary condition

auo ax

_

= qo = q

at x

= l,

where Uo represents the exact solution. Note that the boundaries are respectively the coordinate points x = 0 and x = l.

(3.58)

r 1 and r 2

3.8.3 Finite Difference Method As a typical representative of domain methods, the finite difference method has its formulation based on the strong form of the weighted residual equation which contains only the domain term, i.e. (3.59) This equation assumes that all the boundary conditions are exactly satisfied, since it does not include integrals with boundary residuals. Consequently, the solution of the algebraic system of equations must be forced to satisfy exactly the boundary conditions. Collocation is used to define the arbitrary weighting function as n

WLl

= L,8iJ(X - Xi),

(3.60)

i=l

where n is the total number of nodes of the discretization, ,8i is an arbitrary coefficient and J(x - Xi) is the Dirac delta function applied at the node Xi. With the weighting function (3.60), the weighted residual equation (3.59) becomes

3.8 Local Direct Discretization

91

(3.61 ) Since {3i represents an arbitrary value, the weighted residual equation leads to the set of simultaneous conditions

(3.62) which defines a system of n algebraic equations with n unknowns, the nodal values of the discretization. In order to clearly show the approximation of this method, consider the problem defined in equations (3.56) to (3.58). The strong form of the weighted residual equation is simply given by d 2u

R,t,. = dx 2

+ u,

(3.63)

where u is the locally defined piecewise direct approximation function. The admissibility conditions require that u must be C 1 continuous. Since u is a polynomial function, it must have degree 2. In this case, a local region can be defined with three nodes. For a central node Xi, the region contains only the nodes Xi-1, Xi and Xi+1. In this region, a local coordinate セ@ can be defined as a function of the global coordinate X through the transformation

セ@ = 2 (x

-

Xi+1 -

Xi)

.

(3.64)

Xi-1

The Jacobian of this coordinate transformation x dx

Xi+1 -

、セ@

----> セL@

is given by

Xi-1

(3.65)

2

When the transformation (3.64) is performed and (3.65) is taken into account, (3.63) is expressed as

R,t,. =

f) 2 u £:l

uX

2

+u =

H、セIR@

-d x

f) 2 u £:lc2

u > > >

restart: N[i-1] :=xi*(xi-1)/2; N[i] :=(l-xi)*(l+xi); N[i+1] :=xi*(xi+1)/2; Ni-

1

:= RBセH@

1

Ni := (1 - セI@ Ni+l :=

> > >

1

2" セ@

-1) (1

+ セI@

(1 + セI@

plot([N[i-1],N[i],N[i+1]],xi=-1 .. 1, color= [red, blue ,green] , legend= [liN [i -1] II , liN [i] II , liN [i+1] II] thickness=2,axes=NORMAL);

,

1

Legend N!i-1 ] N i] N i+1]

With this set of local interpolation polynomials, the approximation function U is expressed as (3.68) Therefore, when (3.68) is introduced in (3.66), the central finite-difference scheme is obtained for the second derivative as RLl(Xi)

=

4 2

(Xi+! - Xi-l)

aa2 u2 + U = 4(Ui-l - 2Ui + ui+d 2 + Ui' セ@ (Xi+l - xi-d

(3.69)

This formula is repeatedly applied for each interior node of the discretization, as specified by (3.62). Note that local regions, centered at neighbouring nodes, do overlap.

3.8 Local Direct Discretization

93

3.8.4 Finite Element Method The method of finite elements is the typical representative of domain/boundary methods. The weighted residual equation contains two terms, the domain integral and the boundary integral that corresponds to the approximate nonessential boundary conditions and is given by

r RLl W

iLl

Ll

d.:1 +

jr2 Rr2 W r2 dr = o.

(3.70)

This equation assumes that essential boundary conditions, defined on n, are exactly satisfied, since it does not include a boundary integral with the weighted residual R r ,. Consequently, the solution of the algebraic system of equations must be forced to satisfy all the essential boundary conditions. In order to illustrate the approximation of this method consider the problem defined in equations (3.56) to (3.58). Domain/boundary methods define in this case the residuals

and

Rr2 = q - q, where u represents the approximation function and q its derivative. With these residuals (3.70) is written as

II HセZ@

+ u) WLl dx + [(q -

q)Wr21x=l = O.

(3.71)

The boundary n is the coordinate point x = t. In this equation, the strong form of the weighted residual equation, the approximation function is required to be C 1 continuous, since it is submitted to a second order derivative. The domain term of the strong form is integrated by parts to transfer derivatives from the residual to the weighting function, thus leading to weaker forms. Assuming the differential operator is self-adjoint, this integration is carried out until both the approximation and the weighting functions are submitted to the same order of differentiation, leading to the weak form of the weighted residual equation. For equation (3.71) one integration by parts of the domain term leads to

-

{アwlャセ@

i lauax oWax o

-

Ll

--dx+

+ [(q -

il

uWLldx+

0

q)Wr21x=l = O.

(3.72)

The arbitrary weighting function W r 2 can be defined strategically in order to cancel one of the boundary terms as (3.73)

Approximation Methods

94

thus leading to the weak form of the weighted residual equation

- 10t

t

au oW ax axLJ. dx + 10 uWLJ. dx - [qWLJ.]x=o

+ [qWLJ.]x=1 = o.

(3.74)

A finite element is a closed region with finite dimensions, defined by a group of nodes, where a set of local interpolation functions, usually polynomials, is defined. A finite element mesh is set up by assembling the nonoverlapping finite elements, linked to each other at common nodes with no gaps along linked boundaries. The continuous domain .::1 is replaced by the assembled finite elements .::1 e . Simultaneously, the continuous boundary r is replaced by the assembled finite elements re. This process, represented by (3.75) e

and (3.76) e

determines the topology of the finite element mesh. In each finite element, a local direct approximation is defined by (3.55). The interpolation functions are also known as element shape functions. Each shape function is associated with a nodal variable and satisfies the fundamental properties (3.77) where and

セェ@

is a local coordinate of the node j and Jij is the Kronecker delta, n

lnゥHセI@

= 1,

(3.78)

i=l

at any point of the element. How many nodes should each finite element have? The right answer to this question is that it depends on the admissibility conditions imposed by the weak form of the weighted residual equation. In order to discuss the admissibility conditions, assume that m is the differentiation order of the highest-order derivative that is present in the weighted residual equation. Inside each finite element, the admissible continuity condition requires the use of polynomials with degree m so that derivatives of order m can be approximated by nontrivial constant values. In this way, the set of shape functions can represent exactly the derivatives of the weighted residual equation as the finite element size becomes smaller and smaller. Since the finite element mesh replaces the continuous domain of the problem, the admissible continuity condition is referred to as compatibility condition along the common boundaries between each two neighbouring finite elements. Provided that along such common boundaries the neighbouring finite

3.8 Local Direct Discretization

95

elements share the same nodes, compatibility at the nodes implies compatibility along the common boundary. This property, referred to as the reduced compatibility condition, imposes C m - 1 continuity on the approximation function at nodes. Once admissibility conditions are enforced in the finite element mesh topology, the weak form of the weighted residual equation can be computed from the contribution of each finite element. This is referred to as the assembly operation. In order to compute the integrals of each finite element, the weighting function W Ll is usually defined through Galerkin method as n

WLl = i5u =

2: Ni i5ui,

(3.79)

i=1

where n denotes now the number of nodal unknowns in the element .,1e and i5ui represents an arbitrary variation of the element nodal variable Ui. Note that this definition of the weighting function implies that W Ll = 0 on r 1 , where the essential boundary conditions specify a fixed value u for the field variable. For the element.,1e with n nodal unknowns equation (3.74) is simply written as (3.80) Incorporating (3.55) and (3.79) leads, after simplification, to

2: 1 (aN ax n

.

,=1

Ll e

aNJ _ -' _ ax

NN· ) dxu = [qN·] 'J

,

J x=l

for j

= 1·· ·n.

(3.81 )

This equation can be written in matrix form as (3.82) with (3.83) (3.84) and (3.85) where i and j refer to element nodal unknowns. The matrix equation (3.82) represents a system of algebraic equations where K e is the coefficients matrix that is symmetric for self-adjoint differential operators, u e is the vector of the unknowns and pe is the vector of the independent terms. This system of algebraic equations replaces the differential equation and thus, expresses the equilibrium conditions of the finite element. Since equilibrium conditions (3.82) are defined in terms of the element nodal unknowns, they are referred to as reduced equilibrium conditions.

Approximation Methods

96

The assembly of the element matrices K e and pe, processed in accordance with the respective element incidences, generates the corresponding global matrices K and P for the whole finite element mesh. This operation, supported by the reduced compatibility condition, is usually represented as (3.86) e

and (3.87) e

Through the assembly process, the element equilibrium conditions lead to the global finite element mesh equilibrium represented by Ku=P.

(3.88)

Once the global matrices are set up, the essential boundary conditions defined at r 1 nodes must be introduced in the system of algebraic equations, so that they can be verified exactly. The solution of the algebraic system of equations leads to the determination of the nodal values as (3.89) Finally, once the nodal values Ui are known, the differentiation of the element approximation can be performed as (3.90)

3.8.5 Boundary Element Method

The method of boundary elements is a typical representative of boundary methods. Consequently, the strong form of the weighted residual equation includes the domain term as well as all the boundary terms as in the equation { RL1 W L1 dL1 } L1

+ { }

r1

Rn Wn dr

+ { }

r2

Rr2 W r2 dr

= o.

(3.91 )

In order to illustrate the approximation of this method, consider the problem defined in equations (3.56) to (3.58). Boundary methods define the residuals RL1

=

cPu

ox 2

+ u,

Rrl =U-U

and Rr2

= q - q,

3.8 Local Direct Discretization

97

where U represents the approximation function and these residuals (3.91) is written as

(CPu ) ox2 + u W

10t

[(u - u)WrJx=o

d

q

its derivative. With

dx +

+ [(q -

q)Wr2lx=1 = 0,

(3.92)

where the boundaries r 1 and r 2 are respectively the coordinate points x = 0 and x = l. The domain term of (3.92) is integrated by parts twice, so that all the derivatives of the residual are transferred to the weighting function. Thus, the transposed form of the weighted residual equation is obtained. After defining the arbitrary weighting functions conveniently as

Wr = - OWd 1

ax

W r2

= -Wd,

(3.93)

and (3.94)

the transposed form is given by

11

u (

ッセZコ@

d

+ Wd )

dx

+

+ [qWd - UOWd] = o. (3.95) x=o ax x=l In this equation u is not under differentiation. Consequently, the admissibility conditions allow, in general, the use of a discontinuous approximation function. In the boundary element method, the weighting function is usually chosen as the fundamental solution of the given differential equation, that is OWd _ qWd] [u ax

02Wd ox 2

+ Wd + J(x -

Xi)

=0

for

-00


>

> >

restart: eqts:=diff(u(x),x$2)+u(x)=O;

(::2

eqts := u(x)) + u(x) = 0 cnds:=u(O)=O,D(u) (1)=1; ends := u(O) = 0, D(u)(l) = 1 dso1ve({eqts,cnds},u(x)):assign(%):

99

3.8 Local Direct Discretization >

u(x):=simplify(u(x)); ( ) ._ sin(x) u x .- cos(l)

> >

> > > > > >

u_O:=subs(1=1,u(x)): u_O:=plot(u_O,x=O .. 1,color=green, legend="Exact" , thickness=3) : du_O:=diff(%%,x): du_O:=plot(du_O,x=O .. 1,color=green, legend="Exact",thickness=3): plots [display] (u_O,axes=BOXED, title="Solution - Function");

Solution - Function 1.4

1.2 1

0.8 0.6 0.4 0 .2 o セM@

0.2

0.4

x

Legend

0.6 Exact

> >

plots [display] (du_O,axes=BOXED, title="Solution - Derivative");

0 .8

Approximation Methods

100

Solution - Derivative 1.8 1.6

1.4 1.2 Q セM

o

__M

0.4 x Legend

0.2

NMセ@

0.6

0.8

Exact

Finite Difference Method. Consider the domain of the problem discretized with four equally-spaced nodes. The nonessential boundary condition, specified at x = I, is used to define a mirror point, thus extending the domain of the problem. The Maple commands are given as follows: >

restart: x[1],x[2],x[3],x[4] :=0,1/3,2/3,1;

>

x[5]:=2*x[4]-x[3];

>

#

#

nodal points

mirror point 4

X5·.- -3

Collocation at the central node of the local region i - 1, i, i the residue (3.69), that is

R Ll

=

4(Ui-1 -

2Ui

+ uHd

(XHI - Xi-l)2

+ 1 leads to

+ Ui·

Hence, when collocation is carried out at interior nodes 2, 3 and 4, the following equations are obtained: > >

>

eqts:=(u[l]-2*u[2]+u[3])*4/((x[3]-x[1])-2)+u[2], (u[2] -2*u [3] +u [4]) *4/ ((x [4] -x [2]) -2)+u[3] , (u [3] -2*u [4] +u [5]) *4/ ( (x [5] -x [3]) -2) +u [4] ;

eqts := 9UI -17u2 + 9U3, 9U2 -17u3 + 9U4, 9U3 -17u4 + 9U5 The nodal value of the mirror point is obtained from the nonessential boundary condition, specified at x = I, as >

u[5] :=solve((u[5]-u[3])/(x[5]-x[3])=1,u[5]);

3.8 Local Direct Discretization

101

2

U5:= U3 + 3" Since the weighted residual equation does not include any residue of the essential boundary condition, specified at x = 0, this boundary condition must be satisfied exactly. Hence, Ul is set as > u[lJ :=O;eqts; Ul

:=

°

-17u2 + 9U3, 9U2 -17u3 + 9U4, 18u3 -17u4 + 6 Finally, the solution of the system of equations can be obtained with Maple's procedure solve as > solve({eqts}):assign(%): > seq(u[iJ,i=1 .. 4); # nodal values 243 27 624 0, 391' 23' 391 > > > > > > > > >

u_O:=sin(x)/cos(l): u_O:=subs(l=l,u_O): u_O:=plot(u_O,x=O .. l,color=green, legend=IExact",thickness=3): fdm:=[seq([x[iJ ,u[iJJ ,i=1. .4)J: fdm:=plots[pointplotJ (fdm,color=red, legend=IFDM",symbol=box,symbolsize=15): plots [displayJ (u_O,fdm,axes=BOXED, title=ISolution");

1.6 .---_______S = ol"u""-' ti> restart: > shape_f:=procCXi,Xj) > local length; > length:=Xj-Xi; > (Xj-x)/length,(x-Xi)/length > end proc: Procedure element.Jep computes the finite-element local matrices. > element_k_p:=proc(i::integer,j::integer) > global nods,Sl; > local Xi,Xj,N,kll,k21,k22,e_k,S2,e_p; > Xi:=nods[i];Xj:=nods[j]; > N:=shape_f(Xi,Xj); > kll:=diff(N[1],x)-2-N[1]-2;

104

Approximation Methods

k21:=diff(N[1],x)*diff(N[2],x)-N[1]*N[2]; k22:=diff(N[2],x)-2-N[2]-2; > array(symmetric,1 .. 2,1 .. 2, [[k11],[k21,k22]]); > e_k:=map(int,%,x=Xi .. Xj); > if nops(Sl»l then S2:=NULL > else > i f Sl [1] [1] =elems [1] [1] then > S2:=elems[nops(elems)] [2] > else > S2:=elems[1] [1] > end if; > end if; > if S2=i or S2=j then > [eval(N[1],x=nods[S2])],[eval(N[2],x=nods[S2])]; > e_p:=array([%]) > else > e_p:=array([[O],[O]]) > end if; > eval(e_k),eva1(e_p) > end proc: Procedure iniLk_p initializes the finite-element global matrices. > init_k_p:=proc() > global nods,g_k,g_p; > local n; > n:=nops(nods); > [seq([seq(O,j=1. .i)] ,i=1. .n)]; > g_k:=array(symmetric,l .. n,l .. n,%); > g_p:=array([seq([O],j=l .. n)]); > eval(g_k),eval(g_p) > end proc: Procedure globaLk_p assembles local matrices into the global ones. > global_k_p:=proc() > global elems,g_k,g_p; > local i,j,e,e_k,e_p; > for e in elems do > i,j :=e [J : > e_k,e_p:=element_k_p(i,j): > g_k[i,i] :=g_k[i,i]+e_k[l,l]: > >

3.8 Local Direct Discretization

105

g_k[i,j] :=g_k[i,j]+e_k[1,2]: g_k[j,j] :=g_k[j,j]+e_k[2,2]: > g_p[i,1]:=g_p[i,1]+e_p[1,1]: > g_p[j,1] :=g_p[j,1]+e_p[2,1]: > if nargsO then > print('assembling element: ',e); > print (g_k,g_p) > end i f > end do; > eval(g_k),eval(g_p) > end proc: Procedure exact_be forces the essential boundary conditions in the system of equations. > exact_bc:=proc() > global nods,S1,g_k,g_p; > local m,n,j; > for m in S1 do > n:=m[1] ; > for j from 1 to nops(nods) do > g_k[n,j] :=0: > g_k[n,n] :=1: > g_p En, 1] : =m [2] > end do; > end do; > eval(g_k),eval(g_p) > end proc: Procedure deriv computes finite element derivatives. > deri v: =proc 0 > global elems,nods,v: > local der,e,i,j,Xi,Xj,N,DN,k: > der: = [] : > for e in elems do > i,j :=e [] : > Xi:=nods[i] :Xj:=nods[j]: > N:=shape_f(Xi,Xj): > DN:=seq(diff(N[k],x),k=1 .. 2): > der:=[der[],DN[1]*v[i]+DN[2]*v[j]] > end do: > >

106

Approximation Methods

der end proc: To run this program, consider a finite element mesh with 4 nodes and 3 linear elements, respectively denoted in the code by the lists nods and elems. The essential boundary condition is defined in the list 81. These are all the necessary data to run the finite element application. > nods:=[0,1/3,2*1/3,1]; > elems:=[[1,2],[2,3],[3,4]]; > Sl:=[[elems[l] [1] ,0]]; 1 2 nods := [0, 3 l, 3 l, l] >

>

elems := [[1, 2], [2, 3], [3, 4]]

81

:=

[[1, 0]]

0000

0

0000

0

0000

0

Initialize global matrices. > ini t_k_p 0 ;

0000 0 Compute the matrices of each finite element and assemble them into the respective global ones. Note the symmetry of the coefficients matrix. > global_k_p(display):

assembling element: , [1, 2] 1 1 1 3 3---l --l--OO l 9 18 l 0 1 3 1 1 - - l - - 3---l 00 0 18 l l 9

o o

Mセャ@

1 3 T-

18

o o

o o

00

00

assembling element: , [2, 3] 1 1 3 9 l - 18 l - T O O l

VセMャ@

9

l

Mセャo@

18

l

o o

o

o

o

o o o o

3.8 Local Direct Discretization

107

assembling element: , [3, 4] 3 セ@ l

Mセ@

18

セ@

l-

o

l

9

セ@

Mセ@

l -

18

セ@

0

l

0

6 セ@ - セ@ l Mセ@ l - セ@ 0 l l 9 18 l 131213' - 18 l - Y 6 y - "9 l - 18 l - Y

o

Mセャ@

0

SセMャ@

o o o 1

18 l l 9 Represent graphically the global matrix of coefficients. > subs(l=l,evalm(g_k)): > plots [matrixplot]( > %,heights=histogram,gap=O.25,style=patch,axes=frame);

4

A2

o

-2

Force essential boundary conditions. > exact_be 0 ;

o o o Mセ@ o

18

l-

o

セ@

6 セ@ -

l

Mセャ@

l

セ@ l Mセ@ 9

SセMャ@

18

l-

セ@

o o l

,

0 1

18 l l 9 Solve the system of equations. > linalg[linsolve] (g_k,g_p);v:=linalg[col] (%,1):

108

Approximation Methods

o -9

l (l4 + 108l 2 + 2916) -1539l 4 + 34992 [2 - 78732 + 131 6

W

l + 54) 131 4 - 1188 [2 + 2916 -27 (5l 4 - 3241 2 + 2916) l -1539l 4 + 34992 [2 - 78732 + 131 6 Plot the finite element solution versus the exact one. Check how the essential boundary condition was exactly satisfied. > u_O:=sin(x)/cos(l): > u_O:=subs(l=l,u_O): > u_O:=plot(u_O,x=O .. 1,color=green, > legend= II Exact ", thickness=3) : > du_O:=diff(%%,x): > du_O:=plot(du_O,x=O .. l,color=green, > legend=IExact", thickness=3): > fem:=[seq([subs(l=l,nods[i]), > subs(l=l,v[i])],i=l .. nops(nods))]: > u:=plots[pointplot] (fem,style=line, > legend="FEM elements",color=red,thickness=3): > fem:=plots[pointplot] (fem,color=red, > legend="FEM nodes",symbol=box,symbolsize=15): > plots [display] (u_O,fem,u,axes=BOXED,title=IFunction"); 36

Function 1.4 1.2 1 0 .8

0.6 0.4 0.2 o

__ セM

0.2

セ@

0.4

__ _______________ x 0.6 0.8 セ@

セ@

Legend o

0

0

coo

Exact FEM nodes FEM elements

Compute the finite element derivatives and plot them. Check how the nonessential boundary condition was approximated.

3.8 Local Direct Discretization > > > > > >

109

derivO: drv:=subs(1=1,[seq(seq([nods[elems[i] [j]],%[i]], j=1 .. 2),i=1 .. nops(elems))]): fem_drv:=plot (drv, color=red, legend= ["FEM"] ,thickness=3): plots [display] ({du_O,fem_drv},axes=BOXED, title="Derivative")j

1.8

セ][Z

d セ セ ・イ セゥ カ セ 。 セ エ セ ゥカ セ ・ セ@

____________セ@

1.6 1.4

1.2 Q セM@

o

0.4

0.2

x

0.6

0.8

Legend --- Exact

-

FEM

Boundary Element Method. The fundamental solution of this problem, which satisfies (3.96), is given by WLl =

sin Ix 2

xii

=

sin r -2-'

(3.106)

where Xi is the collocation point, x is the observation point and r denotes the positive distance between the observation point and the collocation point. The derivative of the fundamental solution is evaluated as aWLl

----a;;- =

1

"2cos r

or

ax'

(3.107)

The following commands are used to verify that (3.106) satisfies (3.96) and to plot the fundamental solution, as well as its derivative. Note that the sign of Dirac's delta function does not affect the fundamental solution. > restart: > eqtn:=diff(W(x,xi),x$2)+W(x,xi)=-Dirac(x-xi)j

(::2

>

eqtn := W(x, セI@ + W(x, W:=(x,xi)->sin(abs(x-xi))/2j W := (x,

0

1 .

--+

0

= -Dirac(x -

"2 sm(lx - W

0

110

Approximation Methods

>

convert(lhs(eqtn),piecewise,x);

o { undefined o

ク\セ@

x = セ@

セ@

convert(rhs(eqtn),piecewise,x);

>

x = セ@ otherwise plot([W(x,l),diff(W(x,l),x)], x=-5 .. 6,color=[red,green],thickness=3, legend=["function","derivative"] ,axes=BDXED, title="Fundamental Solution"); { undefined

o

> > >

0.4 0 .2

o -0.2

-0.4 -4

-2

0 x Legend

2

4

6

function derivative

A simple boundary element program, specially developed for this application, can be set up with the commands given bellow. The only data necessary to run this boundary element application are the nodal coordinates defined respectively at x = 0 and x = l, stored in the variable nods, and the boundary conditions. Note that the weighting function in the transposed form of the weighted residual equation (3.98) is given by the fundamental solution (3.106), which is a function of the distance r between the observation point x and the collocation point セN@ > restart: > assume(l>O);nods:=[O,l];

n

>

nods:= [0, r:=(x,xi)->piecewise(xi=nods[1],x,xi=nods[2],1-x);

>

r := (x, セI@ -+ ーゥ・」キウHセ@ W:=r->sin(r)/2;

= nods l , x, セ@ = nods 2 , l - x)

3.8 Local Direct Discretization

111

W:=r----+

1 .

2 sm(r)

When collocation is carried out at an arbitrary point residual equation (3.98) is written as: > eq:=c*u[i]+ > > >

Xi,

the weighted

q[l]*W(r(x,nods[l]))+ u[2]*diff(W(r(x,nods[2])),x)W(r(x,nods[2]))=O; eq :=

CUi

+ セ@

ql sin (x) -

セ@

U2

+ X) + セ@

cos( -r

sin( -r

+ X)

=

0

Collocation at node 1 leads to the equation >

eql:=eval(eq,[c=l,x=nods[l],i=l]); eql :=

1

1

2 U2 cos(r) - 2 sinW) =

Ul -

0

Collocation at node 2 leads to the equation >

eq2:=eval(eq, [c=1,x=nods[2] ,i=2]); eq2 :=

1

1._

2 U2 + 2 ql sm( l

)= 0

The boundary conditions are used to define known boundary values. >

u[l] :=O;q[2] :=1;eql:=eval(eql);eq2:=eval(eq2); Ul

:= 0

q2 := 1 1

1

-2 U2 cos(r) - 2 sinW) =

eql :=

1

0

1

2 U2 + 2 ql sinW)

= 0 Solve the system of equations to obtain the boundary unknowns.

eq2 :=

>

solve({eql,eq2},{q[1] ,u[2]});assign(%): 1

{ql

sin(r)

= cosW) , U2 = - cosW)}

When collocation is carried out at an interior point, the weighted residual equation and its derivative are given respectively by > >

>

v:=q[l]*W(r(x,nods[l]))+ u[2]*diff(W(r(x,nods[2])),x)W(r(x,nods[2])); 1 sin(x)

セウゥョHイI」ッMャKx@

1.

v:= 2 cos(r) + cos(z-) > dv:=q[l]*diff(W(r(x,nods[l])),x)+ > u[2]*diff(W(r(x,nods[2]»,x$2)> diff(W(r(x,nods[2]»,x); d ._ @セ cos (x) _ セ@ sinW) sin( -r v.- 2 cosW) 2 cos(z-)

+ x)

_

+ 2 sm (-l +x)

セ@

+ 2 cos

(-r

+x

)

112 > > > > > >

> > >

Approximation Methods

u_O:=subs(l=l,sin(x)/cos(l)): u_O:=plot(u_O,x=O .. l,color=green, legend=IExact",thickness=2): du_O:=diff(%%,x): du_O:=plot(du_O,x=O .. l,color=green, legend=IExact",thickness=2): bem:=plot(subs(l=l,v),x=O .. l,color=red, legend=IBEM" , thickness=3) : plots [display] ([u_O,bem] ,axes=BOXED,title=IFunction");

Function 1.4

1.2 1 0.8

0.6 0.4 0.2 o セM@

0.2

0.4

x

Legend

0.6

0.8

1

Exact BEM

The boundary element method is highly accurate at interior points, since discretization is performed only on the boundary. This can be checked at the point x = セL@ where the solution function is computed. > BEM=evalf(subs(x=1/2,1=1,v)); > exact=evalf(subs(x=1/2,1=1,sin(x)/cos(1))); BEM exact

>

> >

= .8873283227 = .8873283225

bem:=plot(subs(l=l,dv),x=O .. 1,color=red,· legend=IBEM",thickness=3): plots[display]([du_O,bem],axes=BOXED,title="DerivativeII);

3.8 Local Direct Discretization

113

Derivative 1.8 1.6 1.4 1.2

1 L---______________________________

o

0.2

0.4

x

0.6

Legend

セ@

0.8

Exact BEM

4

At x = the solution derivative is computed as > BEM=evalf(subs(x=1/2,1=1,dv)); > exact=evalf(subs(x=1/2,1=1,diff(sin(x)/cos(1),x))); BEM = 1.624243599 exact = 1.624243599 3.8.7 Example

Find an approximate deflection u, of a simple supported beam with span l and constant bending stiffness EI, under the action of a uniformly distributed load p. Assume that this problem is mathematically described by the differential equation 82uo M 8x 2 = - EI for 0 < x < l,

(3.108)

with kinematic boundary conditions Uo

= 0 at

=0

(3.109)

Uo

= 0 at x = l.

(3.110)

x

and

M is the bending moment given by M = pix _ px 2 2 2 and Uo represents the exact solution.

(3.111)

Approximation Methods

114

Exact Solution. The exact solution of this problem can be obtained with the following Maple commands: > restart: > eqts:=diff(u(x),x$2)=-M(x)/EI;

a2

eqts := 7fX2 u(x) = >

cnds:=u(O)=O,u(l)=O;

>

ends := u(O) M:=x->p*1/2*x-p*x-2/2;

>

EI

0, u(l)

1

=

0

1

pl x - - px 2 2 2 dsolve({eqts,cnds},u(x)):assign(%): u(x):=simplify(u(x)); M := x

>

=

M(x)

----+ -

1 px(x 3 -2lx 2 +l 3 ) u(x) := 24 EI

> > >

u_O:=subs(p=10,EI=100,1=1,u(x)): u_O:=plot(-u_O*1000,x=O .. 1,color=green,legend=IExact", thickness=3): du_O:=-diff(%%,x): du_O:=plot(du_O*1000,x=O .. 1,color=green,legend=IExact", thickness=3):

>

plots [display] (u_O,axes=BOXED,

>

title="Simply Supported Beam - Deflection*1000");

> > >







-0.2 -0.4 -0.6 -0.8 -1 - 1.2 L-__ セ@

セ]

orted Beam - Deflection*1000 セ

____ 0.2 0.4 x Legend セ@

セMG@

________ 0.6 0.8 セ@

Exact

> >

plots [display] (du_O,axes=BOXED, title="Simply Supported Beam - Rotation*1000");

3.8 Local Direct Discretization

115

orted Beam - Rotation*1000

4

2

o -2 -4 セ@

______________________________

0.2

0.4 x Legend

0.6

セ@

0.8

Exact

Finite Difference Method. Consider the problem's domain discretized with five equally-spaced nodes. Collocation at the central node of a generic local region i-I, i, i + 1, leads to the residue 4 (Ui-l - 2Ui +uHd (Xi+! - Xi_I)2

+ M(Xi) EI '

which is programmed bellow as a procedure in Maple. > restart: > M:=x->p*1/2*x-p*x-2/2; #bending moment 1 1 M:=x--*-plx--px 2 2 2 > x[1] ,x[2] ,x[3] ,x[4] ,x[5] :=0,1/4,1/2,3*1/4,1; 113 Xl, X2, X3, X4, X5 := 0, 4l, 2l, 4l, 1

#nodes

res:=proe(i: : integer) #generie residue global u,x,p,l,EI; > 4*(u[i-1]-2*u[i]+u[i+1])!«x[i+1]-x[i-1])-2)+M(x[i])!EI > end proe: When collocation is carried out at interior nodes 2, 3 and 4, the following equations are obtained: > res(2);res(3);res(4); >

>

116

Approximation Methods

> eqts:=%%%,%%,%: As a domain method, the weighted residual equation does not include boundary residues and, consequently, the boundary conditions must be satisfied exactly. > u[1] :=O;u[5] :=O;eqts[1];eqts[2];eqts[3]; Ul:= U5:=

16 -2 U2

+ U3

[2

16

U2 -

2 U3

0 0

+

+ U4

l2

U3 - 2U4 l2

3 l2 32 P

EI 1

+

"8 P

l2

EI

3 l2 32 P

+-m

16 The solution of the system of algebraic equations leads to the results. > solve({eqts},{u[2],u[3],u[4]}):assign(%): > seq(u[i],i=1 .. 5);

>

> > >

> > > > >

>

5 pl4 7 pl4 5 pl4 0, 512 EI' 512 EI' 512 EI' 0 u_O:=1/24*x*p*(x-3-2*x-2*1+1-3)/EI: u_O:=subs(p=10,EI=100,1=1,u_O): u_O:=plot(-u_O,x=O .. 1,color=green,legend="Exact", thickness=3): fdm:=[seq([subs(1=1,x[i]), -subs(p=10,EI=100,1=1,u[i])],i=1 .. 5)]: fdm:=plots[pointplot] (fdm,color=red,legend="FDM", symbol=box,symbolsize=15): plots [display] (u_O,fdm,axes=BOXED, title="Simply Supported Beam");

117

3.8 Local Direct Discretization

orted Beam - Deflection

0 -0.2 -0.4 -0.6 -0.8 -1

-1.2 0

0.4 x Legend

0 .2 o

[l

C

C

C

c

0.6

0.8

Exact FDM

Finite Element Method. The boundary conditions can be satisfied exactly, since they are of the essential type. Hence, the weighted residual equation of this problem contains only the domain term, written as

1l HセZ@

+ セI@

W L1 dx = 0,

which requires C 1 continuity for the approximation function. One integration by parts of this equation leads to the weak form of the weighted residual equation

t

io

au aWL1 ax ax

dx _

{l

io

M dx _ EI

[au WL1] = 0, ax x=O,x=l

where the approximation function is required to be only CO continuous. Consequently, linear elements can be used in the discretization. Using Galerkin technique, the weighting function is defined in each element as n

W L1 = bu = LNibui, i=1

where n is the number of element nodes, Ni is a shape function and bUi represents an arbitrary variation of Ui' This definition of the weighting function implies

[WL1 ]x=O,x=l = 0, since at the boundary the field variable has a fixed value defined by the boundary conditions. Hence, for a linear finite element with nodes Xi and

Approximation Methods

118

Xj, the weak form of the weighted residual equation leads to the system of equations

1

Xj

x,.

[

HセIR@

セャ@

aNi'!!!.i ax ax (aN axj

dx lUi )

UJ

.

11 1 =

Xj

M [Ni N.J

x,. El

dx.

Note that the factor M / E I can be directly replaced by the respective mathematical expression. However, in the finite element method it is usually approximated in accordance with the element shape functions as

and

El

= EliNi + EljNj ,

where Mi and Eli represent nodal values of the bending moment and stiffness, respectively. Since the element matrices K e and pe are different from the respective matrices of the previous example, a new procedure elemenLk_p is developed to compute the local finite element matrices. All the other procedures can be used without any alteration. > element_k_p:=proc(i::integer,j::integer) > global nods,S1,moms,stifs; > local Xi,Xj,N,k11,k21,k22,e_k,S2,M,EI,crv,e_p; > Xi:=nods[i];Xj:=nods[j]; > N:=shape_f(Xi,Xj); > k11:=diff(N[1] ,x)-2; > k21:=diff(N[1],x)*diff(N[2],x); > k22:=diff(N[2],x)-2; > array(symmetric,1 .. 2,1 .. 2,[[k11],[k21,k22]]); > e_k:=map(int,%,x=Xi .. Xj); > M:=moms[i] ,moms[j]; > EI:=stifs[i],stifs[j]; > crv:=sum(M[n]*N[n],n=1 .. 2); > crv:=crv/sum(EI[n]*N[n] ,n=1 .. 2); > array([[crv*N[1]],[crv*N[2]]]); > e_p:=map(int,%,x=Xi .. Xj); > eval(e_k),eval(e_p) > end proc: Consider a finite element mesh with 4 nodes and 3 linear elements. Define the boundary conditions that must be verified exactly and define also the nodal values of the bending moment and stiffness, as follows:

3.8 Local Direct Discretization

> >

> > >

119

nods:=[0,1/3,2*1/3,1]; elems:=[[1,2], [2,3], [3,4]]; Sl:=[[elems[l] [1] ,0], [elems[3] [2] ,0]]; moms:=[seq(M(i),i=nods)]; stifs:=[EI,EI,EI,EI]; 1 2 nods := [0, 3 l, 3l, l]

elems := [[1, 2], [2, 3], [3, 4]]

Sl

:=

[[1, 0], [4, 0]]

1 1 moms:= [0, gpl2, gPl2, 0]

stifs := [EI, EI, EI, EI] Initialize global matrices. > ini t_k_p 0 ;

0000

0

0000

0

0000

0

0000 0 Compute the matrices of each finite element and assemble them into the respective global ones. Note the symmetry of the coefficients matrix. > global_k_p(display): assembling element: , [1, 2]

1 1 3- -3- 00 1 1 1

1

-3- 3- 00 1 1

1 pl3 -162 EI 1 pl3

81 EI

0

0

00

0

0

0

00

0

assembling element: , [2, 3]

Approximation Methods

120

3 セ@

-3 セ@

l

-3

1

y

o

l

1

o

l

--

y0

--

3 セ@

l

o

o

162 EI 5 pl3

1

6 y -3

-3 セ@

1 pl3

0

0

162 EI 1 pl3

0

54 EI

o

0

assembling element: , [3, 4] 1

3 y -3 -3

111

y

o

> > >

I I p l3 0 0 162 EI

y

6 y -3

y

1

1

l

l

5 pl3

--

0 1

-3- 6- -3-

162 EI 5 pl3

--

l 162 EI 1 1 1 pl3 o o -3-l 3-l -162 EI subs(p=10,EI=100,1=1,evalm(g_k)): plots [matrixplot] (%,heights=histogram, gap=O.25,style=patch,axes=frame);

Force the solution to verify exactly the boundary conditions. > exact_be 0 ;

3.8 Local Direct Discretization

1

0 1

0

121

0

0

1 0 6- -3- 0

5 pl3 --

1 0-3-

5 pl3 --

l

l

l

0

0

Vセ@

l

0

0

162 EI

162 EI

1

0 Solve the system of equations. > linalg[linsolve] (g_k,g_p);v:=linalg[col] (%,1):

o 5 pl4 -486 EI 5 pl4 -486 EI

o Plot the finite element solution versus the exact one. > u_O:=1/24*x*p*(x-3-2*x-2*l+l-3)/EI: > u_O:=subs(p=10,EI=100,l=1,u_O): > u_O:=plot(-u_O,x=O .. 1,color=green,legend="Exact", > thickness=3): > du_O:=-diff(%%,x): > du_O:=plot(du_O,x=O .. 1,color=green,legend="Exact", > thickness=3): > fem:=[seq([subs(p=10,EI=100,l=1,nods[i]), > subs(p=10,EI=100,l=1,-v[i])],i=1 .. nops(nods))]: > u:=plots[pointplot] (fem,style=line, > legend="FEM elements",color=red,thickness=3): > fem:=plots[pointplot] (fem,color=red, > legend="FEM nodes",symbol=box,symbolsize=15): > plots[display](u_O,fem,u,axes=BOXED,title= > "Simply Supported Beam - FEM Solution - 3 Elements");

Approximation Methods

122

orted Beam - FEM Solution - 3 Elements

-0.2 -0.4 -0.6 -0.8 -1 -1.2

L -____Mセ@

0.4 x Legend

0.2 o

0

0

DOD

0.6

0.8

Exact FEM nodes FEM elements

Compute finite element derivatives and plot them. > derivO; 5 pZ3 5 pZ3 [162 EI ' 0, - 162 Ell > drv:=subs(p=10,EI=100,1=1,[seq(seq([nods[elems[i] [j]], > -%[i]],j=1 .. 2),i=1 .. nops(elems))]): > fem_drv: =plot (drv, color=red,legend= ["FEM"] ,thickness=3): > plots[display]({du_O,fem_drv},axes=BOXED,title= > "Simply Supported Beam - FEM Solution - 3 Elements");

o -2 -4 セ@

________ 0.2

セ@

______ __________ 0.8 0.6 セ@

0.4 Legend

FEM Exact

セ@

3.8 Local Direct Discretization

123

The solution accuracy can be improved. Bearing in mind that the bending moment, a quadratic function, is linearly approximated in each finite element, consider a refined mesh with 7 nodes and 6 elements, as follows: > nods:=[0,1/6,1/3,1/2,2*1/3,5*1/6,lJ; > elems:=[[1,2J ,[2,3J , [3,4J , [4,5J, [5,6J, [6,7JJ; > SI:=[[elems[1] [IJ ,OJ, [elems[6J [2J ,0]]; > moms:=[seq(M(i),i=nods)J; > stifs:=[EI,EI,EI,EI,EI,EI,EIJ; nods := [0, elems :=

1

1

125

6 l , 3 l , "2l, 3 l , 6 l,

l]

[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]] 81 := [[1, 0], [7, 0]]

moms:= [0

セーャR@

'72

セーャR@

'9

セーャR@ セーャR@

'8

'9

セーャR@

'72

'

0]

セZ]{ュL}@

Initialize global matrices. > ini t_k_p 0 : Compute the matrices of each finite element and assemble them into the respective global ones. Note the symmetry of the matrix of coefficients. > global_k_pO: > subs(p=10,EI=100,1=I,evalm(g_k)): > plots [matrixplot] (%,heights=histogram, > gap=0.25,style=patch,axes=frame);

12

B A4

o

-4

Approximation Methods

124

Force the boundary conditions. > exact_be (): Solve the system of equations. > linalg[linsolve] (g_k,g_p);v:=linalg[col] (%,1):

o 25 pZ4 ---3888 EI 43 pZ4 ---3888 EI 11 pZ4 -864 EI

43 pZ4 3888 EI 25 pZ4 ---3888 EI ----

o Plot the finite element solution versus the exact one. > fem:=[seq([subs(p=10,EI=100,1=1,nods[i]), > subs(p=10,EI=100,1=1,-v[i])],i=1 .. nops(nods))]: > u:=plots[pointplot] (fem,style=line, > legend="FEM elements",color=red,thickness=3): > fem:=plots[pointplot] (fem,color=red,thickness=3, > legend="FEM",symbol=box,symbolsize=15): > a:=plots[pointplot] (%%%,color=red,thickness=3, > legend="Constant Inertia",connect=true): > plots[display](u_O,fem,u,axes=BOXED,title= > "Simply Supported Beam - FEM Solution - 6 Elements");

3.8 Local Direct Discretization

125

-0.2 -0.4 -0.6 -0.8 -1 -1.2 L-________ セ@

[]

____ __ 0.8 セ@

0.4 x Legend

0 .2 []

[]

[]

p

0 .6

セ@

Exact FEM nodes FEM elements

Compute finite element derivatives and plot them. > derivO: > drv:=subs(p=10,EI=100,1=1,[seq(seq([nods[elems[i] [j]], > -%[i]] ,j=1 .. 2),i=1 .. nops(elems))]): > fem_drv:=plot (drv, color=red,legend= ["FEM"] , > thickness=3): > plots[display]({du_O,fem_drv},axes=BOXED,title= > "Simply Supported Beam - FEM Solution - 6 Elements");

Si:rQC!1.J」N]BG

ッ ] イエ ] ・ ] 、 GM b ] ・ ] 。 ] ュ MG

M MGN f MB e ] m MGB s ] o ] iu ] エ ] ゥッ GM ョ GM M MG V BMG] e セ ャ・ セ ュ セ ・ セ ョ セ エ セ ウ@

2

o -2 0.2

0.4 x Legend

0.6 Exact FEM

0.8

Approximation Methods

126

Consider now the case of a beam with variable inertia and solve the same problem. Note how easily symbolic finite elements deal with this problem. > nods:=[0,1/6,1/3,1/2,2*1/3,5*1/6,1]; > elems:=[[1,2], [2,3], [3,4], [4,5], [5,6], [6,7]]; > Sl:=[[elems[l] [1],0], [elems[6] [2],0]]; > moms:=[seq(M(i),i=nods)]; > stifs:=[4*EI,3*EI,2*EI,EI/2,2*EI,3*EI,4*EI]; 1 1 125 nods := [0, 6 l , 3 l , 2l, 3 l, 6 l , l] elems := [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]]

81

:=

[[1, 0], [7,

Oll

5212121252 moms:= [0, 72Pl 'gpl , Spl , gpl , 72Pl ,0] stifs := [4 EI, 3 EI, 2 EI,

1

2 EI,

2 EI, 3 EI, 4 EI]

Run the application. > init_k_pO: > global_k_pO: > exact_bc 0 : > linalg[linsolve] (g_k,g_p);v:=linalg[col] (%,1):

o

l4 P (-26441n(3) - 2832In(27) + 112In(81) - 4239 + 25668In(2)) 1 419904 EI 1 l4 p (6104In(3) - 2832In(27) + 112In(81) - 3429 + 10440 In(2)) 209952 EI 1 l4 p (422In(3) - 177In(27) + 7In(81) - 165 + 491In(2)) 8748 EI 1 l4 p (12136In(3) - 4992In(27) + 224In(81) - 3429 + 10440 In(2)) 209952 EI 1 l4 p (22828In(3) - 11472In(27) + 224In(81) - 4239 + 25668In(2)) 419904 EI

o Plot the finite element solution against the solution obtained previously in the case of constant inertia. Note that the analytical solution is not available for this case. > fem:=[seq([subs(p=10,EI=100,1=1,nods[i]), > subs(p=10,EI=100,1=1,-v[i])],i=1 .. nops(nods))]: > fem:=plots[pointplot] (fem,color=blue, > legend="Variable Inertia",thickness=3,connect=true):

3.8 Local Direct Discretization > >

127

plots[display](a,fem,axes=BOXED,title= "Simply Supported Beam - FEM Solution - 6 Elements");

-0.2 -0.4 -0.6 -0.8 -1 -1.2 0

0.2

0.4 Legend

0.6

0.8

Constant Inertia Variable Inertia

Boundary Element Method. The strong form of the weighted residual equation includes the domain term as well as all the boundary terms as in the equation

11

HセZ@

+

Z) W

Ll

dx + [uWr,lx=o

+ [uWr2lx=1 = 0,

which requires first order continuity for the approximation function. When the domain term is integrated twice by parts and the arbitrary weighting functions W r, and W r 2 are conveniently chosen as

Wr = _ aWLl , ax and

W r2

aWLl

=-a;;-'

the transposed form of the weighted residual equation is then obtained as

エオ。Rセlャ、xK{w}@

Jo

ax

ax

x=l

_[au WLl ] ax x=O

+

rlMWLldx=O. Jo EI

The weighting function is chosen as the fundamental solution of the differential equation, which satisfies

a 2WLl ax 2

+ c5(x - Xi) = 0

for

-00

restart: > eqtn:=diff(W(x,xi),x$2)=-Dirac(x-xi);

::2

>

eqtn := W(x, セI@ W:=(x,xi)->abs(x-xi)/2; W := (x, セI@

=

-Dirac(x MセI@ 1

-4

2 Ix セi@

>

convert(lhs(eqtn),piecewise,x);

>

x = セ@ otherwise convert(rhs(eqtn),piecewise,x); { undefined

o

x = セ@ otherwise plot([W(x,1),diff(W(x,1),x)],x=-5 .. 7,color=[red,green], thickness=3,legend=[lfunction l ,lderivative"], axes=BDXED,title="Fundamental Solution"); { undefined

> >

>

o

3.8 Local Direct Discretization

129

Fundamental Solution

3 2.5 2 1.5 1 0.5 0 -0.5

o

-2

-4

x

2

Legend

4

6

function derivative

The boundary element program of this example presents a new feature related to the domain term of the bending moment in the weighted residual equation. Again, the only data necessary to run this boundary element application are the nodal coordinates stored in the variable nods and the boundary conditions. > restart: > M:=x->p*1/2*x-p*x-2/2; M := x

1

---> -

2

1

pix - - p x 2 2

>

nods:=[O,l];

>

nods := [0, 1] r:=(x,xi)->piecewise(xr/2;

0

--->

piecewise(x ::;

W := r

セL@

セ@

1

---> -

2

- x,

セ@

< x, x セI@

r

Compute the domain term of the weighted residual equation

t M[WLl]i d EI x,

Jo

when collocation is carried out at the nodes. Note that at node 1, x

[WLl]l =

and at node 2,

"2

130

Approximation Methods

l-x

[W412 = -2-· >

>

Dl:=int(x/2*M(x)/EI,x=nods[1] .. nods[2])j 1 pl4 Dl·=-. 48 EI D2:=int((1-x)/2*M(x)/EI,x=nods[1] .. nods[2])j

セ@

pl4 48 EI When collocation is carried out at a boundary point, the weighted residual equation is given by: > eq: =c*u [i] > +q[l]*W(r(x,nods[l])) > -q[2]*W(r(x,nods[2])) > -D=Oj D2:=

+ 21 ql ({-X X

:
+q[1]*x/2 > -q[2]*(1-x)/2 > -D=Oj eq :=

CUi

eq :=

1

CUi

1

+ 2 ql X - 2 q2 (l -

x:5.l)_D=O l eql:=eval(eq,[c=l,x=nods[l],i=l,D=Dl])j 1 pl4 48 EI = 0

1

eql := >

2 q2 l -

Ul -

eq2:=eval(eq, [c=1,x=nods[2] ,i=2,D=D2])j eq2 := U2

1 pl4 ql l - - = 0 2 48 EI 1

+-

In the previous equations, use the boundary conditions to define known boundary values. > u[l] :=Oju[2] :=OJ > eql:=eval(eql)jeq2:=eval(eq2)j Ul := 0 U2:= 0

1

eql :=

-2 q2 l -

1 pl4 48 EI = 0

1 1 pl4 eq2 := 2 qd - 48 EI = 0 Solve the system of equations to obtain the unknowns.

3.8 Local Direct Discretization

131

solve({eql,eq2},{q[1],q[2]});assign(%):

>

1 p l3 1 P l3 {q2 = - 24 EI' ql = 24 EI} For collocation at an internal point, the weighted residual equation and its derivative are given by the following equations:

v:=xi->q[1]*xi/2 -q[2]*(1-xi)/2 -int«xi-x)/2*M(x)/EI,x=nods[1] .. xi) -int«x-xi)/2*M(x)/EI,x=xi .. nods[2]): dv:=xi->q[1]/2 +q[2]/2 -int(1/2*M(x)/EI,x=nods[1] .. xi) -int(-1/2*M(x)/EI,x=xi .. nods[2]);

> > > > > > >

>

dv := > > > > > > > > >

セ@

1 --7 -

2

ql

+ -1 q2 2

Qセ@

1 M(x) - - - dx nods! 2 EI

lnods2

セ@

1 M(x) - - - - dx 2 EI

u_O:=subs(p=10,EI=100,1=1,1/24*p*x*(x-3-2*1*x-2+1-3)/EI): u_O:=plot(-u_O,x=O .. l,color=green,legend="Exact", thickness=2): du_O:=-diff(%%,x): du_O:=plot(du_O,x=O .. l,color=green,legend="Exact", thickness=2): bem:=plot(subs(p=10,EI=100,1=1,-v(z)),z=O .. 1,color=red, legend="BEM",thickness=3): plots [display] ([u_O,bem],axes=BOXED,title="Deflection");



Deflection イM]セL@

-0.2 -0.4 -0.6 -0.8 -1

-1 .2

0.2

0.4 x Legend

0 .6 Exact BEM

0.8

132 > > >

Approximation Methods

bem:=plot(subs(p=10,EI=100,1=1,-dv(z»,z=O .. 1,color=red, legend=IBEM",thickness=3): plots [display] ([du_O,bem],axes=BOXED,title=IRotation");

Rotation

4

2

o -2 -4 セ@

__ ____________ ____ ____ 0.4 x 0.6 0.2 0.8 Legend Exact セ@

セ@

セ@

セ@

BEM

At the half span x >

> >

At > > >

=

4, the deflection is computed as

BEM=-evalf(subs(p=10,EI=100,1=1,v(1/2»); exact=-evalf(subs(x=1/2,p=10,EI=100,1=1, 1/24*p*x*(x-3-2*1*x-2+1-3)/EI»); BEM = -.001302083333 exact = -.001302083333 x = 0, the rotation is computed as BEM=-evalf(subs(p=10,EI=100,1=1,dv(O»); exact=-evalf(subs(x=O,p=10,EI=100,1=1, diff(1/24*p*x*(x-3-2*1*x-2+l-3)/EI,x»); BEM exact

= -.004166666667 = -.004166666667

3.8.8 Example Find an approximate deflection u, of a cantilever beam with length land bending stiffness EI, under the action of a uniformly distributed load p. Assume that this problem is mathematically described by the differential equation

82uo

8x

2

M in 0 EI

< x < l,

(3.112)

3.8 Local Direct Discretization

133

with kinematic boundary conditions of the essential type Uo

=0

at

x

=0

and nonessential auo = 0 at x

ax

= l,

(3.113)

(3.114)

where px 2

M=-2 is the bending moment and Uo represents the exact solution.

(3.115)

Solution. The exact solution of this problem, as well as approximate solutions obtained with the methods of finite differences, finite elements and boundary elements, are included, with the respective Maple programs, in the companion CD-ROM.

4. Interpolation

4.1 Introduction The finite element method considers an approximation function defined in each finite element in terms of a set of interpolation functions. This feature, already introduced in the previous chapter through linear interpolation functions, plays a key role in the finite element method. Hence, it requires a special approach in this introductory text. The concept of interpolation can be introduced through the following one-dimensional problem: Determine a function u(x) that takes fixed values Ui at n given abscissae Xi, that is

U(Xi) = Ui for i = 1·· ·n. The proposed interpolation problem can be solved in different ways, giving rise to different interpolation techniques. The following techniques, specially suited for the finite element method, can be mentioned: • Lagrange or simple interpolation - the interpolation problem is defined only for the function u(x)

U(Xi) = Ui for i = 1·· ·n. • Hermite or osculatory interpolation - the interpolation problem is defined for the function u( x)

U(Xi) = Ui for i = 1· .. n and simultaneously for its derivative u/(x) uOHxゥI]セ@

fori=l···m,

where m can be different from n. • Orthogonal interpolation - the residuals of the interpolation [U(Xi) - Ui], are forced to be orthogonal to a set of given functions >

> >

plots [pointplot] (nds, legend="Nodes",symbol=box,symbolsize=15): plots [display] (%%,%, axes=80XED,title="Quadratic Finite Element");

Quadratic Finite Element UイMセ]L@

4

3 2

3

2.5

2

o

0

3.5 Legend

4

4.5

5

Element Nodes

Area Coordinates. This system of natural coordinates can be used for triangular elements. Consider a triangular finite element with area A and an arbitrary point P which divides the element in three triangles with areas equal to AI, A2 and A 3 , as represented in Fig. 4.6. The area coordinates of

Area: A=A t+A2+A3 L 1- Ail A

Figure 4.6. Natural coordinates of area the point P are defined as

Li=

Ai

A'

(4.25)

Interpolation

154

Note that only two of the natural coordinates are independent, since they must satisfy the condition Ll + L2 + L3 = 1. At the point P, the relationship between natural coordinates (Ll' L 2, L 3 ) and the global coordinates (x, y) is given by

(4.26)

The inverse relationship is given by

(4.27)

where Xi and Yi are the global coordinates of nodes located at the corner points of the finite element, and Aij = Xi Yj -Xj Yi. Relationship (4.26) allows the definition of the shape functions of the linear triangular finite element as Nl

= L 1,

and N3 =

L3·

A quadratic triangular finite element has 3 additional nodes, numbered 4, 5 and 6, located at mid-side points between nodes 1-2, 2-3 and 3-1. This element has three shape functions defined as

for a corner node i and

Ni

= 4L j L k ,

for mid-side nodes i, where j and k are the nodes before and after the node i, respectively. Rectangular Coordinates. This system of coordinates can be used for both triangular and rectangular finite elements. The natural rectangular coordinates 8 and t are measured in a cartesian system, as represented in Fig. 4.7

When rectangular coordinates (8, t) are used, the shape functions of the linear triangular element are given by Nl

= 1- 8

N2 =

8

-

t,

(4.28) (4.29)

4.5 Finite Element Shape Functions

1

L

(1,1) (x1'Yl)

(-1,-1)0--_ _ _ _ _--0 (1,-1) (X:l'Y3) HセGyTI@

3

4

155

t (0,1) (X:l'Y3)

(0,0) (Xl'Yl)

3

2 s 1

(1,0) HセGyRI@

Figure 4.7. Rectangular natural coordinates

and

= t.

N3

(4.30)

Note that they satisfy the condition

+ N2 + N3 =

Nl

l.

In the case of the bilinear rectangular finite element, the shape functions are given by 1 Nl = 4: (1 + s) (1 + t), 1

= 4: (1 - s) (1 + t),

N2

1 N 3 =-(1-s)(1-t) 4

and 1

= 4: (1 + s) (1 - t).

N4

The relationship between natural coordinates (s, t) and global coordinates (x, y) can be obtained through the interpolation of the geometry of the element. The functions of interpolation are given by n

X

= セ@

Ni(s, t)Xi

(4.31 )

Ni(s, t) Yi,

(4.32)

i=l

and n

y = セ@ i=l

where n represents the number of nodes of the element and (Xi, Yi) represent the global nodal coordinates. The inverse relationship can be obtained by solving the two simultaneous equations (4.31) and (4.32) to obtain the natural coordinates (s, t).

Interpolation

156

4.5.2 Curvilinear Coordinates

Consider the discretization of a domain with curved boundaries. When finite elements with straight sides only are used, it can be difficult to perform the discretization without exaggerating in the total number of elements. For domains with curved boundaries, the most appropriate solution usually considers the use of finite elements with curved sides. Curved-side finite elements can be obtained directly from the elements with straight sides through the interpolation of the nodal coordinates. In this process of interpolation of the element geometry, the natural reference coordinates, which are straight in the element of straight sides become curvilinear in the actual element with curved sides, as shown in the Fig. 4.8. The coordinate transformation is car-

1

3

セッM・

(0)

(-1,1) セM@

(1/2)

2

5 (0,1)

s••--.o 2

(1)

1

セ@

6

(-1,0)

7

HセGyRI@

8

8

(1,0)

(-1,-1)6-_ _-0-_ _--0 (1,-1) (0,-1)

3

2

(1,1)

4

HセGySI@

(Xs>Ys)

3

Figure 4.8. Curvilinear coordinates

ried out from the parent element, the element with straight sides defined in a natural coordinate system, to the actual element defined in the global system of coordinates as n

X

=

L

NiXi,

(4.33)

i=l

n

(4.34)

and n

Z

=

L i=l

Nizi ,

(4.35)

4.5 Finite Element Shape Functions

157

where n is the total number of nodes of the element, (Xi, Yi, Zi) are nodal global coordinates, and Ni are the element shape functions defined in a natural coordinate system of the element. Through this coordinates transformation, the parent element is mapped into the actual element. 4.5.3 Example This example shows three applications of curvilinear coordinates of the quadratic rectangular finite element. In each application, the parent square element is mapped into a different rectangular surface. In the first and second applications, the rectangular surface corresponds to the shape function of, respectively a mid-side and a corner node of an arbitrary quadratic rectangular finite element. In the third application, the rectangular surface has the shape of a paraboloid hyperbolic. The code of this program is in the companion CD-ROM. Procedure sL2d computes the shape functions of several two-dimensional finite elements. The local numbering of the element nodes is always assumed in the counter clockwise sense. The parent linear triangular element, defined with rectangular natural coordinates, considers the triangle in the first quadrant in such way that the side 2-3 does not contain the origin. The parent rectangular element starts numbering at a corner node. Procedure interp_2d computes the interpolation functions of the element geometry. A rotation about the Z axis is performed in order to display animations that obviously can be seen only in the real program. > restart: > sf_2d:=proc(s,t,num_nods) # 2d shape functions > local ss,tt,st,sst,stt,N; > ss:=s*s:tt:=t*t:st:=s*t:sst:=ss*t:stt:=s*tt: > if num_nods=3 then # linear triangle > N[1] :=1-s-t; > N[2]:=s; > N[3] :=t > elif num_nods=4 then # bilinear rectangle > N[1] :=(1+s+t+st)/4; > N[2]:=(1-s+t-st)/4; > N[3] :=(1-s-t+st)/4; > N[4] :=(1+s-t-st)/4; > elif num_nods=8 then # quadratic rectangle > N[1] :=(-1+st+ss+tt-sst-stt)/4; > N[3]:=(-1-st+ss+tt-sst+stt)/4; > N[5] :=(-1+st+ss+tt+sst+stt)/4;

158

Interpolation

N[7] :=(-1-st+ss+tt+sst-stt)/4; N[2] :=(1-t-ss+sst)/2; > N[4]:=(1+s-tt-stt)/2; > N[6] :=(1+t-ss-sst)/2; > N[8] :=(1-s-tt+stt)/2 > end if; > eval(N) > end proc: > interp_2d:=proc(nods::listlist,alpha) > local n,N,s,t,x,y,z,xx,yy; > n:=nops(nods); > if n=3 or n=4 or n=8 then > N:=sf_2d(s,t,n); > x:=add(N[i] *nods [i] [1] ,i=l .. 8): # x-interpolation > y:=add(N[i] *nods [i] [2] ,i=l .. 8): # y-interpolation > z:=add(N[i] *nods [i] [3] ,i=l .. 8): # z-interpolation > xx: =cos (alpha) *x+sin(alpha) *y; # rotation about z axis > yy:=-sin(alpha)*x+cos(alpha)*y; > unapply(xx,s,t),unapply(yy,s,t),unapply(z,s,t) > end i f > end proc: The only data required are the global coordinates of the nodes. Maple objects p and pO represent, respectively a rectangular surface and a horizontal plane > nds:=[[-4,4,0],[-4,0,0], [-4,-4,0],[0,-4,0], > [4,-4,0], [4,0,1], [4,4,0], [0,4,0]]: > x,y,z:=interp_2d(nds,alpha): > p:=plots[animate3d]( > [x(s,t),y(s,t),z(s,t)], > s=-l .. l,t=-l .. l, > alpha=0 .. 2*Pi, > lightmodel='light1', > orientation=[25,60], > shading=XYZ, > numpoints=100, > frames=40): > nds[6] :=[4,0,0]: > x,y,z:=interp_2d(nds,alpha): > pO:=plots[animate3d]( > [x (s , t) , y (s , t) , z (s , t)] , >

>

4.5 Finite Element Shape Functions > > >

> > > > > >

s=-1 .. 1,t=-1 .. 1,alpha=0 .. 2*Pi, color=yellow, lightmodel='light1', orientation=[25,60], shading=XYZ, numpoints=100, frames=40): plots [display] (p,pO, title='Shape Function of a Mid-Side Node');

Shape Function of a Mid-Side Node

>

> > > > > > >

> >

> > > >

nds:=[[-4,4,1],[-4,0,0] ,[-4,-4,0], [0,-4,0], [4,-4,0], [4,0,0], [4,4,0], [0,4,0]]: x,y,z:=interp_2d(nds,0): p:=plot3d([x(s,t),y(s,t),z(s,t)], s=-1 .. 1,t=-1 .. 1, style=PATCHCONTOUR): nds[1]:=[-4,4,0]: x,y,z:=interp_2d(nds,0): pO:=plot3d([x(s,t),y(s,t),z(s,t)], s=-1 .. 1,t=-1 .. 1, style=WIREFRAME): plots [display] (p,pO,axes=BOXED, orientation=[15,60], title='Shape Function of a Corner Node');

159

Interpolation

160

s[キ



o セ ヲ セ 。 セ 」 Z ッ セ イョ セ ・ Zセ イ セn

o Z 、 Z ・ セ@

______

1

0.8 0.6 0.4

0.2 0 -0.2 4

> > >

> >

> > >

nds:=[[-4,4,1],[-4,0,0],[-4,-4,1],[0,-4,2], [4,-4,1], [4,0,0], [4,4,1J, [0,4,2J]: x,y,z:=interp_2d(nds,alpha): plots [animate3d] ([x(s,t),y(s,t),z(s,t)] , s=-1 .. 1,t=-1 .. 1,alpha=0 .. 2*Pi,color=red, lightmodel='light1',orientation=[25,80], shading=XYZ,thickness=1,numpoints=100, frames=40,title='Qadratic Rectangular Element');

Qadratic Rectangular Element

4.6 Parametric Finite Elements

161

4.6 Parametric Finite Elements Consider again the mapping of a parent element, defined in a natural coordinate system, into the corresponding actual element defined in the global system of coordinates, that is (4.36) i=l

n

(4.37) and n

Z

=

L

Nizi .

(4.38)

i=l

The set of global coordinates (x, y, z) which define the element geometry can be viewed as a system of parametric coordinates, where the global nodal coordinates (Xi, Yi, Zi) are the required parameters of the geometry representation. On the other hand, the function of approximation of the field variable in the finite element can also be described with a parametric system as m

u=

L

MiUi,

(4.39)

i=l

where m is the total number of interpolated nodal values Ui, the parameters of the field approximation, and Mi are the corresponding shape functions of the element. In general, the description of the geometry of the element with equations (4.36) to (4.38) and the description of the function of approximation of the field variable with equation (4.39) constitute two independent parametric systems, as represented in Fig. 4.9. Based on the independence of these two parametric systems, three types of finite elements, known as sub-parametric, super-parametric and isoparametric, can be formulated. Sub-parametric elements use less nodes to define the geometry of the element than they use to define the function of approximation of the field variable. Super-parametric elements are formulated in the reverse way that is, they use more nodes to define the geometry of the element than they use to define the function of approximation of the field variable. Whenever the geometry parameters (Xi, Yi, Zi) are defined at the same nodes where the field approximation parameters Ui are defined, the element is known as isoparametric.

Interpolation

162

Quadratic geometry Cubic field approximation

Quadratic geometry Linear field approximation

Quadratic geometry Quadratic field approximation

o - Parameters of the geometry o - Parameters of the field approximation

Figure 4.9. Parametric finite elements

4.7 Isoparametric Finite Elements In isoparametric elements, the same shape functions are used in the interpolation of the geometry and in the approximation function of the field variable. Thus, the geometry is given by n

X

=L

NiXi,

i=l

n i=l

n

Z

=L

Nizi ,

(4.40)

i=l

and the approximation function is given by n

U=

L

NiUi'

(4.41 )

i=l

The advantage of using isoparametric elements is that they represent the field variable as accurately as they represent the geometry. This feature is particularly desirable in the great majority of engineering problems, see [9], [10] and [11]. Since isoparametric elements can be distorted, it is in order here to assess their conditions of convergence. 4.7.1 Convergence Conditions

The convergence of isoparametric finite elements is determined by the admissibility conditions of the field approximation function which can be expressed in terms of continuity and completeness. Regarding the continuity, it can be shown that continuity at nodes implies total continuity that is: a) continuity inside the element and b) continuity along the boundaries between linked elements, since each shape function is null along all boundaries of the element that do not contain the node where

4.7 Isoparametric Finite Elements

163

the parameter to which the shape function refers to is defined. In fact, at a point P of the boundary of the element, the field approximation can be given by U(P)

=

n

m

i=l

i=l

L Niui = L NiUi,

where nand m represent, respectively the total number of parameters of the element and the total number of parameters of the boundary where the point P is. Thus, the field approximation is completely determined by the parameters of the boundary where the point P is located and, since these parameters are the same for the adjacent element, it follows that the field approximation is identical on both sides of the common boundary. On the other hand, the polynomial definition of shape functions implies the continuity of the field approximation inside the element. A complete linear function of the field approximation is possible in an isoparametric element with n field parameters, provided the element shape functions Ni satisfy the relationship: n

(4.42) To prove this point, consider a linear function given by U = al

+ a2 x + a3 Y + a4 z.

This function can be expressed through the interpolation function of its nodal values Ui = al + a2 Xi + a3 Yi + a4 Zi as n

U=

L

n

Ni Ui

i=l

=L

Ni (al

+ a2 Xi + a3 Yi + a4 Zi)

i=l

which can be written as

or u=al

(t

Ni) +a2 x + a 3y+a4 z ,

since interpolation functions of the geometry are given by (4.40). This expression finally leads to the assumed linear function, provided (4.42) is satisfied.

Interpolation

164

4.7.2 Evaluation of Element Equations In the finite element method, it is required to evaluate, for each finite element, the weighted residual equations which contain integrals of functions defined in terms of global coordinates. Consider, for the sake of simplicity, the twodimensional case and an integral of the typical form

r f (U'ax'ay au au) iLle

(4.43)

dxdy,

defined on an isoparametric element ,de, where (x, y) are global coordinates. Bearing in mind that the element may have curved sides, the evaluation of this integral, in the global coordinate system, can be very difficult. This difficulty, however, can be readily overcome through the use of natural coordinates. Indeed, if the integral (4.43) is expressed only in terms of the element natural coordinates (s, t), its evaluation can be carried out on the straight-side parent element, between the integration limits -1 and + l. Consider an isoparametric element with n field parameters Ui. The function of the field approximation is given by n

U=

L

(4.44)

Ni(s, t) Ui,

i=l

where N i , the element shape functions, are expressed in terms of the element natural coordinates (s, t). Global derivatives of (4.44) are given, respectively by (4.45)

and

au _ セ@ a - セ@ y

aNi(s, t) . aU,. i=l

(4.46)

Y

In order to compute the global derivatives of the shape functions, consider the chain rule of differentiation as

aNi

aNi ax

aNi

aNi ax ax at

aNi ay

= ax -+ay -as as as and

at =

aNi ay

+ ay at·

It can be written in matrix form as

as aNi [ !ll!i at

as as 1 [aNi ax 1= J [ aNi ax 1 1= [OX!!JL ax !!JL!ll!i aNi' at at

oy

oy

(4.47)

4.7 Isoparametric Finite Elements

165

where

[ axaxas

J=

'l.J1] as 'l.J1

(4.48)

at at

is the Jacobian matrix of the transformation of coordinates from (s, t) to (x, y). Provided that J is nonsingular, the global derivatives of the shape functions can be obtained by inversion of (4.47) as

。セゥ}@ [ fJ!:!J..

= J- 1

{セ}N@

(4.49)

!ll!...

ay

at

It can be shown that the Jacobian is nonsingular whenever the element has the nodes correctly defined and is not exaggeratedly distorted. The Jacobian matrix can be calculated from the transformation of the parent element into the actual global element. In this transformation, the functions of the geometry interpolation, given respectively by n

x =

L

Ni(s, t)Xi

i=l

and n

y

L Ni(s, t) Yi,

=

i=l

are introduced in the Jacobian matrix (4.48), leading to

J =

"'ONi(S,tlxo as • [ L..J ' " aNi(s,t) L..J -a-t- Xi

",ONi(S,tl L..J as ' " aNi(s,t) L..J -a-t-

0]

Y.

Yi

.

(4.50)

The determinant of the Jacobian matrix establishes the relationship between infinitesimal integration elements of, respectively the global and the local coordinate systems. To obtain this relationship consider the differentiation of the element geometry, given by dX] [ dy

=

{セ@ 'l.J1 'セ}@l.J1

[dS] dt

as at

= JT [dS] dt

(4.51)

and use the identity matrix to obtain [

dX 0 ] o dy

= JT

[dS

0] ,

o dt

(4.52)

which leads to dxdy =

iJi dsdt,

(4.53)

166

Interpolation

where IJI represents the determinant of the Jacobian matrix. When all these transformations are performed, (4.43) can be replaced by

J(

au au) dxdy= 11 11 g(s,t)IJldsdt,

f U'£:I'£:I

,1e

uX

uy

-1

(4.54)

-1

where g(s, t) is the function that results from the transformation of f(x, y). The right-hand side of this equation can be evaluated analytically if the integrand is sufficiently simple. Otherwise, numerical integration should be used. 4.7.3 Numerical Integration

Gauss quadrature is the most suitable process used in the finite element method to evaluate numerically the integral of a function of one variable, see [12]. The process consists of evaluating the function to be integrated at specified sampling points, multiplying these values by specific weights and summing the products. A polynomial function can be integrated exactly, provided the correct number of sampling points is used. The integration of a function over a given range is equivalent to the evaluation of the area under the graph of the function in the given range. To deal with area calculations, Gauss quadrature evaluates the function at a point and multiplies this value by a length, defined along the integration variable. If, for instance, the function is linear, as represented in Fig. 4.10, the value

ヲHセI@

Figure 4.10. Integration of a linear function of the function evaluated at half range, multiplied by the total length of the range, leads to the exact value of the area. Hence, the exact integration of a first order polynomial requires one sampling point. In general, n sampling points are required to integrate a polynomial of the order 2n - 1 exactly. The formula of Gauss quadrature is given by

4.7 Isoparametric Finite Elements

167

(4.55) are, respectively the where n is the number of integration points, Hi and ヲHセゥI@ weight and the function at the sampling point i. Table 4.1 gives the sampling Table 4.1. Abscissae and weights of the Gaussian quadrature formula Polynomial degree

Number of points

Sampling point

Weight

2n-l

n

ei

Hi

1

1

0

2

3

2

=t=1/v'3

1

5

3

-Vi5/5

5/9 8/9 5/9

0

+Vi5/5

points and the respective weights, for Gauss quadrature with up to three points, within the integration limits -1 to l. Formula (4.55) can be generalized for higher dimensions. For two dimensions, for instance, the formula of Gauss quadrature is given by (4.56) where abscissae Table 4.l.

ei, 'r/j

and weights Hi, H j can be defined with values from

Example. Apply Gaussian quadrature in the evaluation of the integral

・GイOR、セ@ / -11 /1 -1

]セN@

9

Since the function to integrate is a second order polynomial, both in the セ@ and 'r/ variables, considering two sampling points in each direction is enough to obtain the exact value of the integral. Hence, defining ヲHセL@ 1]) = セRQ}@ and taking the two sampling points 1

6

= 1]1 = - J3'

1

6

= 1]2 = J3'

gives f(6, 1]1)

Taking the corresponding weights from Table 4.1 HI

1

= f(6, 1]d = f(6, 1]2) = f(6, 1]2) = g'

= H2 = 1,

168

Interpolation

and applying (4.56) leads to the result

[11 [: ery2 、セ@

dry

= HI Hd(6 , ryd + H2H1f(6, ryd +

4.8 Linear Triangular Isoparametric Element Each node of the mesh, with coordinates represented by (4.57) has one degree of freedom, the field variable u. The linear triangular finite element is defined with three corner nodes, locally numbered anti clockwise. The nodal coordinates x e and the degrees of freedom u e of the element are given, respectively by

(4.58)

and (4.59)

where Xi represents the coordinates of the node i. Consider the isoparametric formulation. The parent element can be defined in the system of natural rectangular coordinates (8, t), as represented in Fig. 4.11. The same shape functions, (4.28) to (4.30), are used to interpolate the parameters of the geometry and the parameters of the field variable, respectively as X -_

[N1 0 N2 0 N3 0 o N1 0 N2 0 N3

1xe

(4.60)

and (4.61) The relationship between the global and local differential area elements is given by

4.8 Linear Triangular Isoparametric Element

169

node 3 (0,1)

s node 1 (0,0)

node 2 (I,D)

Local (s,t)

x

Global (x,y)

r 1

l Figure 4.11. Natural coordinate system and shape functions of the linear triangular element

dx dy where

PI

= IJI ds dt,

represents the determinant of the Jacobian matrix

J= [;;

セャ@

at at

= [X2- Xl Y2-Yl]. X3 - Xl Y3 - YI

(4.62)

Note that the area Lle of the triangle can be evaluated through the determinant of the Jacobian, as (4.63) 4.8.1 Example

With a few simple procedures, the linear triangular isoparametric finite element can be programmed in Maple. The program listing, with additional printing commands, is in the companion CD-ROM. > restart: Shape functions. > shape_f:=proc(nat_crds: :list) > local N,s,t; > N:=[l-s-t,s,t]; > subs (s=nat_crds [1] ,t=nat_crds[2] ,N) > end proc:

170

Interpolation

Local derivatives of the shape functions. > lder_shape_f:=proc(nat_crds::list) > local N,s,t,lder; > N:=shape_f([s,t]); > lder:=[seq([diff(N[i] ,s),diff(N[i] ,t)] ,i=l .. 3)]; > subs (s=nat_crds [1] ,t=nat_crds[2] ,lder) > end proc: Jacobian of the transformation. > jacob:=proc(e_nods: :list(list),det_jac: :evaln, > nat_crds::list) > local enods,N,s,t,x,y,jac; > enods:=map(i->i[] ,e_nods); > N:=shape_f([s,t]); > N:=seq(array([[N[i] ,0], [O,N[i]]]),i=l .. 3); > N:=linalg[augment](N[1],N[2],N[3]); > linalg[multiply] (N,enods); > x,y:=%[1],%[2]; > linalg[jacobian]([x,y],[s,t]); > jac:=linalg[transpose] (%); > jac:=subs(s=nat_crds[l] ,t=nat_crds[2] ,eval(jac)); > det_jac: =linalg [det] (jac); > eval(jac) > end proc: Global derivatives of the shape functions. > gder_shape_f:=proc(e_nods::list(list),nat_crds::list) > local jac,det_jac,i_jac,lder,s,t,gder; > jac:=jacob(e_nods,det_jac, [s,t]); > i_jac:=linalg[inverse] (jac); > lder:=lder_shape_f([s,t]); > gder:=[seq(linalg[multiply](i_jac,lder[i]),i=1 .. 3)]; > subs (s=nat_crds [1] ,t=nat_crds[2] ,gder) > end proc:

4.8 Linear Triangular Isoparametric Element

171

4.8.2 Example

Use the procedures presented in the previous example to compute the area and volume of each linear triangular finite element of a given mesh, as area

=

1

dxdy

=

11 11 IJI -1

de

dsdt

-1

and volume =

J de

udxdy =

11 1

-1

1 (

-1

L 3

Ni Ui

)

IJI dsdt.

i=1

restart: > interface(verboseproc=3):printlevel:=3: > element_av:=proc(e_nods: :list(list),e_uvals: :list) > local N,s,t,u,det_jac,area,volume; > N:=shape_f([s,t]); > u:=add(N[i]*e_uvals[i] ,i=1 .. 3); > jacob(e_nods,det_jac,[s,t]); > area:=eval(int(int(det_jac,t=O .. 1-s),s=0 .. 1)); > volume:=eval(int(int(u*det_jac,t=O .. l-s),s=O .. l)); > area, volume > end proc: Define a simple triangular finite element mesh, with 2 elements, to run the application. > nods:=[[3,3],[0,2],[2,0],[0,0]]: > elems:=[[2,4,3],[1,2,3]]: >

Define arbitrarily simple nodal values. > uvals:=[S,5,5,5]: Use the procedures ploLmesh and animate_3D_rot, presented in chapter I, to check the finite element mesh. Procedure ploLmesh produces an exploded view of the finite element mesh with numbered nodes and elements. Procedure animate_3D_rot produces a three-dimensional animation of the mesh rotating about a vertical axis. Note that these procedures use routines of the graphic package Plotter which must be loaded. > plot_mesh();animate_3D_rot();

Interpolation

172

Finite Element Mesh 1

2

3

4

Node Number

Element Number

Finite Element Mesh

Print data of element number 1 and compute its area and volume. > e1ems[lJ; > e_nods:=[seq(nods [e1ems [lJ [iJJ,i=1 .. 3)J; > e_uvals:=[seq(uvals [elems [lJ [iJJ,i=l .. 3)J;

[2, 4, 3J e_nods := [[0, 2], [0, 0], [2, 0JJ e_uvals := [5, 5, 5J

4.8 Linear Triangular Isoparmnetric Element

>

area,volume:=element_av(e_nods,e_uvals);

* * * * Nodal Coordinates * * * * [0, 2], [0, 0], [2, 0]

* * * * Shape Functions * * * * [1 - s - t, s, t]

**** Geometry Interpolation **** [2 t, 2 - 2 s - 2 t]

**** Jacobian ****

[0-2] 2 -2

**** Jacobian Determinant **** 4 area, volume := 2, 10

Print data of element number 2 and compute its area and volume. > elems[2]; > e_nods:=[seq(nods [elems [2] [i]],i=1 .. 3)]; > e_uvals:=[seq(uvals [elems [2] [i]],i=1 .. 3)];

[1,2,3] e_nods := [[3, 3], [0, 2], [2, 0]] >

e_uvals := [8, 5, 5] area,volume:=element_av(e_nods,e_uvals); * * * * Nodal Coordinates * * * *

[3, 3], [0, 2], [2, 0]

* * * * Shape Functions * * * * [1 - s - t, s, t]

**** Geometry Interpolation **** [3 - 3 s - t, 3 - s - 3 t]

**** Jacobian ****

[-3 -1] -1 -3

* * * * Jacobian Determinant **** 8 area, volume := 4, 24

173

174

Interpolation

4.8.3 Example

Compute the gradient components of each finite element of a given linear triangular mesh, as

and

8u 8 ( 3 ) 3 8Ni N i ui = Ui ' 7) = セ@ uy i=l i=l Y Y restart: interface(verboseproc=3):printlevel:=3: element_grd:=proc(e_nods::list(list),e_uvals::list) local s,t,u,gder,grd; gder: =gder_shape_f (e_nods, [s,t]); grd:=seq(add(gder[i] [j]*e_uvals[i],i=1 .. 3),j=1 .. 2); eval (grd) [] end proc:

2:

> > > >

> >

> >

2: a

Use the same finite element mesh defined in the previous example. > nods:=[[3,3], [0,2], [2,0], [0,0]]: > elems:=[[2,4,3],[1,2,3]]: Define the same nodal values. > uvals:=[8,5,5,5]: Print data of element number 1 and compute its gradient components. > elems[1]; > e_nods:=[seq(nods [elems [1] [i]] ,i=1 .. 3)]; > e_uvals: = [seq(uvals [elems[1] [i]],i=1 .. 3)]; e_nods := >

[2,4,3] [[0, 2], [0, 0], [2, 0]]

e_uvals := [5, 5, 5] dudx,dudy:=element_grd(e_nods,e_uvals);

****

Nodal Coordinates

****

[0, 2], [0, 0], [2, 0]

****

Shape Functions

****

[1 - s - t, s, t]

****

Geometry Interpolation [2 t, 2 - 2 s - 2 t]

****

4.8 Linear 'Iriangular Isoparametric Element

****

Jacobian

[0-2]

175

****

2 -2

**** ****

****

****

Jacobian Determinant 4

****

Inverse of Jacobian

Local Derivatives of Shape Functions

****

[-1, -1], [1, 0], [0, 1]

****

Global Derivatives of Shape Functions

[0, セ}@ , {セQL@ セャj@

****

' {セL@ 0]

dudx, dudy := 0,

a

Print data of element number 2 and compute its gradient components. > elems[2]; > e_nods:=[seq(nods[elems[2] [i]],i=1 .. 3)]; > e_uvals:=[seq(uvals [elems [2] [i]] ,i=1 .. 3)];

[1,2,3] e_nods := [[3, 3], [0, 2], [2, 0]] >

e_uvals := [8, 5, 5] dudx,dudy:=element_grd(e_nods,e_uvals);

****

[3, 3], [0, 2], [2, 0]

**** ****

****

Nodal Coordinates Shape Functions [1 - s - t, s, t]

****

Geometry Interpolation

[3 - 3 s - t, 3 - s - 3 t]

****

Jacobian

[-3 -1]

****

****

-1-3

****

Jacobian Determinant 8

****

Interpolation

176

****

Inverse of Jacobian

****

セS@ セ@ 1

[ 1 -3

8

****

8

Local Derivatives of Shape Functions

****

[-1, -1], [1,0], [0, 11

****

Global Derivatives of Shape Functions

****

1 1] [-3 1] [1 -3] [4' 4' 8' 8 ' 8' 8 dudx, dudy :=

3 3

4' 4

4.8.4 Example

Compute the value of shape functions at the centroid of each linear triangular finite element of the mesh used in the previous example. > element_sfs:=proc(e_nods: :list(list),pnt: :list) > local N,s,t,eqx,eqy; > N:=shape_f([s,t]); > eqx:=pnt[l]=add(N[i]*e_nods[i] [1],i=1 .. 3); > eqy:=pnt[2]=add(N[i]*e_nods[i] [2],i=1 .. 3); > solve({eqx,eqy},{s,t});assign(%); > shape_f([s,t]) > end proc: Print data of element number 1 and perform the respective computations. > elems[l]; > e_nods:=[seq(nods [elems [1] [i]] ,i=l .. 3)]; > centroid:= [seq(add(e_nods [i] [j] ,i=l .. 3)/3,j=1 .. 2)]; e_nods :=

[2,4,31 [[0, 2], [0, 0], [2,

centroid := >

Oll

2 2

[3' 31

element_sfs(e_nods,centroid);

111

[3' 3' 31 Print data of element number 2 and perform the respective computations.

4.8 Linear Triangular Isoparametric Element

> > >

elems[2]; e_nods:= [seq(nods [elems [2] [i]],i=1 .. 3)]; centroid:=[seq(add(e_nods[i] [j] ,i=1 .. 3)/3,j=1 .. 2)];

e_nods :=

[1, 2, 3] [[3, 3], [0, 2], [2,

centroid := >

5 5

[3' 3]

element_sfs(e_nods,centroid);

111

[3' 3' 3]

all

177

5. The Finite Element Method

5.1 Introduction Discretization is an essential engineering tool for the analysis of physical problems. Formal solutions of continuum models, defined in the first step of the mathematical modelling process, are generally not available for practical problems and, consequently discretization must be used in order to obtain an approximate solution. The finite element method is possibly the most popular model of discretization available in engineering. Based on domain and boundary discretization, the finite element method reduces the infinite number of degrees of freedom of a continuum problem to a finite number of unknowns defined at element nodes. Inside each finite element the field variable is approximated through interpolation of the nodal values. Obviously, the level of approximation of the finite element solution depends on the adopted interpolation functions, as well as on the topology of the finite element mesh. The application of the finite element method is performed through six basic steps, see [13], [14] and [15], executed as follows: 1. Definition of the finite element mesh.

2. 3. 4. 5. 6.

Generation of local finite element equations. Assembly of the local element equations into the global ones. Introduction of the exact boundary conditions. Solution of the resulting system of algebraic equations. Computation of any other finite element function, based on nodal values.

Before explaining each one of these steps, a review of the formulation of the finite element model is presented for steady-state problems with scalar variable.

5.2 Steady-State Models with Scalar Variable Some physical problems can be modelled in terms of a scalar quantity. This is the case, for instance, of problems such as heat conduction, torsion, electric potential, fluid flow in ducts, seepage and groundwater flow which are known A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

The Finite Element Method

180

as scalar-variable problems. Continuous models with a scalar variable have a single unknown, the scalar variable, continuously defined in the domain of the problem. Consequently, discrete models of a scalar variable have only one degree of freedom at each node which is the local value of the scalar variable.

5.2.1 Continuous Model Consider the case of a steady-state problem with a scalar variable, governed by the two-dimensional differential equation

:x (

Kx

セI@

+

:y (

Ky

セI@

+b=

°in Ll,

(5.1)

together with the essential boundary condition u

=u

on

ru

(5.2)

and the nonessential boundary condition t

= Kx

au auax nx + Ky ay ny = t

on

rt ,

(5.3)

where u is the field variable, b is a source/sink term, Kx and Ky are constants that define the physical behavior of the medium, nx and ny are the components of the unit normal outwardly directed to the boundary, u and t are prescribed values of the boundary conditions and r = ru + rt is the total boundary of the domain Ll. Equations (5.1) to (5.3) can be used to describe problems in several fields of engineering. The field variable u and the constants Kx and Ky have a particular meaning given by the actual physical problem they refer to. For the sake of simplicity, consider that these equations refer to a potential flow in which the field variable u is the velocity potential, the constants Kx and Ky are the conductivities of the medium and t is the velocity normal to the boundary.

Basic Definitions. Compatibility, equilibrium and constitutiveness are basic concepts that can be defined in the continuous model. At any point of the domain, the velocity a, with components

(5.4) satisfies the statical relationships, or equilibrium equations LT a+b=O,

(5.5)

where LT is the transposed form of the differential operator

(5.6)

5.2 Steady-State Models with Scalar Variable On the boundary t

= nT

r t , the

181

normal velocity t is given by

(5.7)

(J,

where n is the unit normal, outwardly directed to the boundary, with components

(5.8) At any point of the domain, the field variable u is related to the gradient, with components

(5.9) through the kinematical relationships, or compatibility equations E =

(5.10)

Lu,

where L is the vector differential operator (5.6). At any point of the domain, the velocity and the gradient satisfy the constitutive relationships, or constitutive equations (J

= DE,

(5.11)

where D is given by

D

= [Kx 0

o

Ky

1'

(5.12)

and Kx and Ky are time-independent constants that define the conductivity of the medium in the orthogonal directions x and y. In this case, the medium behaves linearly, since the ratio between the velocity components and the respective gradient components is constant.

Flow Fields. Any set of potential field u, gradient field E and velocity field (J which satisfy the constitutive relationship (5.11) is known as a flow field. Flow fields can be referred to either as compatible, equilibrated or exact fields, in accordance with their respective kinematical and statical properties. A flow field that satisfies the kinematical relationships E

= Lu in L1

(5.13)

and the boundary conditions

(5.14) is known as a kinematically admissible field, or compatible field. A flow field that satisfies the statical relationships

The Finite Element Method

182

LT a

+b= 0

in.::1

(5.15)

and the boundary conditions t

=t

on

rt ,

(5.16)

is known as a statically admissible field, or equilibrated field. The actual flow field that settles in the domain .::1 with boundary r is obviously unique and satisfies simultaneously compatibility and equilibrium. In this context, the actual flow field is known as an exact field.

Energy Theorems. Consider a statically admissible flow field represented by u, E and a. Consider also a kinematically admissible flow field represented by u*, E* and a*. These two flow fields are independent of each other. It can be shown that the general theorem of work, expressed by

i

bu* d.::1

+

1r

tu* dr =

i

aT E* d.::1,

(5.17)

holds for any two flow fields that satisfy respectively static and kinematic admissibility. Note that this theorem is not restricted to a particular mechanical behavior, since no constitutive relationships are invoked in its derivation. The theorem of virtual power is a particular case of the general theorem of work. A virtual potential field is defined as any potential function that satisfies the essential constraints of the potential field, given by the potential boundary condition defined on ru' When the actual exact flow field which is both statically and kinematically admissible is considered, an arbitrary variation of the potential field, denoted by 8u, can be any virtual potential field that is null on ru. Note that the potential boundary condition is imposed on ru and consequently the potential field cannot be varied. The field 8u and the field 8E, given by 8c = 8Lu = L8u,

(5.18)

satisfy kinematical admissibility. In this case, the general work theorem can be written as

r

J.1.

b8ud.::1 +

j

tbudr

rt

=

r

J.1.

aT 8Ed.::1

which is the expression of the theorem of virtual power. The internal potential energy of the flow field given by u, defined as U=

r セ@2

J.1.

aTE d.::1

=

J.1.

W d.::1,

(5.19)

E

and a is (5.20)

where

W=

セ。te@

2

'

is the density of the internal potential energy.

(5.21 )

5.2 Steady-State Models with Scalar Variable

183

The external potential energy of the flow is defined as P = -

i

b U dLl -

l

(5.22)

t u dr,

where band t are defined, respectively in (5.1) and (5.3). Consequently, the total potential energy of the flow is given by (5.23)

T=U+P.

The theorem of the minimum total potential energy states that, the actual flow field is the statically admissible field that minimizes the total potential energy of the flow, in the set of all kinematically admissible fields. This theorem is expressed by the conditions 8T = 8U + 8P =

i

(jT

&-dLl-

i

(5.24)

b8UdLl-l t8udr = 0

and (5.25) While (5.24) can be proved with the work theorem, (5.25) is true when the stability of the flow is assumed. 5.2.2 Weighted Residual Galerkin Approximation

Consider a statically admissible flow field. The differential equation

LT (ja

+b= 0

in Ll,

(5.26)

with boundary conditions (5.27) holds for the velocity field (ja. When an approximated solution (j equations (5.26) and (5.27) is considered, residues are generated as

RL'J.

=

セ@

(ja

of

LT (j + b

(5.28)

t.

(5.29)

and

Rr = t -

Consequently, the strong form of the weighted residual equation is written as

r (LT

JL'J.

(j

+

b)

W L'J. dLl +

r (t - t)

Jr,

W r dr = 0,

(5.30)

where W L'J. and W r are arbitrary weighting functions. When the domain term of this equation is integrated by parts, the weak form of the weighted residual equation is obtained as

The Finite Element Method

184

-L

(JT(LW d)dLl +

r b W d dLl + jr

Jd

1r n T (JW d dr +

(t - t) W r dr = o.

(5.31 )

t

Work Theorem. Consider now a kinematically admissible flow field represented by u* and c*. Then the differential equation c*

= Lu* in Ll

(5.32)

with boundary conditions

u* = u* on ru

(5.33)

holds for the potential field u* and the gradient field c*. When the arbitrary weighting functions are defined as Wd =u*

(5.34)

Wr = -u*,

(5.35)

and

and the boundary division r (5.31) becomes

-J

d

= ru + r t

is taken into account, the weak form

(JTc*dLl+j tu*dr+j tu*dr+ ru r t

r bU*dLl-jr

Jd

tU*dr+j tu*dr=O. t

rt

(5.36)

After simplification, this equation leads to

セ@

r bU*dLl+jセ@

tU*dr+j tU*dr=j (JTc*dLl

n

(5.37)

d

which can be written in the compact form

L

bu* dLl +

1r tu* dr = L(JT c* dLl.

(5.38)

This is the expression of the theorem of work.

Theorem of Virtual Power. Consider that the statically admissible field referred to in (5.26) and (5.27) is the actual exact flow field. Galerkin approximation uses a virtual variation of the potential field bu to define the arbitrary weighting functions as Wd =bu

(5.39)

Wr = -bu.

(5.40)

and

This choice for the weighting functions implies that

5.2 Steady-State Models with Scalar Variable

185

(5.41) where the potential boundary condition is imposed and, consequently the potential field cannot be varied. Thus, after considering (5.18), the weak form of the weighted residual equation (5.31) is written as

rbt5udLl- JrO"Tt5EdLl+ Jrr, tbudr- Jrr, (t-t)t5udr=O.

JLl

(5.42)

Ll

After simplification, this equation leads to

rbt5u dLl + Jr,rtt5u dr JLlrO"T t5E dLl

(5.43)

=

JLl

which is the expression of the theorem of virtual power. 5.2.3 Discrete Model

Consider the discretization of the flow domain in finite elements Lle. In each finite element define a local direct approximation of the potential field as (5.44) where Nand u e contain, respectively the element shape functions and the element nodal potentials. The assumed approximation of the potential implies that the gradient and the velocity are defined in terms of the nodal potentials, respectively as E

= L u = L N ue = B ue

(5.45)

0"

= DE = DBue ,

(5.46)

and

where (5.47)

B=LN.

Virtual variations of the potential and gradient are defined in terms of the virtual variation of nodal potentials t5u e, respectively as (5.48) and (5.49) When approximations (5.46) to (5.49) are introduced in the weighted residual equation (5.43), the following expression is obtained:

t5u eT

[ie

BTD B dLl u e -

(Le

NTb dLl

+

it'

1 o.

NTt dr) =

(5.50)

Since t5u e represents an arbitrary variation of the element nodal potentials, (5.50) leads to the system of equations

The Finite Element Method

186

(5.51) where u e is the vector of unknowns, K

e

=

r

BTDBdLl

(5.52)

} Ll"

is the matrix of the coefficients of the unknowns and

pe =

j

Ll"

NTbdLl

+

Jr:

NTldr

(5.53)

is the vector of independent terms. Admissibility Conditions. The choice of an appropriate type of finite element approximation depends on the admissibility conditions required by equations (5.51). The admissibility conditions are based on the order of the highest derivative present in the element matrix of the coefficients (5.52). Since matrix D contains only constants and matrix B contains only first-order derivatives in the operator L, it is required that shape functions N satisfy CO continuity and, in addition, constitute a complete set of first-degree polynomials. CO continuity of the shape functions implies the continuity of the approximation of the potential. Between each pair of linked elements the continuity is readily verified, along the common element boundary, once the reduced nodal continuity of the potential is enforced for all the finite elements that share each node. Inside the element, the continuity is automatically verified, since polynomials are continuously differentiable functions of class C=. First-degree completeness of the shape functions implies the use of complete linear polynomials in the element approximation of the potential. Such approximation allows the modelling of constant potentials, as well as constant gradients in the element. These admissibility conditions allow the use of finite elements with linear interpolation, as is the case of the linear triangular finite element.

5.3 Finite Element Mesh The first step in the application of the finite element method consists of dividing the domain into non-overlapping regions with finite dimensions and select some points on the boundary of each region. These regions are referred to as finite elements and the selected points as nodes or nodal points. To start with, it is necessary to decide about the type of finite elements that can be used in the mesh. In general, different types of finite elements can be put together in the same mesh, provided they satisfy the admissibility conditions. Consider, for the sake of simplicity, that all the finite elements of the mesh are of the same type.

5.3 Finite Element Mesh

187

5.3.1 Linear Triangular Isoparametric Element

The assessment of the admissibility conditions, required by equations (5.51), led to the choice of the linear triangular finite element. This element, represented in Fig. 5.1, is defined by a triangular region with three corner nodes

y

x

Figure 5.1. Linear triangular finite element

and constant unit thickness. A local numbering system of the element nodes from 1 to 3, starting arbitrarily at any node, is set up in the anticlockwise direction. The global nodal coordinates used to define the element geometry are given in the local nodal numbering system by Xl

Yl

xe

=

X2

(5.54)

Y2 X3 Y3

One degree of freedom, the potential function u, is assigned to each node of the element. Once the local numbering system of the element nodes is defined, a correspondence between local and global degrees of freedom can be established in the element. For the element represented in Fig. 5.1, the element nodal degrees of freedom are given by

(5.55)

The Finite Element Method

188

As far as the accuracy of the finite element solution is concerned, the topology of the finite element mesh that is the design of the actual element discretization, determines completely the level of the model approximation. Vsing the theorem of minimum total potential energy, the level of the solution accuracy of two finite element meshes can be compared, for a given flow problem. 5.3.2 Total Potential Energy Consider the actual flow field. The internal potential energy V, the external potential energy P and the total potential energy T are given, respectively by (5.20), (5.22) and (5.23). When the work theorem is considered for the actual flow field, the external potential energy is given by P

=-

i

aT Ed.1

= -2V

(5.56)

and, therefore, the total potential energy is given by

T=-V.

(5.57)

As a consequence of the theorem of minimum total potential energy, the total potential energy T' of an approximate solution is always higher than the total potential energy T of the exact solution, that is

T < T'.

(5.58)

This relationship implies, through (5.57),

-V < -V'

(5.59)

and, consequently,

V>V'

(5.60)

which means that the amount of the internal potential energy of the exact solution is higher than the amount of the internal potential energy of an approximate solution. The immediate consequence of this statement is that, the level of the solution accuracy of two finite element meshes of a given flow can be compared to each other through their respective internal potential energy: the higher the internal potential energy of a finite element mesh, the higher the level of accuracy of its solution. 5.3.3 Internal Potential Energy Density A good mesh design seeks a good distribution of the density of the internal potential energy. This means that a good finite element mesh leads to a distribution of the density of the internal potential energy that follows, as much as possible, the distribution corresponding to the exact solution.

5.3 Finite Element Mesh

189

5.3.4 Mesh Topology

Knowing a priori the density distribution of the internal potential energy in a given flow is not easy. It depends on the designer's knowledge about the performance of that particular flow. Bearing this fact in mind, the only guideline that can be suggested for a good finite element mesh design is to consider, as the starting point, an approximate distribution of lines of constant density of the internal potential energy in the domain of the flow. The layout of the mesh is then carried out through element discretization of the regions defined by groups of energy isolines, placing the element nodes on these isolines. Whenever elements with linear interpolation are used, the internal potential energy is constant in each element. Consequently, the elements should define steps in the gradient direction, perpendicular to the lines of constant energy density. This process of mesh design can be used to optimize an initial finite element mesh. Applying the process iteratively from one mesh, another mesh can be obtained with higher internal potential energy. The process can be repeated until a given level of accuracy is reached. Consider a triangular finite element mesh, as represented in Fig. 5.2. Number the elements and nodes and specify the element node connect iv-

Elements

x

Figure 5.2. Triangular finite element mesh

ity for each element by listing the nodes associated with the element, always in the same anti-clockwise direction, as represented in Table 5.1. The connectivity table of each finite element is used to convert the nodal variables from the local to the global nodal numbering system. For instance, the element number 4 of Table 5.1 has local and global degrees of freedom denoted by

The Finite Element Method

190

Table 5.1. Finite element connectivity Element

Local Node Number

Number

1

2

3

4

5

8

4

3

4

9

5

(5.61)

The use of the element connectivity table is essential in the assembly stage, in order to transform the local element equations into global ones.

5.4 Local Finite Element Equations Consider the isoparametric formulation of the linear triangular finite element. The element shape functions, defined in the natural coordinate system represented in Fig. 4.11, are given by (4.28) to (4.30). The same shape functions are used to interpolate both the element geometry (x, y) and the element field variable u, respectively as

[:] [:' ;, :' ;, :3 ;3]

x'

(5.62)

and

u=

[Nl N2 N3]

ue

=N

ue,

(5.63)

where N

=

[Nl N2 N3]

(5.64)

is the matrix of the shape functions. The gradient E and the velocity a, given respectively by (5.45) and (5.46), are defined in terms of the matrix B given by (5.47). When (5.64) is considered, the matrix B can be written as

B = [ Bl B2 B3] , where the terms Bi are given by

(5.65)

5.4 Local Finite Element Equations

Bi =

{セ}@ !!l:!..i

= J- 1

[&isi]. !!l:!..i

191

(5.66)

&t

&y

J represents the Jacobian of the coordinate transformation from local (s, t) to global (x, y) given by (4.62). Note that, since Ni are linear shape functions, the terms of the matrix B do not depend on the coordinates. This implies a constant gradient state in the finite element and justifies the name of constant-gradient triangular finite element, used for the linear triangular element. The differential area dL1 of global coordinates can be written in terms of the differential area of the local coordinates as

dL1

= dxdy = IJI dsdt = 2L1 e dsdt

(5.67)

where L1e is the area of the finite element, given by (4.63). The element matrix of the coefficients of the unknowns, given by (5.52), can now be written as (5.68) or simply as

(5.69)

where the generic term is given by K

')

= BTDB = aN, K aN) ,

)

ax

x

ax

+

aN, K aNj ay Y ay .

(5.70)

The element vector of the independent terms, given by (5.53), includes two terms that refer to, respectively sources/sinks and normal boundary velocities. An additional term Fe can be considered to include point sources/sinks, directly defined at the nodes of the element. Thus, the element vector of the independent terms can be written as

(5.71) A distributed source/sink, with a constant density of distribution b over the element leads to

(5.72)

The Finite Element Method

192

On the other hand, a distributed normal boundary velocity with, for instance, a constant density of distribution t over the element side 1-2 leads to

(5.73)

where

h2 is the length of the element side 1-2.

5.5 Global Finite Element Equations The finite element mesh is represented by the discretization of the domain .1 into finite elements .1 e (5.74) e

To obtain the global equilibrium of the finite element model, represented by global equations Ku=P,

(5.75)

where u contains all the unknowns of the model, it is necessary to assemble one by one the equations of each finite element, represented by (5.76) as (5.77) e

and (5.78) e

where Ke and pe are defined, respectively by (5.68) and (5.71). Note that, although (5.76) are referred to the system of local principal directions of conductivity of the medium given by (5.12), they can be directly assembled as (5.77) and (5.78) in the global reference system, because the unknowns u e are scalar quantities. Through this process of assembly, the weighted residual equation of the domain of the problem is obtained from the contribution of each finite element. The validity of this operation requires enough interelement continuity of the approximation function which is provided by the reduced continuity condition, imposed at each shared node of the finite element mesh. The assembly of the local element matrices into the corresponding global ones, represented by (5.77) and (5.78), is based on the element connectivity

5.6 Exact Boundary Conditions

193

table which defines a correspondence between the local and global nodal numbering systems

(5.79)

To perform the assembly operation, the local element matrices are first expanded with zero entries to the global numbering system. These global element matrices are then added up to the corresponding global ones. This process requires the initialization, with zero entries, of the global matrices K and P. The process of assembly of the local element equations into the corresponding global ones is always the same, regardless the type of problem, the type of finite element and the mesh topology used. The final matrix (5.77) is symmetric and banded. The half-band width is given by the maximum value of the largest difference defined among global node numbers in each finite element, plus the unit, multiplied by the number of degrees of freedom of a node. Consequently, the band width depends on the global numbering scheme adopted for the nodes of the finite element mesh. Commercial finite element programs take advantage of both the symmetry and the banded structure of the matrix so that only the terms within the half band of the matrix are considered when solving the system of equations.

5.6 Exact Boundary Conditions As a domain/boundary method, the finite element model satisfies exactly some of the boundary conditions which generate trivial residuals that are not included in the weighted residual equation. This is what happened with the essential boundary conditions (5.2) that were not included in the weighted residual equation (5.30) which led to the system of algebraic equations (5.75). Without introducing the exact boundary conditions (5.2), the system of equations (5.75) cannot be solved because the matrix of the coefficients (5.77) is singular. There are several ways of introducing the exact boundary conditions in the system of equations. The simplest method is carried out in two steps. In the first step, a known nodal value of the boundary condition Ui = U is multiplied by the respective column i of the matrix K and the result is added to the right hand side P. In the second step, the row i and column i of matrix K are filled in with zeros, while the diagonal term Kii is replaced by the unit. The corresponding row i of the right hand side Pi is replaced by the known nodal value. Note that this technique of introducing the exact boundary conditions in the system of equations keeps the symmetry of the matrix K.

194

The Finite Element Method

5.7 Solution of the System of Equations After introducing the exact boundary conditions, the system of algebraic equations can be solved. Among the variety of solution techniques available, direct methods are usually preferred over iterative ones which, nevertheless, seem to be the most appropriate methods to solve problems of re-analysis. The most common direct techniques of solution used in the finite element method are Gaussian elimination and Cholesky decomposition, see [9]. The finite element programs developed for this book solve the system of algebraic equations with Maple's procedure linsolve.

5.8 Computation of Derivatives Once the nodal variables u e of each finite element are known, the gradient c , given by (5.45), is computed in the global reference system as (5.80) where B is given by (5.65) and (5.66). A local reference system given by the principal directions (x', y/) of conductivity of the element is defined in Fig. 5.3. The gradient vector is then transformed, through the rotation of the

y

[X'y' ]

x

=

{cセs@

a Sina] [XJy

-sma cosa

Figure 5.3. Local (x', y') and global (x, y) reference directions

global to the local reference system, to obtain c' as

c' =

(5.81)

TT€,

where

T= [

cosO! sinO! - sinO! coso!

1 '

(5.82)

195

5.8 Computation of Derivatives

and a is the angle measured from the global x-direction to the local x'direction, as represented in Fig. 5.3. The local velocity a', given by (5.46), is computed as a'

= Dc',

(5.83)

where D is given by (5.12). The local velocity is finally transformed, through the rotation of the reference system from the local to the global directions, as

a = Ta'.

(5.84)

The density of the internal potential energy W, given by (5.21), is computed as 1 T (5.85) 2 The flux through the element sides that share a node can be computed and assigned to that node. To demonstrate the procedure, consider the element represented in Fig. 5.4. The constant velocity field is given by

W = -- a c.

-b1

-b3

bi = セ@ -Yk Ci= X(Xk

Figure 5.4. Flux through the element sides of node number 1

The positive flux that leaves the element through the side 1-2 is given by (5.86)

The Finite Element Method

196

The negative flux that enters the element through the side 3-1 is given by

[::: ] -b,;x [: ]

(5.87)

Thus, the flux through the element sides that share the node number 1 is given by (-b 3 )(]x b2 (]x (-b 3 - b2 )ax bwx - -2- = = -2- . (5.88) 2 2 This result can obviously be extended to the other nodes of the element, leading to the vector of nodal fluxes qXl

qe

=

=

qXl

bl 0

qX2

b2 0 1

b3 0

2

0

Cl

qY2

0

C2

QY3

0

C3

qX3 qYl

-

[:: ].

(5.89)

5.9 Finite Element Pre- and Post- Processing It is easy to make a mistake in the data of a finite element model. For this reason, a detailed examination of the model should be carried out to assess the correctness of data. Plots of the boundary conditions enable the confirmation of wether they are applied in the correct location or not. Plots of exploded views of the finite element mesh, where elements have slightly shrank, highlight any holes in the mesh where elements have been inadvertently omitted. The volume of output from a finite element model is usually large. Assessing the results from a long list of numbers is very difficult and, consequently, the graphical presentation of results is vital. Animation of graphic results is an invaluable tool for checking the correctness of the finite element model. A plot of the field variable is usually the first data to be examined for an instant feel of the finite element solution. Contour plots can be used for more detailed information. For the linear triangular element, a constant velocity field is obtained through the element. A nodal velocity is computed as the mean value of the velocities of elements that share the node. Examination of plots of element and nodal velocities, as well as plots of flux through the element sides, can be a simple way of locating errors. Finally, a detailed examination of the output from a finite element run should always be undertaken to further identify any error or inconsistency of

5.10 CgLfem: Package for Finite Element Analysis

197

the model. Fundamental checks that should be performed include the area of the model to confirm that the geometry is properly represented and the boundary flux to confirm that the solution satisfies equilibrium.

5.10 CgLfem: Package for Finite Element Analysis The package CgLfem, included in the companion CD-ROM, was specially developed for the finite element analysis of two-dimensional steady-state potential flow problems, with constant-gradient isoparametric triangular elements. Written in Maple, the package produces numeric and graphic results which are displayed through the procedures of the package Plotter. Thus, Plotter must be saved into Maple's repository before CgLfem is used. The finite element procedure can handle orthotropic media, point sources, distributed sources and normal boundary velocities. The use of all the features of the package will be explained through examples of application. 5.10.1 Data Preparation Data can be input through the procedure read_save_data which reads a file with a particular block structure. The data blocks, with the respective keyword on the top, can appear in any order. They are defined as follows: *control* - block with title and labels of the type of the analysis: point sources, element sources, boundary velocities. title Test of Potential Flow point sources element sources boundary velocities *materials* - block with material number, x-permeability, y-permeability, angle of the local x-direction of permeability. 1 2245 28845 *nodes* - block with node number, x-coordinate, y-coordinate.

20 1 302 411 *elements* - block with element number, nodel, node2, node3, material number.

The Finite Element Method

198

21521 3253 1

*constraints* - block with node number, potential. 310

60 *boundary velocities* - optional block with boundary of elements given by nodel, node2, normal velocity. 230 540

*point sources* - optional block with node number, discharge. 3 -50 5 -20

*element sources* - optional block with element, discharge. 230

*end* - terminator label. Alternatively, data can be given manually through the definition of the global variables tcase, control, nods, elems, maLprops, bdr _conds, b_velts, p_srcs and e_srcs, presented in the examples of application.

5.11 Example Consider the problem of a uniform flow in a rectangular domain, 4 m long and 2 m wide. Define uniformly distributed potentials on the two opposite sides perpendicular to the x-direction. Consider the hydraulic conductivity specified as Kx = Ky = 2 m/h, in the first half of the domain, and Kx = Ky = 8 m/h in the second half, with the angle of the local x'-direction, measured from the global x-direction, equal to 45 degrees. >

restart:

5.11 Example

> > >

> >

199

interface(verboseproc=3):printlevel:=3: with(Cgt_fem):with(G_cgt_fem): read_save_data(); y; "ExpS11 . txt" ; "*control*" "*materials*" "*nodes*" "*elements*" "*constraints*"

>

n;

The following procedures can be used to check the data of the model. > plot_problem_data();

Problem Data

2

2

Potential Velocity

The Finite Element Method

200

Finite Element Mesh 4

2

6

3

4

2

1

5

3

Node Number

Element Number

Running the finite element procedure with any string as the argument will cause printing intermediate results. > cgt_fem("intermediate results");

Initializing global matrices:

000000 000000 000000 000000

, [0, 0, 0, 0, 0, 0]

000000 000000 Assembling element [1, 4, 2, 1]

-1

10

000

1 -20

100

0

00

000

0

10 -1 00

0

00

000

0

00

000

Assembling element [1, 3, 4, 1]

5.11 Example

201

-2

1

1

000

1 -2

0

100

1

0-2

100

0

1

1 -200

0

0

0

000

0

0

0

000

Assembling element [3, 6, 4, 2]

-2

1

1

00

0

1 -2

0

10

0

1

0-6

50

0

0

1

5 -100

4

0

0

0

00

0

0

0

0

40-4

Assembling element [3, 5, 6, 2] :

-2

1

1

0

0

0

1 -2

0

1

0

0

1

0-10

5

4

0

0

1

5-10

0

4

0

0

4

0-8

4

0

0

0

4

4 -8

Forcing exact boundary conditions :

10

0

000

01

0

000

00-10

500

00

5-1000

00

0

010

00

0

001

[10, 10, -10, -10, 0, 0] Nodal potentials (n_potls) :

[10, 10, 2, 2, 0, 0] Boundary fluxes (bflux) : [node, [flux]]

The Finite Element Method

202

[1, [-8]], [2, [-8]], [5, [8]], [6, [8]] Flux equilibrium:

E fluxes

=

0

Element gradients (e_grads) : [grad x' grady]

[-4,0]' [-4,0]' [-1,0]' [-1,0] Element velocities (e_velts): [v x , vy]

[8, 0], [8, 0], [8, 0], [8, 0] Nodal velocities (n_ velts): [v x , vy] セL@

セL@

Nodal internal energy density (n_kined) : w

16, 16, 8, 12, 4, 4 Total internal energy :

80 Nodal fluxes (n_fluxes) : [qx, qy]

[-8, 0], [-8, 0], [0, 0], [0, 0], [8, 0], [8, 0] Cpu time: 1.382 seconds The results obtained are stored in the following global variables. > n_potls;e_grads;e_velts;n_velts;n_fluxes;n_kined; > total_internal_energy; [10, 10, 2, 2, 0, 0]

[[-4,0]' [-4,0], [-1,0]' [-1,0]] [[8, 0], [8, 0], [8, 0], [8, 0]] [[8, 0], [8, 0], [8, 0], [8, 0], [8, 0], [8, 0]] [[ -8, 0], [-8, 0], [0, 0], [0, 0], [8, 0], [8, 0]] [16, 16, 8, 12, 4, 4] 80 The distribution of the potential, along a set of arbitrarily-specified lines across the finite element mesh, can be displayed through the following procedure. > plot_line_potentials(); >

-.5,.5,4.5,.5;

>

>

"line A"; 1,0,0; .5,2.5, .5,-.5; "line B"; 0,1,0;

>

0,0,2. ,2;

>

> >

5.11 Example

> > > > > > > > > >

203

"line C"; 0,0,1; 4,0,0,2; "line D"; 1, .8,0; 2,0,2,2; "line E"·, 0,1,1; 0; "Testing Line Graphics" ;

Testing Line Graphics 10

8

6 4 2

0

line A

inc B

Ifne C

3

-

4

Animated views of three-dimensional nodal data can be displayed. The argument is a nodal vector that will be used as z-coordinate. The actual animation can be seen only on a computer. > animate_3D_rot(n_potls);

>

"Nodal Potentials";

204

The Finite Element Method

Nodal Potentials

> >

animate_3D_def(n_potls); "Nodal Potentials";

Nodal Potentials

>

>

plot_contour_lines(n_potls); "Nodal Potentials";

205

5.11 Example

Nodal Potentials

O. 1.1 2.2 3.3 4.

> >

セNHI@

6.7 7.8 8.9 10.

plot_contour_lines(n_potls,[1,2,3,4,5]); "Nodal Potentials";

Nodal Potentials

1.

>

2.

plot_velocities();

4.

s.

The Finite Element Method

206

Flow Velocity Field

Maximum Value: 8.

>

animate_velocities();

Animated Flow Velocities

The fluxes through the sides of all elements of the mesh can be displayed through the following procedure, with no arguments. > plot_fluxes();

5.11 Example

207

Nodal Flux Through Element Sides

Inflo\\ Max Value: 8. Outflow

[[ -8, 0], [-8, 0], [0, 0], [0, 0], [8, 0], [8,

Oll

To display the fluxes of a set of finite elements use the same procedure, with the list of the specified elements as argument. > plot_fluxes([1,2]);

Nodal Flux Through Element Sides

Inl1o\\

> >

Max Value: 8.

animate_3D_rot(n_kined); "Nodal Internal Energy Density";

Outflow

The Finite Element Method

208

Nodal Internal Energy Density

> >

plot_contour_lines(n_kined); "Nodal Internal Energy Density";

Nodal Internal Energy Density

4. 5.3 6.7 8.0 セN⦅@

. 12. 13. 15. 16.

5.12 Example This example shows the case of a flow with point and distributed sources. Consider the the same rectangular domain of the previous example and define

5.12 Example

209

uniformly distributed potentials on the two opposite sides perpendicular to the x direction. Consider also the same hydraulic conductivity parameters and specify a point discharge at a node, as well as a distributed discharge on one element. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cgt_fem) :with(G_cgt_fem): > read_save_data(); >

y;

>

"Exp512. txt" ; "*control *" "*materials*" "*nodes*" "*elements*" "*constraints*" "*element sources*" "*point sources*"

>

n',

Check the data of the problem. > plot_problem_data();plot_mesh();

Problem Data

Lセ@

______





______*-______ セ@

__ セ@

______

Potential Velocity

セ@

______ urn

______ セ@

セ@

セッN@

____--p O. l\J aterial

The Finite Element Method

210

Finite Element Mesh 3

2

1

セ@

セ@

6

9

12

15

5

8

II

14

4

7

10

13

Node Number

Element Number

Run the finite element procedure with no arguments to avoid printing intermediate results. >

cgt_femO;

Cpu time: 1.716 seconds Animated views of the nodal potentials. > animate_3D_rot(n_potls); > "Nodal Potentials";

Nodal Potentials

211

5.12 Example

> >

plot_contour_lines(n_potls)j "Nodal Potentials"j

Nodal Potentials

o. >

1.1 2.2 3.3

(,.7 7.8 8.9 10.

plot_velocities()j

Flow Velocity Field

Maximum Value: 9.6

>

plot_fluxes()j

212

The Finite Element Method

Nodal Flux Through Element Sides

Inflcm Max Value: 6.1 Outflow

>

>

animate_3D_rot(n_kined); "Nodal Internal Energy Density";

Nodal Internal Energy Density

>

>

plot_contour_lines(n_kined); "Nodal Internal Energy Density";

5.13 Example

213

Nodal Internal Energy Density

2.1 4.6 7.0 9.5 iセN@

. 17. 19. 22. 24.

5.13 Example This example considers the case of a uniform flow in a rectangular domain where normal boundary velocities are specified. The boundary conditions are specified as uniformly distributed potentials on one side and uniform velocities normal to the boundary on the opposite side. The hydraulic conductivity parameters are the same as for the previous example. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cgt_fem):with(G_cgt_fem): > read_save_data(); > >

y; IExp513.txt"; "*control *" "*materials*" "*nodes*" "*elements*" "*constraints*" "*boundary velocities*"

>

n;

Check data. plot_problem_data();

>

The Finite Element Method

214

Problem Data -8.

Potential Velocity

, nun: セi。エイゥャ@

Run the finite element procedure. >

cgt_femO;

Cpu time: Animated views of results. >

animate_3D_rot(n_potls);

>

"Nodal Potentials";

1 .670 seconds

Nodal Potentials

5.13 Example

>

215

"Nodal Potentials";

Nodal Potentials

>

plot_velocities();

Flow Velocity Field

>

plot_fluxes();

The Finite Element Method

216

Nodal Flux Through Element Sides

nllm

>

Max Value: 4. Outflow

plot_fluxes([1,2,3,4]);

Nodal Flux Through Element Sides

Inflnn

> >

Max Value: 4. Outflow

animate_3D_rot(n_kined); "Nodal Internal Energy Density";

5.14 Example

217

Nodal Internal Energy Density

>

>

plot_contour_lines(n_kined); "Nodal Internal Energy Density";

Nodal Internal Energy Density

.96 1.6 2.2 2.9

._

ᄋuセ@

5.5 6.1 6.8

5.14 Example This example shows Maple's symbolic capabilities. Consider a uniform flow in a rectangular domain, l m long and l/2 m wide. Define potentials as P

The Finite Element Method

218

on one side and 0 on the opposite side. Consider the hydraulic conductivity specified as Kx = Ky = K m/h, with the angle of the local x'-direction measured from the global x-direction equal to a degrees. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cgt_fem):with(G_cgt_fem): > read_save_data()j > >

Yj

"Exp514. txt II j

"*control*" "*materials*" "*nodes*" "*elements*" "*constraints*" > nj Print the variables used to read data. > tcasejcontroljnodsjelemsjmat_propsjbdr_condsjb_veltsj > p_srcsje_srcsj

" Uniform Flow in a Rectangular Domain - Symbolic Data"

[] 1 1 1 1 1 [[0, 0], [0, 2l], [2l, 0], [2l, 2l], [l, 0], [l, 2lll [[1, 4, 2, 1], [1, 3, 4, 1], [3, 6, 4, 1], [3, 5, 6, 1JJ

[[K,K,OJJ [[1, P], [2, P], [5, 0], [6, OJJ [] [J [J Run the finite element procedure. > cgt_fem(lIyes ll ) j

Initializing global matrices :

000000 000000 000000 000000 000000 000000

, [0, 0, 0, 0, 0, OJ

5.14 Example

219

Assembling element [1, 4, 2, 1] :

Mセk@

セk@ セk@

0

0

セk@

-KO

2 0

00 00

2

0 0

00

0

1 1 -KO--KOO

0

2

2

0

0 0

0

00

0

0 0

0

00

Assembling element [1, 3, 4, 1] : 1 1 -K -K -K

2

0 00

2

1 -K -K

1

0 -KOO 2 2 1 1 -K 0 -K -KOO 2 2 1 1 o -K-K-KOO 2 2

o o

0

0

0 00

0

0

0 00

Assembling element [3, 6, 4, 1] : 1 1 -K -K -K

2

1 -K -K 2

セk@

0

2

0 0

セk@

0 3 --K 2 K

2

0

0

2

0

セk@

2

K

0

0

0

0

0

0

-2KO

セk@

2

0 0 0 1 1 -K 0 --K 0 0 0 2 2 Assembling element [3, 5, 6, 1] :

The Finite Element Method

220

1 -K -K k@セ 2 2 1 -K -K 0 2

セk@

0

2

-K 2

0

0

セk@

K

セk@

0

0

0

0

2

-2K

1

0

0

K

セk@

-2K 0 0

2

0

2

セk@

2 1

-K -K 2 1

セk@

-K -K 2 2 Forcing exact boundary conditions : 0

0

0

10

0

0

00

01

0

0

00

K

00

00 -2K

r'

00

K

00

0

0

10

00

0

0

01

P,

MセpkL@

-2KOO

MセpkL@

0,

0]

Nodal potentials (n_potls) : 1

1

[P, P, "i P ' "iP' 0, 0] Boundary fluxes (bflux) : [node, [fluxll 1 1 1 [1, [-4 P K]], [2, [-4 P K]], [5, [4 P K]], [6, [4 P Kll 1

Flux equilibrium: E fluxes = 0 Element gradients (e_grads): [grad x ' grady] P

P

P

P

[-T' 0], [-T' 0], [-T' 0], [-T' 0] Element velocities (E-velts): [vx, vy]

KP

KP

KP

KP

[-l-' O], [-l-' 0], [-l-' 0], [-l-' 0] Nodal velocities (n_ velts): [vx, vy]

KP

KP

KP

KP

KP

KP

[-Z-, O], [-Z-, 0], [-Z-, 0], [-l-' 0], [-l-' 0], [-l-' 0]

5.14 Example

221

Nodal internal energy density (n_kined) : w 1 K p 2 1 K p 2 1 K p 2 1 K p 2 1 K p2 1 K p2 2 -[2-' 2 -l2-' 2 -[2-' 2 -l2-' 2 -[2-' 2 -l2Total internal energy :

セkーR@

4

Nodal fluxes (n_fluxes): [qx, qy] 1 1 1 1 [-4 p K, 0], [-4 p K, 0], [0,0], [0,0], [4 p K, 0], [4 p K, 0] Cpu time:

1 .047 seconds

Print the global variables with results. > n_potls;e_grads;e_velts;n_velts;n_fluxes;n_kined; > total_internal_energy; 1

1

[P, P, 2 P , 2P, 0, 0] P P P P [[-T' 0], [-T' 0], [-T' 0], [-T' 0]] KP KP KP KP [[-l-' O], [-l-' 0], [-l-' 0], [-l-' 0]] KP KP KP KP KP KP [[-l-' O], [-l-' 0], [-l-' 0], [-l-' 0], [-l-' 0], [-l-' 0]]

1 1 1 1 [[-4 P K, 0], [-4 P K, 0], [0, 0], [0, 0], [4 P K, 0], [4 P K, 0]] ャkセ@

ャkセ@

ャkセ@

ャkセ@

ャkセ@

ャkセ@

[2 -[2-' 2 -[2-' 2 -l2-' 2 -l2-' 2 -l2-' 2 -[2-] セkーR@

4

To display graphics, it is necessary to evaluate symbolic variables with appropriate numerical values. > nods:=eval(nods,l=4); > > >

nods := [[0, 0], [0, 2], [2, 0], [2, 2], [4, 0], [4, 2]] n_potls:=eval(n_potls,P=10); n_potls := [10, 10, 5, 5, 0, 0] animate_3D_rot(n_potls); "Nodal Potentials";

222

The Finite Element Method

Nodal Potentials

>

e_velts:=subs(K=2,P=10,1=4,e_velts)j

>

e_velts := [[5, 0], [5, 0], [5, 0], [5, n_fluxes:=subs(P=10,K=2,n_fluxes)j

>

n_fluxes := [[-5, 0], [-5, 0], [0, 0], [0, 0], [5, 0], [5, 0]] plot_fluxes()j

Oll

Nodal Flux Through Element Sides

Infl()\\ Max Value: 5. Outflow

6. Fluid Mechanics Applications

6.1 Introduction The application of the finite element method to fluid mechanics problems is not as advanced as it is in solid mechanics. The main reason seems to be that the finite difference method has proved very successful in solving fluid flow problems. Furthermore, the large investment of time and money made in the development of finite difference software naturally led to a reluctance to consider the application of other methods. This situation is gradually changing and the finite element method is now becoming a standard approximation tool used in the solution of fluid mechanics problems.

6.2 Continuous Models of Fluid Flow In many engineering problems of fluid flow the stress-strain rate relationships of the fluid can be considered linear and isotropic. In addition, the volumetric deformation of the fluid is generally small in comparison to the shearing deformations which allows quite reasonably to assume the incompressibility of the fluid with constant density. Finally, the flow motion can be considered laminar which means that the flow particles follow streamlines that do not intersect each other. 6.2.1 Incompressible Fluids

The equations that govern the laminar flow of incompressible fluids are three momentum equations

DVi 1 ap 2 -=---+bi+v'V Vi withi=l,2,3 Dt p aXi

(6.1)

and one continuity equation aVl aXl

+ aV2 + aV3 aX2

_

aX3 -

0 ,

(6.2)

where Vi and bi represent respectively the velocity and body force components, p is the pressure, p and v are, respectively the specific mass or density A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

Fluid Mechanics Applications

224

and kinematic viscosity. Equations (6.1) are the well known Navier-Stokes equations, where the total or material derivative is defined as

a

D Dt

=

at

a

+ Vi aXi .

For some engineering problems, additional simplifications can be assumed and the flow is governed by a simplified version of these equations.

6.2.2 Inviscid Fluids An inviscid or frictionless or non-viscous fluid has no viscosity which implies that the fluid can sustain no shear stresses. No real fluids are actually inviscid, but in many cases the pressure and body force effects predominate over the viscous effects and the flow can be analyzed quite satisfactorily by assuming the fluid to be inviscid everywhere except in the boundary layer. Incompressible inviscid fluids are known as perfect or ideal fluids. The equations that govern the two-dimensional flow of ideal fluids are two momentum equations DVi ____ 1 ap Dt P aXi

+ boo

o

with i

=

(6.3)

1,2

and one continuity equation aVl aXI

+

aV2 aX2

= o.

(6.4)

Equations (6.3) are the well known Euler equations that can be simplified further by introducing the concept of irrotational flow.

6.2.3 Irrotational Flows An ideal fluid that is not initially rotating can never rotate, since the fluid is inviscid and consequently cannot sustain any shear on its particles. This means that the flow motion of ideal fluids is irrotational. Mathematically, this condition can be expressed as

(6.5) 6.2.4 Steady-State Flows When the fluid motion is in steady state, the derivatives of the velocity with respect to time vanish. Hence, taking into account the irrotational-flow condition, the steady-state motion of ideal fluids is governed by two momentum equations 1 a 2 UXi

- -;:;-

(2 2) 1 ap VI + V2 = -- -;:;- + bi P UXi

.. z = 1,2

WIth

(6.6)

6.2 Continuous Models of Fluid Flow

225

and one continuity equation aVI aXI

+ aV2 = O.

(6.7)

aX2

6.2.5 Bernoulli's Energy Conservation

Assuming that gravity is the only body force exerted on the fluid, acting in the opposite direction of the coordinate x2-axis, the body force terms can be written as

(6.8) and

(6.9) where D = -g X2 is a potential function and 9 is the acceleration of gravity. In this case, the momentum equations (6.6) that are valid for steady irrotational motion of ideal fluids, can be expressed in terms of energy conservation as

[p

d - + 9 X2 P

2)] = d + -1 (2 VI + V2 2

[p- + X2 + -V2] 2g

'Y

= 0,

(6.10)

dXi. This where 'Y = P 9 is the specific weight, V 2 = vi + カセ@ and d = 。セゥ@ equation leads to a constant value of the total mechanical energy

P

V2

'Y

29

H O =-+X2+-, where セ@

is the potential energy of pressure,

(6.11) X2

is the potential energy of

elevation, セ@ + X2 is the total potential energy and セ[@ is the kinetic energy. This equation gives the same constant Ho for any particle throughout the flow domain of a steady irrotational motion of an ideal fluid. For the elevation head X2 = h, measured from any reference datum, Bernoulli's equation (6.11) is written as p

V2

'Y

2g

H=-+h+-, where the following terminology can be defined: P pressure head, 'Y h = elevation head,

V2 = velocity head and 2g H = total head.

-

(6.12)

Fluid Mechanics Applications

226

In engineering practice, the principle of constant energy, represented by Bernoulli's equation (6.11), does not hold since there is always a head loss. Given two elevation heads, hl and h2' defined at two points of a streamline in a real fluid flow, the difference between the corresponding total heads, Hl and H 2 , is the head loss which can be used to define the hydraulic gradient between the two points of the streamline. The irrotational motion of ideal fluids can be formulated in terms of the velocity potential and stream function. Results obtained with these formulations are a good approximation for some real fluid flows.

6.2.6 Velocity Potential This formulation considers the velocity components given by



(6.13)



(6.14)

Vl=aXl

and V2

=

aX 2'

where ¢ is the velocity potential. With these velocity components, the continuity equation (6.7) can be written as

'\l2¢

=0

in .1,

(6.15)

with boundary conditions (6.16) and



_

an = Vn

on

r 2,

(6.17)

where vn is the normal velocity, r l + r 2 = r is the total boundary of the domain .1 and n is the outward normal to the boundary.

6.2.7 Stream Function In this formulation, the velocity components defined as (6.18) and a'IjJ

V2=-aXl'

(6.19)

where 'IjJ is the stream function, satisfy identically the continuity equation (6.7). With these velocity components, the irrotationality condition (6.5) leads to the equation

6.3 Confined Flows

227

= 0 in Ll,

\l2'lj;

(6.20)

with boundary conditions 'lj;

= 1jj on r 1

(6.21)

and (6.22) where Vt is the tangential velocity, r 1 + r2 = r is the total boundary of the domain Ll and n is the outward normal to the boundary.

6.3 Confined Flows A typical confined flow problem is the case of the flow in a channel around an obstacle. In order to avoid turbulence behind the obstacle which can lead to cavitation problems, its shape is streamlined. The study of a laminar flow around the obstacle leads to laminar velocities which can give some guidance as to where turbulence will occur. Consider a cylindrical obstacle in a rectangular channel, where a uniform velocity is assumed across the channel both upstream and downstream, far away from the obstruction, as shown in Fig. 6.1. Taking into account the symmetry conditions, only a quarter of the

セNMサ@

t

v=o y Figure 6.1. Flow in a channel around an obstruction

problem needs to be studied, as shown in Fig. 6.1. Potential velocity and stream function formulations can be applied in the analysis of this problem. Fig. 6.2 shows the appropriate boundary conditions for each formulation. This problem was solved successfully by Martin [15] with a linear triangular finite element mesh.

Fluid Mechanics Applications

228

セ]o@

Potential Function

t

4>=0

ily

ilel> ilx

-=-v

セ@ 1jI=vt

Stream Function

t

1jI=VY

x

il1jl =0 ilX

1jI=0 1jI=0

セ@

x

Figure 6.2. Boundary conditions for the flow in a channel around an obstacle

6.4 Unconfined Flows Consider the case of unconfined flow from a gate, as represented in Fig. 6.3. This is a nonlinear problem, because the position of the streamline of the free

カ]セ@

1

Figure 6.3. Flow from a gate, where Q is the total flow

surface is unknown a priori. Fig. 6.4 shows the appropriate boundary conditions for this problem. An initial position of the free surface can be assumed intuitively to solve the problem as if it were a confined flow problem. Once the velocity field is known, Bernoulli's equation is used to correct iteratively the position of the free surface as h=H-

( V2 1

+ v 22 )

2g

,

(6.23)

6.5 Groundwater Flows

229

Figure 6.4. Boundary conditions for the flow from a gate, where Q is the total flow

where H is the total head, computed upstream, and the pressure head was neglected since it is the same everywhere on the free surface. This trial-anderror process is used until the desired accuracy is achieved.

6.5 Groundwater Flows In many practical problems it is acceptable to consider that groundwater flow occurs only in the saturated region of a porous soil. The pores in the soil are considered as a continuous medium where the ideal fluid flows. The velocity head can be neglected. Consequently, the total hydraulic head H defined in (6.12) is given by

H = !!. 'Y

+ y.

(6.24)

Hence, the total head is equal to the absolute elevation of the free surface H = y = h when null atmospheric pressure is assumed. 6.5.1 Darcy's Hypothesis

Continuous models used in the analysis of groundwater flow are based on Darcy's hypothesis which correlates linearly the seepage velocity of the flow to the gradient of the total hydraulic head. Assuming an orthotropic soil, Darcy's hypothesis can be written as _ -K aH

Vx -

x

ax

(6.25)

and Vy

=

aH

-Ky

By'

(6.26)

Fluid Mechanics Applications

230

where Kx and Ky represent the hydraulic conductivities, or permeability coefficients of the soil which have the same unit as velocity. The formulation of the velocity potential can be used, when the potential function ¢ is defined as the total hydraulic head ¢=H.

(6.27)

A stream function 'lj; can also be defined such that the velocity components are given by Vx

=-

a'lj;

ay

and

Vy

=

a'lj;

ox·

(6.28)

The formulation in terms of the velocity potential is usually adopted due to the physical meaning of the field variable expressed in (6.27). In this case, the equation that governs the steady state flow in groundwater is given by

a ( Kx aH) a ( Ky aH) ox ox + ay ay + Q = 0,

(6.29)

where the term Q represents a sink/source. The boundary conditions for this equation depend on the type of problem that is considered. In the general case of seepage flow, represented in Fig. 6.5, four different types of boundary

y

I

Figure 6.5. Seepage flow boundaries

conditions can be specified as follows: Impervious boundary - This boundary defines a streamline. Hence, the velocity normal to the boundary is null Kx

aH

ox

nx

+ Ky

aH ay ny = 0,

(6.30)

where nx and ny represent the components of the unit normal to the boundary.

6.5 Groundwater Flows

231

Reservoir boundary - The upstream and downstream boundaries of the porous domain can be considered as equipotential lines. Along these boundaries, the potential is constant and equal to the absolute elevation of the water surface

H=h.

(6.31)

Seepage surface - This is the boundary where the water seeps out of the soil into air. When null atmospheric pressure is considered, the flow potential is equal to the elevation of the boundary

H=y.

(6.32)

Free surface boundary - The boundary line of the free surface, also known as the phreatic surface, is the upper streamline of the porous domain. The holding conditions on this boundary are defined as one kinematical boundary condition Kx

aH

ax

nx

aH + Ky ay ny = 0

(6.33)

and one dynamical boundary condition

H=h.

(6.34)

The geometry of this boundary is not known a priori. 6.5.2 Dupuit's Hypothesis

In the case of flow in an almost horizontal underground aquifer, with small depth and head gradient, it is usual to consider the simplifying assumption of Dupuit. This approximation considers that the flow is horizontal. The seepage velocity and flow potential are therefore uniform along the aquifer depth. These conditions allow the integration of governing equations in the vertical direction. Consider a steady flow in the (x, y) plane. The model for confined flow between two impermeable layers is given by

axa ( Kx b ah) ax + aya ( Ky b ah) ay + Q = 0,

(6.35)

with boundary conditions

h=h

(6.36)

and bKx

ah ax nx + bKy ah ay ny = -vn,

(6.37)

where b is the aquifer thickness and h is the absolute elevation of the pressure surface, that is the flow hydraulic head, as represented in Fig. 6.6.

Fluid Mechanics Applications

232

-----1

Unconfined flow

h

M ______________セ@

セ@

______________lrセ・イョ」]、XオュKi@

Confinalflow

セ@ wLW⦅セ@

(y) __________

⦅Gセ@

ィセ@

セ@

___ _________//__ /' .__- - - ljZ,-,RR:::e""rer:..::en:::c:=..;ed==8::::lu=m__x.

Figure 6.6. Horizontal groundwater flow

In the case of an unconfined flow over an almost horizontal impermeable layer, the continuous model is given by (6.38) or

a ( Ky ah2) a ( Kx ah2) ax ax + ay ay + 2 Q = 0,

(6.39)

with boundary conditions h2

= h2

(6.40)

and (6.41)

where h is the elevation of the free surface, as represented in Fig. 6.6.

6.6 Example 6.6.1 Flow Under a Dam A concrete dam with a 60m wide base is built on a permeable ground layer with thickness equal to 80m. The water depth is equal to 20m upstream and 10m downstream. Extending halfway through the permeable soil, as represented in Fig. 6.7, a sheet pile diaphragm reduces the seepage. Considering the permeability coefficient of the soil equal to O.OOOlm/s compute, using the finite element method, the seepage discharge under the dam.

6.6 Example

L ________セ@

233

____セ@

20m

+++++++++++++++++++++++++ ++++++i-+++++++++1"++++++++

+++++++++++++++++++++++++ +++++++++++++++++++++++++

+++++++++++++++++++++++++ +++++++++++++++++++++++++

,

60m

I

150m

150m

Figure 6.7. Flow under a dam

6.6.2 Problem's Solution

In order to obtain a solution for this problem, consider the following recommendations: 1. Although the flow field extends an infinite distance, both upstream and

2.

3. 4. 5.

downstream, assume that it is bounded by artificial boundaries defined in the vertical direction at a distance of the dam taken arbitrarily equal to 120m both upstream and downstream. Along permeable boundaries, the boundary condition is defined by the local elevation of the free surface as 20m on the upstream boundaries and 10m on the downstream ones. Along impermeable boundaries, the boundary condition is defined by null normal velocity. Discretize the flow domain with a finite element mesh with no more than 100 constant gradient triangular elements. Check data and use the routines of the package CgtJ'em to solve the problem. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cgt_fem):with(G_cgt_fem):

Checking Data. After reading the data of the problem, a few checks should be performed. > read_save_data(); >

y;

>

"Exp660.txt"; "*control*"

Fluid Mechanics Applications

234

"*materials*" "*nodes*" "*elements*" "*constraints*" > n·, To print the variables used to store the data, remove the comment character of the next line. > # tcase;control;nods;elems;mat_props;bdr_conds; > plot_mesh 0 ;

Node Number

Element Number

Zoom in to check elements number 84 and 85. > plot_mesh([-90,10],[-10,80]);

6.6 Example

Correct element number 85 and check again. > elems[85]; >

[56, 50, 55, 1] elems[85] [2]:=51:elems[85];

>

[56, 51, 55, 1] plot_mesh([-90,10],[-10,80]);

235

Fluid Mechanics Applications

236

Potential Velocity

:\Iaterial

Save checked data. > read_save_data(); > n; > y; > "Exp660 Checked.txt"; Processing Data. After checking carefully the data, the model can be processed. Taking into account the fact that the program is interpreted and not compiled, the CPU time obtained on a 360Mhz processor is very good for a model with 65 nodes and 100 finite elements. Note that the program is not optimized; although banded, the global matrix of the system of equations is implemented as a sparse matrix. > read_save_data(); >

y;

>

"Exp660 Checked.txt"; "*control *" "*materials*" "*nodes*" "*elements*" "*constraints*"

>

n; cgCfemO;

>

Cpu time: 10.594 seconds animate_3D_rot(n_potls);

>

6.6 Example >

237

"Hydraulic Head";

Hydraulic Head

> >

plot_contour_lines(n_potls); "Hydraulic Head";

Hydraulic Head

10. 11. 12. 13.

>

). 17. IX. 19. 20.

plot_velocities(5, [-70,-2], [70,82]);

Fluid Mechanics Applications

238

Flow Velocity Field

>

plot_fluxes();

Nodal Flux Through Element Sides

Inf1m' Max Value: .13e-3 Outflow

Plot fluxes across the elements located upstream the diaphragm. > plot_fluxes([seq(i,i=51 .. 100)]);

6.6 Example

239

Nodal Flux Through Element Sides

Inflow Max Value: .93e-4 Outflow

Nodes 30, 32, 33, 34 and 35 are under the diaphragm. Print the flux components assigned to these nodes. > n_th:=[30,32,33,34,35]: > seq(n_fluxes[i] ,i=n_th); [.00009047678320, .00007919071100], [.00008570828700, -.140082500010- 7 ], [.00009279248990, .371524287510- 5 ], [.00008992514625, .258860785010- 5 ], [.00004412693382, .718995750010- 6 ] The seepage discharge under the dam can be computed by integrating the velocities, or adding the fluxes, assigned to the nodes under the sheet-pile. > Qx:=add(%[i] [1] ,i=1. .5) ;Qy:=add(%%[i] [2] ,i=1. .5);

Qx := .0004030296402 Qy := .00008619954922 >

Q:=Qx+Qy;

Q := .0004892291894 Convert seconds to days. > Q:=Q*86400; Q := 42.26940196 The seepage discharge under the dam is Q = 42.26940196 cubic meters, per day, per meter. This value can be checked against the value obtained through the numerical integration, by the trapezoidal rule, of the velocity profile along the same section, given bellow. Note that the program computes nodal velocities through the mean-value of the velocities of the elements that share each node.

Fluid Mechanics Applications

240

Obtain the vertical coordinate of each node of the section. > s_th:=[seq(nods[i] [2],i=n_th)]; s_th := [40, 35, 25, 13, 0] Compute and scale the absolute value of the velocity at each node of the section. > v_th:=[seq(sqrt(n_velts[i] [1]-2+ > n_velts[i] [2]-2)*10-6,i=n_th)]; v_th:= [11.73379873,11.40781770,9.414382467, 7.596319317, 6.986740010] Define pairs of values to be plotted. > vth:=[seq([s_th[i],v_th[i]] ,i=1 .. 5)]: > v1:=plots[pointplot] (vth,style=line,color=blue, > thickness=3): > v2:=plots[pointplot] (vth,color=blue,symbol=box, > symbolsize=15): > plots [display] (v1,v2,axes=BOXED, > title="Velocities Under the Sheet-Pile *10**6");

Velocities Under the Sheet-Pile *10**6 11 10

9 8

o

10

20

30

40

6.7 Example 6.7.1 Flow in an Unconfined Aquifer A building is to be founded on a ground with permeable soil which lays on a practically horizontal base of impermeable soil. Surrounding the foundation site, the water depth, equal to 20m, was measured at 4 observation wells represented by 81, 82, 83 and 84, see Fig. 6.8. Within the base of the building,

6.7 Example

241

Figure 6.8. Groundwater flow in the foundation site of a building

represented by the rectangle ABeD, the excavation works in the foundation require the water table to be lowered from 20m to 12m, as represented in Fig. 6.8. This is to be achieved by means of pumping out simultaneously from 4 wells, positioned at the corners of the excavation site. Assuming that the local permeability coefficient of the soil is equal to 1.2m/month, that is 0.04m/ day, compute the discharge to be pumped out from each well. 6.7.2 Problem's Solution

In order to obtain a solution for this problem, implement the following recommendations:

1. Since the flow field is symmetric, consider only a quarter of the flow domain, the square OLMN. 2. The flow is unconfined over an horizontal impermeable layer. Therefore, the field variable of the continuous model is h 2 and the sink term is equal to 2 Q. The water-table elevation is h 2 and Q represents the strength of a point sink, as presented in (6.39). 3. Along symmetry boundaries, the boundary condition (6.41) is applied with null normal velocity. 4. Along remaining boundaries, the boundary condition is defined by (6.40) in terms of the square of the water-table elevation h 2 = 400 m 2 .

Fluid Mechanics Applications

242

5. Discretize the flow domain with a finite element mesh with no more than 70 linear triangular elements. 6. Through successive trials, find the highest value of the point sink for which the water table does not exceed h2 = 144 m 2 in the excavation site. 7. Finally, use a symbolic sink Q, to solve the problem directly. Checking Data. A simple finite element mesh with 41 nodes and 66 triangular elements was prepared to solve this problem. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cgt_fem):with(G_cgt_fem): > read_save_data(); > >

y; II

Exp670 . txt

II ;

"*control*" "*materials*" "*nodes*" "*elements*" "*constraints*" "*point sources*" >

n;

Node Number

>

Element Number

plot_mesh([25,12],[80,50]);

6.7 Example

243

The value assumed for the sink term, defined at node 22, is 2 Q This value corresponds to a discharge of Q = 7 m 3 /day. > plot_problem_data();

セャゥM

_ _ _ _ _ _ _ _ _ __ _セ@

_ __ __ _ _ __ _セ

セ セoN@

A'E'---------------::---- ------:;i!>f"OO.



Potential Velocity

Save checked data. > read_save_data(); >

n;

>

y;

Sou ,'Ct'

Material

ッN@

=

14.

244 >

Fluid Mechanics Applications

"Exp670 Checked.txt";

Processing Data. After checking the data, the model can be processed. > cgt_femO; >

>

Cpu time: 7.803 seconds plot_contour_lines(n_potls); "Water Table";

Water Table

-9.4 36. 82.. I3e3

> >

.U_ 26e.1He:llSe3tOe3

plot_contour_lines (n_potls, [144,170,200,250,300,350,40 0]); "Water Table: Isolines Above the Level 144";

ater Table: Isolines Above the Level 144

.14e3 .17e3 .20e3

NRセ、@

'. 0

.35e3 .40e3

6.7 Example

245

Check the boundaries of the excavation site. > plot_line_potentials(); > 0,0,200,0; > "y=o" ; > 0,0,1; > 0,30,200,30; > "y=30" ; > 0,1,0; > 0,0,0,200; > "x=O" ; > 1,0,0; > 50,0,50,200; > "x=50" ; > 1,0,1; > 0; > "Water-Table Profiles" ;

Water-Table Profiles 400 300

200

o y=O

y=30

100

x=O

150

x=50

200

The conclusion is that the highest level of the water table in the excavation site occurs at node 11. The value obtained satisfies the conditions posed by the problem. > n_potls[11],n_potls[2],n_potls[7]; 130.1425392, 106.4695005, 118.4534054

Fluid Mechanics Applications

246

The value assumed for the sink term, 2 Q = 14, corresponds to a discharge of Q = 7 m 3/day to be pumped out from each well. The process used to find out this value, successive trials, is rather time consuming. Alternatively, symbolic computation can be used to solve the problem directly as follows. Consider a sink, with symbolic strength Q, and redefine the contents of the data variable p-..Srcs. > p_srcs; >

[[22, 14]] p_srcs[1] [2] :=Q: p_srcs;

[[22, QJ] Now run the finite element procedure to process the data. > cgt_femO; Cpu time: 12.744 seconds Print the highest level of the water table in the excavation site which corresponds to node 11. The value of the elevation is defined in terms of the symbolic value of the sink. > n_potls [11] ;

399.9999984 - 19.27553279 Q At this node assume the maximum allowed level that is 144 and solve the equation for Q. > Q:=solve(%=144); Q := 13.28108547 Hence, the discharge to be pumped out from each well is Q

= 13.28108547 = 6.64054m3 /day. 2

> >

plot_contour_lines (n_potls, [144,170,200,250,300,350,40 0]); "Water Table: Isolines Above the Level 144";

6.7 Example

247

ater Table: Isolines Above the Level 144

.14e3 .17e3 .20e3 JSc3.3.

>

.3Se3 .40e3

plot_fluxes();

Nodal Flux Through Element Sides

InflO\\

>

Max Value: 6.7 Outflow

plot_velocities(2.5);

248

Fluid Mechanics Applications

Flow Velocity Field

Maximum Value: .29

>

plot_velocities(6.5,[25,5],[75,55]);

Flow Velocity Field

The layout of the finite element mesh closely follows the distribution of the internal energy density in the regions of high gradient. > plot_contour_linesCn_kined); > "Nodal Internal-Energy Density";

6.7 Example

249

Nodal Internal-Energy Density

.2ge-225 .50 .75

U 13 1.5 l. 7 2.0 2.2

> >

plot_contour_lines(n_kined,

>

"Nodal Internal-Energy Density";

[ . 1 , .3, .6, .9,1. 2, 1. 6 ,1. 8,2. 1,2.5] , [20,8] , [80,52]) ;

Nodal Internal-Energy Density

7. Solid Mechanics Applications

7.1 Introduction Mathematical modelling in Solid Mechanics uses the theory of elasticity as the fundamental generating model which is thus considered a mathematicallyexact model. Based on this exact model and considering simplifying assumptions, asymptotic models, still continuous, can be generated. These continuous asymptotic models are eventually discretized in order to obtain numerical approximate solutions.

7.2 Continuous Models The modern theory of structures considers three basic classes of models defined with the following properties : • Continuous three-dimensional fundamental model - It can be used to simulate the mechanical behavior of structures with an arbitrary geometry. This mathematically exact model is the generator of all the other continuous models. • Continuous asymptotic models - They can be used to simulate the mechanical behavior of structures with geometries of particular dimensions. These models are generated by introducing simplifying assumptions in the fundamental three-dimensional continuous model. Consequently, they are considered as asymptotic models of the generating one. • Discrete models - They are obtained directly from the fundamental generating model, as well as from each of the different asymptotic models. Asymptotic models refer to structural domains with smaller number of dimensions than the three-dimensional exact model. Hence, regarding the respective dimensionality, three basic classes of models can be defined in the formulation of continuous structural models, as follows: • Three-dimensional model - This is the model of the theory of elasticity, generator of all the other continuous models. It can be used in the analysis of structural elements in which all the dimensions are of the same order. Plane strain and axially-symmetric elasticity are particularizations of the three-dimensional model. A. Portela et al., Finite Elements Using Maple © Springer-Verlag Berlin Heidelberg 2002

252

Solid Mechanics Applications

• Two-dimensional model - This is the model of the theory of shells. It can be used in the analysis of structural elements in which one of the dimensions, the thickness, is much smaller than the others. The material of the structure is confined to the neighbourhood of a surface, the middle surface of the shell which bisects its thickness everywhere. Whenever this middle surface is plane, the theory of shells leads to the theory of plates and plane stress theory which are particularizations of the two-dimensional model. • One-dimensional model - This is the model of the theory of bars. It can be used in the analysis of structural elements in which two of the dimensions, the dimensions of the cross section, are much smaller than the third one. The material of the structure is confined to the neighbourhood of a line, the axis of the bar. Trusses, frames and grillages are particularizations of the one-dimensional model. One and two-dimensional asymptotic models consider fields of generalized variables. Formulated in terms of generalized stresses, strains and displacements, the asymptotic models define, like the exact model, three groups of equations: • Equilibrium equations - They are used to define the static admissibility of elastic fields. • Strain-displacement equations - Sometimes known as compatibility equations. They are used to define the kinematical admissibility of elastic fields. • Stress-strain or constitutive equations - They are used to define the mechanical behavior of the structural material.

7.3 Fundamental Continuous Model: Elasticity Theory The aim of the theory of elasticity is to determine the state of stress and strain in a structure under the action of a given load. To reach this aim, the theory of elasticity considers the fundamental assumption: at any point, stresses and strains are related to each other through a physical law which is characteristic of the material of the structure and is time independent. Based on this hypothesis, the theory of elasticity aims the solution of a fundamental problem which consists in the determination of the state of stress and strain throughout an isotropic and homogeneous structure. To solve this problem, the theory of elasticity defines a system of differential equations together with boundary conditions. In the most general case, a set of constrained displacements is defined on the boundary ru and a set of loads given by an external system of distributed surface and body forces is defined respectively on the boundary rt and in the domain Ll of the structure. The total boundary of the domain is r = rt uru .

7.3 Fundamental Continuous Model: Elasticity Theory

253

7.3.1 Strain-Displacement Equations At any point, the displacement vector

(7.1)

is related to the strain vector Ell

E22 E=

E33

(7.2)

2E23 2E31

2 E12

through the kinematic relationships

(7.3)

E=Lu,

where L is a matrix differential operator. Under the assumption of geometrical linearity, it is defined as

L=

a aXl

0

0

0

a aX2

0

a 0 0 aX3 a a 0 aX3 aX2 a 0 a aX3 aXl a a aX2 aX! 0

(7.4)

7.3.2 Equilibrium Equations At any point, the stress vector all

a22 a33 a= a23 a31 a12

(7.5)

Solid Mechanics Applications

254

and the body-force vector

(7.6)

are related through the static relationships LT a

+ b = 0,

(7.7)

where LT is the transposed matrix of the differential operator L.

7.3.3 Stress-Strain Equations The stress and strain vectors satisfy the constitutive relationships

(7.8)

a=Dc:,

where D is a matrix with the elastic constants used to describe the macroscopic behavior of the material. Under the assumption of physical linearity, these relationships define Hooke's law for which the matrix of elastic constants is given by

D=

I-v

v

v

0

0

0

v

I-v

v

0

0

0

v

v

I-v

0

0

0

0

0

1-2// -2-

0

0

1-2// -2-

E

(l+v)(I-2v)

0

0

0

1-2// -2-

0

0

0

0

0

0

0

0

(7.9)

where E is Young's modulus and v is Poisson's coefficient.

7.3.4 Boundary Conditions Strain-displacement, equilibrium and stress-strain relationships define a system of 15 differential equations with 15 unknowns which are 3 displacement components, 6 strain components and 6 stress components. To find a solution of these equations, boundary conditions are defined as u = U on the kinematic boundary

ru

(7.10)

and t

=t

on the static boundary

The traction vector

rt.

(7.11)

7.3 Fundamental Continuous Model: Elasticity Theory

255

(7.12)

is related with the stress vector through the relationship t

= nu,

(7.13)

where n is a matrix that contains the components of the unit normal, outwardly directed to the boundary

n

=

r:1:2 セ@ :3 :3 Zセ@ l o

0 n3 n2 n1 0

(7.14)

J

7.3.5 Elastic Fields Any set of displacements u, strains c and stresses u, defined throughout a structure which satisfy the constitutive relationships (7.8), is known as an elastic field. Elastic fields can be referred to either as kinematically admissible, statically admissible or exact, in accordance with their geometrical and statical properties.

Kinematically Admissible Field. An elastic field that satisfies the relationships (7.3) in Ll and satisfies the boundary conditions (7.10) on ru is known as a kinematically admissible or compatible field. Note that, for a given displacement field there is a unique strain field that satisfies the kinematical relationships, since the system of equations is fully determined with 6 equations and 6 unknowns. Statically-Admissible Field. An elastic field that satisfies the relationships (7.7) in Ll and satisfies the boundary conditions (7.11) on r t is known as a statically-admissible or equilibrated field. Note that, for a given system of external forces there is an infinite number of stress fields that satisfy the statical relationships, since the system of equations is undetermined with 3 equations and 6 unknowns. Exact Field. The elastic field that settles in a structure with a set of constrained displacements and loaded by a system of external forces is unique in accordance with Kirchoff's theorem. Such elastic field is simultaneously kinematically and statically admissible. Under these conditions, the elastic field is known as the exact field.

Solid Mechanics Applications

256

7.3.6 The Work Theorem Consider a statically-admissible elastic field denoted by u, E: and 0'. Consider also a kinematically admissible elastic field denoted by u*, E:* and 0'*. In the most general case, these two fields are independent of each other. Under the assumption of geometrical linearity, the general theorem of work can be expressed as

i

bT

u* dLl +

lr

t T u* dr

=

i

O'T E:*

dLl.

(7.15)

It states that the total work vanishes for any statically-admissible elastic field together with any kinematically admissible elastic field, both defined in a structure Ll with boundary r. It can be shown that this theorem is not restricted to a particular mechanical behavior, since no constitutive relationships are invoked in its derivation. 7.3.7 Theorem of Virtual Displacements The theorem of virtual displacements is a particularization of the general work theorem. A virtual displacement is any displacement compatible with the constraints of the structure. Consequently, a virtual displacement is defined by a kinematically admissible field. When the actual exact field is considered, a virtual variation of the displacement field, denoted by 8u, is any one that is null on r u , where displacements are constrained by the boundary conditions and thus cannot be varied. In this case, the work theorem is written as

r

iLl

b T 8udLl

+

jT, t6udr = iLlr

O'T 8E:dLl

(7.16)

which is the expression of the theorem of virtual displacements. 7.3.8 Theorem of Total Potential Energy Consider the exact elastic field of a given structure, with a set of constrained displacements and loaded by a system of external forces. The strain energy, or internal potential energy, also known as the elastic potential energy, is defined as U

=

rW dLl = iLlr セ@

iLl

O'T E:

2

dLl,

(7.17)

where W is the strain energy density. The external potential energy, or potential energy of the external forces, is defined as p = -

i

b T UdLl-lr t T udr.

(7.18)

7.4 Finite Element Model

257

Finally, the total potential energy T, is defined by

(7.19)

T=U+P.

When the theorem of work is applied, the potential energy of the external forces becomes

(7.20) Therefore, the total potential energy of the structure can be defined solely in terms of the total strain energy as

T=-U.

(7.21 )

The theorem of total potential energy states that, the actual elastic field that settles in the structure is the statically-admissible field that minimizes the total potential energy on the set of all kinematically admissible fields. Such unique field is, obviously the exact elastic field. This theorem is expressed mathematically by the minimum conditions

oT = oU + oP =

iaT ibT 8cd.1-

OUd.1-lre oudT = 0

(7.22)

and

(7.23) Condition (7.22) is verified by the theorem of virtual displacements expressed by (7.16) and condition (7.23) is implicitly true once the stability of the material is assumed. When (7.21) is considered, the minimum value of the total potential energy of the structure can be replaced by the maximum value of the strain energy.

7.4 Finite Element Model The formulation of the finite element model is presented through the method of weighted residuals. 7.4.1 Weighted Residual Equation

Consider a statically-admissible stress field ao. Hence, the system of differential equations

LT ao

+b = 0

in .1,

(7.24)

with boundary conditions t

= n ao = t on Tt,

(7.25)

Solid Mechanics Applications

258

holds. When an approximate solution a defined as RL1

= LT a + b

=1=

セ@

ao is considered, residues can be

(7.26)

0,

and

Rr = t - t

=1=

o.

(7.27)

The strong form of the weighted residual equation is written as

r (LT a+b{WL1dLl+ Jrr, (t-t)TWrdr=O,

JL1

(7.28)

where W L1 and W r are arbitrary weighting functions. When the domain term is integrated by parts, the following weak form is obtained

i

b TW L1 dLl-

r (t - t)

Jr,

T

i

a T LWL1dLl+

1r (nafWL1dr+

W r dr = O.

(7.29)

7.4.2 Theorem of Work Consider now a kinematically admissible displacement field u*. Hence, the system of differential equations s*=Lu* inLl,

(7.30)

with boundary conditions (7.31 ) holds. When the arbitrary weighting functions are defined as W L1

= u*

(7.32)

Wr

= -u*

(7.33)

and

and the boundary division r = ru residual equation (7.29) becomes

u r t is taken into account, the weighted

r bT u* dLl - jL1 aT s* dLl + Jrur eu: dr + Jr,r t T u* dr -

JL1

r e u* dr + Jr,r t

Jr ,

T

u* dr = O.

(7.34)

After simplification, this equation leads to

r bT u* dLl + Jrur tTu: dr + Jr,r t u* dr = j

JL1

L1

aT s* dLl

(7.35)

7.4 Finite Element Model

259

which can be written in a compact form as

L

b T u* dLl

+

l

t T u* dr

=

L

iJT E* dLl.

(7.36)

This equation is the expression of the work theorem.

7.4.3 Theorem of Virtual Displacements Consider the actual elastic field of the structure that is simultaneously statically and kinematically admissible. Assuming Galerkin's approximation, the arbitrary weighting functions are defined by a virtual displacement ou, as wセ]oオ@

(7.37)

Wr = -Ou.

(7.38)

and This choice for the weighting functions implies that

=0

Ou

on

ru ,

(7.39)

where displacements are prescribed through the boundary conditions and consequently cannot be varied. Thus, after considering that Lou

= 0 Lu = 8c,

(7.40)

the weak form of the weighted residual equation (7.29) is written as

jセ@

f

f Jr,

bTOUdLl-! iJTOEdLl

セ@

(t -

+ f

Jr,

tToudr-

t{ oudT = O.

(7.41)

After simplification, this equation leads to

jセ@

f

b T oudLl

+ f t T oudr = f

Jr,

jセ@

iJT 8cdLl

(7.42)

which is the expression of the theorem of virtual displacements.

7.4.4 Discretization Consider the discretization of the structural domain in finite elements Lle, represented by (7.43) e

which leads to the discretization of the structural boundary in finite elements r e represented by (7.44) e

Solid Mechanics Applications

260

Element Equations. In each finite element Lle define a local direct approximation as

u

= Nu e ,

(7.45)

where u e denotes the element degrees of freedom which are the nodal displacements, and N denotes the element shape functions assigned to the degrees of freedom of the element. The assumed displacement approximation implies that the consequent approximation of strains and stresses is defined also in terms of the nodal displacements, respectively as E:

= L u = L N ue = B ue

(7.46)

and (7.47) Virtual displacements and virtual strains are defined in terms of the nodal virtual displacements interface(verboseproc=3):printlevel:=3: > with(Cst_fem):with(G_cst_fem): > read_save_data(); >

y;

>

"Exp796. txt II ; "*elements*" "*nodes*" "*materials*" "*forces*" "*constraints*" "*control*"

>

n',

Print the finite element data. > tcase;plane_case;control;nods;mat_props;elems;forces; > bdr _conds ; " Plate Under Uniaxial Traction" "plane stress" ["point forces"] [[1, 1], [0, 1], [1, 0], [0, 0]] [[.210 109 , .28, -77., .01]] [[1,2,4, 1], [4,3, 1, 1]]

276

Solid Mechanics Applications

[[1, 0, 10], [2, 0, lOll [[4, x, 0], [4, y, 0], [3, 90, 0], [2, 0, 0ll Check finite element data. >

plot_mesh 0

;

Finite Element Mesh 2

2

4

3

Node Number

Element Number

Problem Data

Load

onstraint

l\Iutl'rial

After checking the data, run the finite element procedure. >

cst_femO;

7.9 Two-Dimensional Equilibrium States

277

Cpu time: 1 .970 seconds The results obtained are stored in the following variables: disp lux, u y] - nodal displacements e_sigma [[ax, ay, axy ], [aJ, alI, angle], strain energy] - element stresses n_sigma [aJ, alI, angle, strain energy density] - nodal stresses reacts [node, direction, [reaction]] - reactions totaLstrain_energy - total strain energy > disp;e_sigma;n_sigma;reacts;total_strain_energy;

[[-.266666666610- 5 , .952380952410- 5 ], [0., .952380952310- 5 ], [-.266666666610- 5 , 0.]'

[0, 0]] [[[.100000000010- 6 , 1999.999998,0.]' [1999.999999, .300000000010- 6 , 90.00000000], .00004761904755], [[.200000000010- 6 , 1999.999999, 0.], [1999.999999, .300000000010- 6 , 90.00000000], .00004761904755]] [[1999.999998, .200000000010- 6 , 90.00000000, .009523809515], [1999.999998, 0., 90.00000000, .009523809513]' [1999.999999, .200000000010- 6 , 90.00000000, .009523809513], [1999.999998, .200000000010- 6 , 90.00000000, .009523809515]] [[4, x, [-.100000000010- 8 ]], [4, y, [-9.999999996]]'

>

[3,90, [0., -9.999999996]]' [2,0, [-.200000000010- 8 ,0.]]] .00009523809510 plot_displacements();

Solid Mechanics Applications

278

Displacement Field

Maximum Value: .99e-5

To zoom in, give a scaling parameter and define a window by the lower left and upper right corner coordinates. > plot_displacements (1, [0.8,-0.1],[1.1,0.1]);

Displacement Field

>

animate_displacements();

7.9 Two-Dimensional Equilibrium States

Deformed Mesh

Print and plot element principal stresses. > [seq(e_sigma[i] [2],i=1 .. nops(e_sigma))]; [[1999.999999, .300000000010- 6 , 90.00000000], > >

[1999.999999, .300000000010- 6 , 90.00000000]] plot_stresses(%,2); "Element Principal Stresses";

Element Principal Stresses

1

1 Maximum Value: .20e4

279

280

Solid Mechanics Applications

Print and plot nodal principal stresses. > [seq (n_sigma [i] [1. .3] , i=1. . nops (n_sigma))] ;

[[1999.999998, .200000000010- 6 , 90.00000000], [1999.999998, 0., 90.00000000], [1999.999999, .200000000010- 6 ,90.00000000], > >

[1999.999998, .200000000010- 6 , 90.00000000]] plot_stresses(%,2); "Nodal Principal Stresses";

Nodal Principal Stresses

Maximum Value: .20e4

Zoom in at node 1. > plot_stresses([seq(n_sigma[i] [1 .. 3], > i=l .. nops(n_sigma))] ,4,[0.9,0.9], [1.2,1.2]); > "Nodal Principal Stresses";

7.9 Two-Dimensional Equilibrium States

281

Nodal Principal Stresses

7.9.7 Example This example shows how easily symbolic computation can be performed in Maple. Consider the same problem of the previous example that is the traction of a square plate, with length l m and thickness h m, under the action of a load p N/m 2 , uniformly distributed on the sides perpendicular to the y-coordinate direction. The material properties, Young's modulus and Poisson's coefficient, are given, respectively by E N/m 2 and v. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cst_fem):with(G_cst_fem): > read_save_data(); > y; > "Exp797 . txt" ; "*elements*" "*nodes*" "*materials*" "*forces*" "*constraints*" "*control*" >

> >

n·, tcase;plane_case;control;nods;mat_props;elems;forces; bdr_conds;

282

Solid Mechanics Applications

" Plate Under Uniaxial Traction" "plane stress" ["point forces"] 1

1

1

1

[["2 l , "2 l ], [0, "2l], ["2l, 0], [0,0]]

[[E, v, /, h]] [[1,2,4, 1], [4,3, 1,

[[1, 0, >

1

4 p h l],

III

1

4 p h III

[2, 0,

[[4, x, 0], [4, y, 0], [3, 90, 0], [2, 0, 0ll cst_fem(yes); Plane stress analysis Initializing global matrices: Assembling element [1, 2, 4, 1] : Assembling element [4, 3, 1, 1] : Assembling point forces: Forcing exact boundary conditions : Nodal displacements (disp) : lux, u y]

Iplv

e' "2

Ipl r, E],

[-"2 e' "2

J

1 PI] [I P 1V E ' -"2 OJ ' [0,0]

e'

Reactions (reacts) : [node, direction, [reactionll [4, x, [0]], [4, y,

[3, 90, [0, Equilibrium:

41 ph l]],

E Fx

Element stresses (e_sigma) : [[o"x,

1

[-4 phl]],

=

[2, 0, [0, 0ll

0,

and

O"y, O"xy],

[0"[,

E Fy O"n,

=

0

angle], strain energy]

1 p 2 l2 h

[[0, p, 0], [p, 0, 90], 16 セ}L@

1 p2

[[0, p, 0], [p, 0, 90], 16 セ}@ Nodal stresses (n_sigma) : [0"[,

O"n,

l2

h

angle, strain energy density]

7.9 Two-Dimensional Equilibrium States

283

Total strain energy : 1 p 2 l2 h ---

8

E

Cpu time: Print displacements lux, uy]. > disp;

3.087 seconds

J

e' "2

1plv 1pl rr E],

[[ -"2 E' "2

1 P l] [1 P lV E ' -"2 E' OJ ' [0, 0]]

Print element stresses [[o"x, O"y, O"xy], [0"1, O"Il, angle], strain energy]. > e_sigma;

[[[0,

p, 0],

1 p 2 l2 h

[p, 0, 90], 16 ---e], 1 p 2 l2 h

[[0, p, 0], [p, 0, 90], 16 ---e]] Print nodal stresses [0"1, 0" II, angle, strain energy density]. >

n_sigma;

[[P, 0, 90,

1p2

"2

E], [p, 0, 90,

1p2

1p2

"2

E],

1p2

[p, 0, 90, "2 E], [p, 0, 90, "2 E]] Print reactions [node, direction, [reaction]]. > reacts; 1 1 [[4, x, [0]], [4, y, [-4 phl]], [3,90, [0, -4 phl]], [2,0, [0,0]]] Print total strain energy. > total_strain_energy; 1 p 2 l2 h ---

8 E Graphics can be displayed only after substituting symbolic by numerical values. > nods:=subsCl=2, nods):plot_mesh();

Solid Mechanics Applications

284

Finite Element Mesh 2

1

2

4

3

Node Number

> > >

>

Element Number

e_sg:=[seq(e_sigma[i] [2],i=1 .. nops(e_sigma))]: e_sg:=subs(p=2000, 1=2, h=O.Ol, E=210.0e6, e_sg): plot_stresses(e_sg,2); "Element Stresses";

Element Stresses

t

t Maximum Value: .20e4

7.9.8 Example Consider the bending of a rectangular cantilever plate simply supported at the end, with length I = 3 m height h = 2 m and thickness t = 0.1 m, under the

7.9 Two-Dimensional Equilibrium States

285

simultaneous action of the plate self weight and a vertical point load P = 80 kN applied at the top of the free corner. The material properties, Young's modulus, Poisson's coefficient and specific weight, are given, respectively by E = 206 X 106 kN/m 2 , v =.3 and I = 77 kN/m 3 . > restart: > interface(verboseproc=3):printlevel:=3: > with(Cst_fem):with(G_cst_fem): > read_save_data(); > y; > "Exp798a. txt" ; "*control*" "*materials*" "*nodes*" "*elements*" "*constraints*" "*forces*" >

n;

Print and check the data. > tcase;plane_case;control;nods;mat_props;elems;forces; > bdr_conds; " Bending of a Cantilever with a Support at the End - Coarse Mesh" "plane stress" ["point forces", "self weight"] [[.206109 , .3, -77.,

Oll .lll

[[1,2,4, 1], [3,4,2,

III

[[3, 0], [3, 2], [0, 2], [0,

[[2, 0, -80]] >

[[1, y, 0], [3, x, 0], [3, y, 0], [4, x, 0], [4, y, plot_problem_data();

Oll

Solid Mechanics Applications

286

Problem Data

Load

Con traint

l\Iaterial

Finite Element Mesh 2

3

2

4

Node Number

Run the finite element model. > cst_femO; Cpu time: Plot the displacements. > plot_displacements();

Element Numbe.·

1.812 seconds

7.9 Two-Dimensional Equilibrium States

Displacement Field

Maximum Val ue: .S2e-S

Plot the element principal stresses. > seq(e_sigma[i] [2],i=1 .. nops(e_sigma)): > plot_stresses([%]); > "Element Principal Stresses";

Element Principal Stresses

Maximum Value: .SSe3

Plot the element strain energy. > seq(e_sigma[i] [3],i=1 .. nops(e_sigma)): > animate_3D_rot([%]);

287

288

>

Solid Mechanics Applications

"Element Strain Energy";

Element Strain Energy

total_strain_energy; .0002452041313 Refine the finite element mesh. > read_save_data(); > y; > "Exp798b.txt"; >

"*control*" "*materials*" "*nodes*" "*elements*" "*constraints*" "*forces*" >

n',

Always check the data. > plot_meshO;

7.9 Two-Dimensional Equilibrium States

Node Number

Element Number

Problem Data

Load

Constraint

Run the finite element model. > cst_femO; Cpu time: Plot the displacements. > plot_displacements();

i\latcrial

26.085 seconds

289

290

Solid Mechanics Applications

Displacement Field

Maximum Value: .22e-4

Plot the element and nodal principal stresses. > seq(e_sigma[i] [2],i=1 .. nops(e_sigma)): > plot_stresses([%]); > "Element Principal Stresses";

Element Principal Stresses

Maximum Value: .25e4

> > >

seq(n_sigma[i] [1 .. 3],i=1 .. nops(n_sigma)): plot_stresses([%]); "Nodal Principal Stresses";

7.9 Two-Dimensional Equilibrium States

291

Nodal Principal Stresses

Plot isochromatic lines. > seq(abs(n_sigma[i] [l]-n_sigma[i] [2]),i=1 .. nops(nods)): > plot_contour_lines([%]); > "Isochromatics Isigma_I-sigma_III";

Isochromatics Isigma_I-sigma_III

.40e3

.73e3

.

.1.te.t

.17e4

Plot the nodal strain energy density. > seq(n_sigma[i] [4],i=1 .. nops(n_sigma)): > plot_contour_lines([%]);

292 >

Solid Mechanics Applications

"Nodal Strain Energy Density";

Nodal Strain Energy Density

.lSe-2 .35e-2

.67e-2

.84e-2

Notice the increase in the value of the total strain energy. > total_strain_energy; .0009865494659 7.9.9 Example This example illustrates that choosing a good finite element mesh is a task whose success depends on the skills of the analyst, concerning his understanding of the way a given structure performs under the action of a given load. A good finite element mesh is anyone that leads to a distribution of the strain energy density which follows the distribution of the exact solution. The obvious consequence of this statement is that, given a structure and two different loading conditions, there is not a single good finite element mesh that simultaneously satisfies the analysis of both loading conditions. This is a problem that the available mesh generating programs of the great majority of commercial packages are still struggling with. Problem. Consider a circular or a square disc under the action of two opposite compressive point forces with the same magnitude as represented in Fig. 7.6. Choose one of these structures, use the symmetry of the problem and design a good finite element mesh with no more than 50 finite elements. Recommendations. Follow the recommendations given bellow in order to solve the problem. 1. Design a regular mesh with constant-strain triangular finite elements and compute its total strain energy.

7.9 Two-Dimensional Equilibrium States

I

293

p= 1 kN d= 0.2m h = 0.01 m E =21 GPa u = 0.2

d

1

tp l----d----l

Figure 7.6. Circular and square discs loaded

2. With this mesh compute the nodal strain energy density and obtain a distribution of lines of constant strain energy density. 3. Observing the trend of these energy isolines, choose a direction that follows, as much as possible, the direction of the highest gradient of the strain energy density. Along this direction, plot a curve representative of the value of the strain energy density. 4. Divide, and smooth with linear segments, the curve obtained in the previous step in such way that the areas under each segment are roughly identical. In this way, the smaller segments are concentred in the regions of higher strain energy density. 5. On this segmented line select the points that correspond to the mid-value of each segment. 6. On the domain of the structure, draw the isolines of strain energy density that correspond to the selected values in the previous step. To define each curve on the domain use the trend of the initial distribution of the isolines. 7. On the distribution of the energy isolines obtained in the previous step draw another set of curves, as many as the number of the isolines considered, with the local direction of the gradient perpendicular to the direction of the isolines. These two sets of curves roughly define an orthogonal net on which a new finite element mesh will be defined. 8. On this orthogonal net define a new finite element mesh, by simultaneously distributing a) a single row of finite elements on each pair of isolines and b) a single row of finite elements on each pair of gradient lines. In this way, the nodes of the finite element mesh will be placed on the isolines, at the crossing points of the two sets of curves obtained in the previous step. Furthermore, the distribution of the finite elements will be finer in the regions of high gradient of the strain energy density.

294

Solid Mechanics Applications

9. Finally, with this new finite element mesh, compute the total strain energy. The value obtained that corresponds to the new finite element mesh, should be higher than the value obtained with the initial mesh. This is a clear indication that the new finite element mesh is a good one, since, with roughly the same number of finite elements of the initial mesh it leads to a value of the total strain energy that is higher than the value obtained with the initial mesh. Initial Mesh. An initial regular finite element mesh with 50 elements was set up. > restart: > interface(verboseproc=3):printlevel:=3: > with(Cst_fem):with(G_cst_fem): > read_save_data()j > >

Yj

IExp799a.txt"j "*control*" "*materials*" "*nodes*" "*elements*" "*constraints*" "*forces*"

>

n·,

>

Finite Element Mesh ..,..--..;12

3

4 ..,..--..;1 ..,.--..;16

6

Node Number

Element Number

7.9 Two-Dimensional Equilibrium States

Problem Data

Load

>

Constraint

Cpu time: plot_displacements();

:\Iaterial

26.807 seconds

Displacement Field

Maximum Value: .89e-6

>

> >

seq(e_sigma[i] [2],i=1 .. nops(e_sigma)): plot_stresses([%]); "Element Principal Stresses";

295

296

Solid Mechanics Applications

Element Principal Stresses

Maximum Value: .38e3

> >

> >

total_strain_energy;

.222691013210- 6 seq(n_sigma[i] [4],i=1 .. nops(n_sigma)): plot_contour_lines([%]); "Isolines of Nodal Strain Energy Density";

Isolines of Nodal Strain Energy Density

.42e-3 .83e-3

2c-_ .17e-2 .21e-2

Zoom in the region of high gradient of energy.

7.9 Two-Dimensional Equilibrium States > > > >

>

297

[.42e-3,.83e-3,.12e-2,.17e-2,.21e-2], [-.001, .03] , [.05, .11] : plot_contour_lines ([seq(n_sigma[i] [4],i=1 .. nops(nods))],%); "Isolines of Nodal Strain Energy Density";

Isolines of Nodal Strain Energy Density

These isoline plots show that x = 0 and y = 0.1 are possible directions of the highest gradient of the strain energy density. Consider the direction of x = O. The value of the nodal strain energy density along this line is represented in the following plot. > left_side_sed:= > [seq([nods[i] [2] ,n_sigma[i] [4]] ,i=[1,7,13,19,25,31])]: > plot (left_side_sed, > color=black,thickness=3,axes=BDXED, > title="Distribution of Strain Energy Density Along x=O");

Solid Mechanics Applications

298

Distribution of Strain Ener 2.5 -

2

1.5

0.5

o

20

40

60

80

100

Four values were selected from this curve. The isolines that correspond to the selected values of the strain energy density are plotted as follows. > [.28e-3,.53e-3,.17e-2,.235e-2]: > plot_contour_lines > ([seq(n_sigma[i] [4],i=1 .. nops(nods))],%); > "Nodal Strain Energy Density";

Nodal Strain Energy Density

.28e-3

.S3e-3

.17e-2

.24e-2

The path of these energy isolines was smoothed to remove the effect of the finite element linear interpolation.

7.9 Two-Dimensional Equilibrium States

299

Second Mesh. Based on the smooth paths of the energy isolines, a new finite element mesh was generated. > read_save_data(); > > >

y; Exp799b . txt plot_mesh(); II

II ;

Finite Element Mesh

NセZS

セ セR@

12

14 15% 27

W

>

セ@

21

Zセ

CiG:J

U Node Number

38

RG@ 28

39

v Element Number

plot_mesh([-.001,.076J ,[.018,.101J);

Finite Element Mesh

300

Solid Mechanics Applications

Problem Data

i\latcrial

> > >

Cpu time: 27.955 seconds seq(e_sigma[i] [2],i=1 .. nops(e_sigma»: plot_stresses([%J,1.3)j "Element Principal Stresses";

Element Principal Stresses

Maximum Value: .20e4

>

seq(n_sigma[i] [1 .. 3],i=1 .. nops(n_sigma»:

7.9 Two-Dimensional Equilibrium States

> >

301

plot_stresses([%] ,3,[-0.003,0.08],[0.015,0.105]); "Nodal Principal Stresses";

Nodal Principal Stresses

> > >

>

total_strain_energy; .334046140410- 6 seq(n_sigma[i] [4],i=1 .. nops(n_sigma)): plot_contour_lines([%]); "Isolines of Nodal Strain Energy Density";

Isolines of Nodal Strain Energy Density

.16e-l

.31e-l

.... 7(.' t

.63e-1

.78e-1

302 > >

> > >

Solid Mechanics Applications

[.16e-1,.31e-1,.47e-1,.63e-1,.78e-1], [-.0001,.08],[.013,.101]: plot_contour_lines ([seq(n_sigma[i] [4],i=1 .. nops(nods))],%); "Isolines of Nodal Strain Energy Density";

Isolines of Nodal Strain Energy Density

In the second mesh, the value of the total strain energy is 50% higher than in the first mesh. > tse:=(.3340461283e-6-.2226910114e-6)/.2226910114e-6; tse := .5000431594 The conclusion is that, although the number of finite elements is smaller in the second mesh than in the first one, the second mesh performs better than the first one, since it leads to a 50% increase in the total strain energy. Obviously, the recommendations suggested to obtain a good finite element mesh are not intended to be systematically followed in the analysis of practical problems. Indeed, the only conclusion that can be drawn, at the end of this example, is that the finite element mesh should be refined in regions of high gradient of the strain energy density. This knowledge is basic for experienced designers who intuitively follow the described process of mesh optimization. On the other hand, non-experienced designers prefer to use regular mesh patterns, in which case the total number of finite elements is highly overestimated.

7.10 One-Dimensional Equilibrium States One-dimensional states of equilibrium refer to structures in which the structural elements are bars. The bar geometry typically presents two of the di-

7.10 One-Dimensional Equilibrium States

303

mensions, the dimensions of the cross section, much smaller than the length. The material of the bar is thus confined to the neighborhood of a line, the axis of the bar. The theory of bars is an approximate structural model, asymptotic of the three-dimensional elasticity theory. Trusses, beams, frames and grillages are structures in which the structural elements are particular types of bars. For the sake of simplicity, only prismatic bars will be considered here. The cross section of the bar is uniform along a straight axis, as represented in Fig. 7.7. In addition, whenever torsion is considered, a cross section with centroid

3iJ

& Figure 7.7. Prismatic bar

radial symmetry is assumed. The bar is referenced by a system of coordinates in which Xl is the axis of the bar and (X2' X3) are the principal central directions of inertia of the cross section, as represented in Fig. 7.7. 7.10.1 Asymptotic Model: Theory of Bars

This model is formulated in terms of generalized variables of the generating model, defined as: • Generalized stresses - internal forces exerted through the cross section. • Generalized strains - deformations relative to the internal forces acting through the cross section. • Generalized displacements - rigid body displacements and rotations of the cross section. All these quantities are distributed along the axis of the bar which is the domain of this one-dimensional asymptotic model. Likewise the formulation of the exact generating model, three groups of equations which are the equilibrium, strain-displacement and stress-strain equations, can be established in this asymptotic model. While the general theory of bars includes all the deformations relative to the internal forces and moments, the simplified theory does not consider shear forces. From now on, generalized variables will be referred to simply as stress, strain and displacement variables. Throughout this section, derivatives will be represented by a comma as indicated in the following example

of セ]ヲRN@

UX2

'

Solid Mechanics Applications

304

General Theory. Given a distribution of stresses in a cross section of a bar, the generalized stresses are the internal force resultant from the stresses and the internal moment resultant from the moments of the stresses relative to the centroid of the cross section. They are defined, respectively by

N=

L

(7.116)

0'1 dfl

and (7.117) where 0'1 = an n1 is the stress vector defined at the integration point, n1 is the component of the outward unit vector normal to the cross section and 'F' is the position vector of the integration point. The components of Nand M are the internal forces acting through the cross section, as represented in Fig. 7.8. Thus, the normal force is given by

X

X

3

3

Figure 7.8. Internal forces acting through the cross section

(7.118)

N1 = Lan dfl, the shear forces are given by

N2

= La12

dfl and N3

= La13

(7.119)

dfl,

the torsional moment is given by

M1

= L(a13 X2 - a12 X3)

(7.120)

dfl

and the bending moments are given by

M2

= Lan X3

dfl and M3

= - Lan X2

dfl.

The vector of the generalized stresses is represented by

(7.121)

7.10 One-Dimensional Equilibrium States

305

(7.122) with

(7.123)

The equilibrium equations of forces and moments are given by --.t

IV, I

---=-' + --=> P = 0

(7.124)

and (7.125)

m

where p and represent the density of distribution of, respectively external forces and moments, along the axis of the bar and e'l is the unit vector of the xl-direction. The corresponding scalar equations are given, respectively by -P2

= N 2 ,1

(7.126)

and -ml = M I , I

-m2 = M 2 , I - N3

-m3 = M 3 , I - N 2 .

(7.127)

Note that, contrarily to the exact generating model, the theory of bars is statically determined. Consequently, if boundary conditions, defined by specified values of the internal forces and moments at the end sections of the bar, are known, the integration of the 6 equilibrium equations (7.126) and (7.127), with 6 unknowns does not raise any difficulty. Indeed, it is this circumstance that allows the drawing of the diagrams of internal forces and moments along the bars of an isostatic structure. Once the generalized stresses are known, the distribution of the corresponding stresses in the cross section is given by the well known expressions: = (l13 = 0

NI [!

(In = -

N I :

(l12

N2 :

(In = 0

(l12

= 133 b

N3 :

(In = 0

(l13

=

MI

(In = 0

(llt

=--

:

M2 :

(l12

M3:

(l12

= (l13 = 0

N 2S3 N 3S2 lz2 b MIT

It

M 2 X3

(In = - 122

= (l13 = 0

M3 X 2

(In = - - - , 133

(7.128)

Solid Mechanics Applications

306

where It = C (I22 + h3) is the torsional moment of inertia, with c representing a torsional factor. The corresponding strain components can be obtained from Hook's law as 0"11

= E'

cll

1'12

=

0"12

2C12

=G

and

1'13

=

0"13

2C13

= G'

(7.129)

where E and G are the modulus of longitudinal and transversal elasticity, respectively. The generalized strains can be identified with the multiplying factors of the generalized stresses in the expression of the strain energy. Navier's hypothesis assumes that all the stress components are null, except the ones defined in the plane of the cross section. Thus the strain energy of a bar is given by

U

=

セ@

fv [

Cll

O"ll 0"12 0"13] [ 1'12

1

(7.130)

dV.

1'13

This expression is taken for each component of (7.128) and (7.129), added together, and leads to

11

u = "2

V

(Nf

nᄃsセ@

NiS§

+ G 1222 b2 +

E [}2 + G 1233 b2 セ@

M2 2 M2 2 セ@ @セ G 12t + E 1222

M2

+

E

2)

12 33

dV

.

(7.131)

Each term of the right hand side of this equation can be integrated over the cross section to obtain (7.132) for the normal force,

r mゥセᄃ@

dV

lv E and

1 1

r M2 M2

=

122

Mlx§ 2 dV = v EI33

lXI

1

E

M3

Xl

dX1

(7.133)

dX1,

(7.134)

dX1

(7.135)

122

M3 EI 33

for the bending moments,

v

NiS§

GI 2 b2 dV = 33

1 Xl

N2

N 2GD ,

2

and (7.136)

7.10 One-Dimensional Equilibrium States

for the shear forces, where section, and

1 v

M'fr2 GI2 dV t

=

1

dセ@

and

dセ@

307

represent the shear areas of the cross

MI

(7.137)

MIGI dXI, t

Xl

for the torsional moment. Hence, the strain energy is given by

(7.138)

u = セ@

1

2

(7.139)

crT 6 dXI,

Xl

where cr is the vector of the generalized stresses defined in (7.122), and セ@

En J:!L 」ョセ@

.J:iL 」ョセ@

6=

[:]

.Ml... CIt M2

(7.140)

Eln M3 E 133

is the vector of the generalized strains, with

e=

{セQ@

(7.141) 」ョセ@

The generalized stress-strain relationships, obtained directly from (7.140), can be written in the usual form cr = D 6 as

NI

ED

0

0

0

0

0

el

0

0

0

0

e2

0

0

0

e3

GIt

0

0

kl

0

k2

EI33

k3

N2

0 gdセ@

N3

0

0

MI

0

0

0

M2

0

0

0

0 Eh2

M3

0

0

0

0

gdセ@

0

(7.142)

where the matrix D contains the components of the stiffness of the beam.

Solid Mechanics Applications

308

The generalized displacements of this model are the rigid body displacements Ui and rotations ()i of the cross section. The vector of the generalized displacements is given by Ul U2

U=

U3

(7.143)

()1 ()2 ()i

The generalized strain-displacement relationships can be obtained through the theorem of work and the equations of equilibrium. Alternatively, they can be obtained from the analysis of the geometry of the bar's deformation, associated to each internal force and moment. In this case, the components ei and k i of the generalized strains have the meaning of rates of change per unit of length, respectively of the rigid-body displacements and rotations of the cross section. To carry out this analysis consider a differential element of the bar under the separate action of each one of the internal forces and moments. In the case of the normal force Nl the analysis leads to (7.144)

Similarly, in the cases of the torsional moment Ml and bending moments M2 and M 3 , acting separately of each other, the analysis leads, respectively to (7.145) (7.146)

and (7.147)

In the case of the shear forces N2 and N3 the analysis leads, respectively to /12

= U2, 1 and

/13

= U3, 1

(7.148)

which are the contribution of the shear forces to the rates of change of displacements along the axis of the bar. These contributions must be added to the corresponding contributions of the bending moments M3 and M 2 , respectivelyas (7.149)

and

309

7.10 One-Dimensional Equilibrium States

(7.150) Figure 7.9 shows schematically the contribution of M2 and N3 to the rate of initial position of the cross section 1 1 1

/

position of the cross section with shear deformation

/ 1 /

I?- /

position of the cross section with no shear deformation

//1 //1 //

/ Y,

/

/

セ@

1

_ _・セャ。ウエゥ」@

curve

1