See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/382315200
Matrix Structural Analysis and the Finite Element Methods Using Scilab and
Octave: A Problem-Solving Approach
Book · July 2024
DOI: 10.1201/9781003329350
CITATIONS READS
2 110
1 author:
Bedilu Habte
Addis Ababa Institute of Technology
11 PUBLICATIONS 71 CITATIONS
SEE PROFILE
All content following this page was uploaded by Bedilu Habte on 04 November 2024.
The user has requested enhancement of the downloaded file.
Matrix Structural Analysis and
the Finite Element Methods
Using Scilab and Octave
This book covers code development for structural analysis and includes topics from
finite element methods such as modeling and analysis of continuum structures. It
explains the concepts showing derivation of necessary equations, relationships, and
steps in solving structural analysis problems. It contains worked examples, problem
sets, and ample Scilab and Octave codes to teach structural analysis techniques using
these softwares.
Features:
• Enables readers to distinguish between the flexibility and the stiffness meth-
ods of structural analysis.
• Clarifies the procedures in the direct stiffness methods as applied to discrete
structures and use of these for the analysis of 2D and 3D structures.
• Presents treatment of Finite Element Methods as a logical extension of the
Direct Stiffness Method.
• Provides sufficient solved examples and didactic problems (with solutions)
focusing on the analysis of statically indeterminate structures.
• Treats discrete and continuum structural analysis using similar matrix anal-
ysis procedures.
Focused on problem solving through programming, this book guides senior under-
graduate and graduate students in structural and civil engineering.
Matrix Structural Analysis
and the
Finite Element Methods
Using Scilab and
Octave
A Problem-Solving Approach
Bedilu Habte
Designed cover image: Bedilu Habte
First edition published 2025
by CRC Press
2385 NW Executive Center Drive, Suite 320, Boca Raton FL 33431
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
© 2025 Bedilu Habte
Reasonable efforts have been made to publish reliable data and information, but the author and publisher
cannot assume responsibility for the validity of all materials or the consequences of their use. The
authors and publishers have attempted to trace the copyright holders of all material reproduced in this
publication and apologize to copyright holders if permission to publish in this form has not been
obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information storage
or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or
contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. For works that are not available on CCC please contact
[email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used
only for identification and explanation without intent to infringe.
ISBN: 9781032359175 (hbk)
ISBN: 9781032359182 (pbk)
ISBN: 9781003329350 (ebk)
DOI: 10.1201/9781003329350
Typeset in Times
by Newgen Publishing UK
Dedication
I dedicate this book to my best friend and colleague Prof. Asrat
Worku Setegn as a reminder to our friendship. You have been
supportive ever since our freshman years and I am lucky and grateful
to have you on my side. You have also been my inspiration throughout
the writing of this book.
Contents
Preface.......................................................................................................................xi
Acknowledgments.................................................................................................... xv
List of Figures ........................................................................................................xvii
List of Tables...........................................................................................................xxi
SECTION I MATRIX STRUCTURAL ANALYSIS
Chapter 1 Introduction ..................................................................................... 3
1.1 Structural Classification.......................................................... 3
1.1.1 Plane Truss.............................................................. 3
1.1.2 Beam ....................................................................... 3
1.1.3 Plane Frame ............................................................ 5
1.1.4 Grid ......................................................................... 5
1.1.5 Space Truss ............................................................. 5
1.1.6 Space Frame............................................................ 5
1.2 Static/Kinematic Indeterminacy ............................................. 5
1.3 Matrix Structural Analysis....................................................10
1.3.1 The Flexibility Coefficient...................................... 10
1.3.2 The Stiffness Coefficients .......................................12
1.3.3 Flexibility and Stiffness Matrices ........................... 13
1.4 Scilab Software Environment ............................................... 15
1.5 Octave Software Environment .............................................. 19
1.6 Programming in Scilab and Octave ......................................22
1.6.1 Operators and Their Precedence............................. 23
1.6.2 Variables .................................................................23
1.6.3 Data Types .............................................................. 23
1.6.4 Expressions and Statements.................................... 24
1.6.5 If/Else Statement.....................................................24
1.6.6 While Statement...................................................... 25
1.6.7 For Statement..........................................................25
1.6.8 Branching/Case Statements ....................................26
1.6.9 User-Defined Functions .......................................... 27
1.6.10 Simple File Input/Output ........................................ 28
1.7 Problems ............................................................................... 29
Chapter 2 The Basic Methods ........................................................................ 35
2.1 The Basic Flexibility Method ............................................... 35
2.1.1 Solution Steps ......................................................... 37
vii
viii Contents
2.1.2 Examples................................................................. 38
2.2 The Basic Stiffness Method.................................................. 59
2.2.1 Solution Steps ......................................................... 60
2.2.2 Examples................................................................. 61
2.3 Problems ............................................................................... 77
Chapter 3 The Formalized Methods............................................................... 81
3.1 The Formalized Flexibility Method...................................... 81
3.1.1 Member Flexibility ................................................. 81
3.1.2 Derivation of Structure Flexibility.......................... 85
3.1.3 Solving for AQ and Solution Steps ......................... 87
3.1.4 Examples................................................................. 89
3.2 The Formalized Stiffness Method....................................... 135
3.2.1 Member Stiffness....................................................136
3.2.2 Derivation of Structure Stiffness ............................139
3.2.3 Assembling Structure Stiffness...............................141
3.2.4 Solving for DJ and Solution Steps..........................142
3.2.5 Examples.................................................................143
3.3 Problems ............................................................................. 192
Chapter 4 The Direct Stiffness Method........................................................ 196
4.1 Introduction......................................................................... 196
4.2 Complete Member Stiffness ............................................... 197
4.2.1 Spring and Bar Elements ........................................197
4.2.2 Beam .......................................................................198
4.2.3 Plane Truss..............................................................199
4.2.4 Plane Frame ............................................................201
4.2.5 Grid Structure .........................................................203
4.2.6 Space Truss.............................................................204
4.2.7 Space Frame............................................................207
4.3 Solution Steps in the Direct Stiffness Method.................... 210
4.4 Examples............................................................................. 211
4.5 Problems ............................................................................. 281
Chapter 5 Special Cases in the Direct Stiffness Method.............................. 284
5.1 Introduction......................................................................... 284
5.2 Different Element Types in a Structure .............................. 284
5.3 Beam on Elastic Foundation ............................................... 285
5.3.1 Two-parameters Mechanical Model .......................286
5.4 Non-Prismatic Members..................................................... 287
5.5 Inclined Roller support ....................................................... 288
5.6 Member Discontinuities (Hinge/Roller) ............................. 291
5.7 Symmetric and Anti-symmetric Structures ........................ 292
5.8 Examples............................................................................. 293
Contents ix
5.9 Problems ............................................................................. 314
SECTION II FINITE ELEMENT METHODS
Chapter 6 Introduction and 1D Finite Element Analysis ............................. 319
6.1 Introduction......................................................................... 319
6.1.1 Nodes and Finite Elements .....................................319
6.1.2 A Brief History .......................................................322
6.1.3 An Overview...........................................................322
6.2 3D Elasticity ....................................................................... 325
6.3 Interpolation/Shape Function.............................................. 328
6.4 Element Stiffness Matrix .................................................... 329
6.4.1 Equivalent Nodal Loads Vector ..............................330
6.5 Common Steps in the FEM................................................. 330
6.6 Symbolic Computation ....................................................... 333
6.7 1D FE Analysis................................................................... 335
6.7.1 Stiffness of a Linear Bar Element...........................336
6.7.2 Stiffness of a Quadratic Bar Element .....................337
6.7.3 Beam Elements .......................................................350
6.7.4 DSM as a Special Case of the FEM........................353
6.8 Problems ............................................................................. 357
Chapter 7 2D Finite Element Analysis......................................................... 361
7.1 Introduction......................................................................... 361
7.2 Plane Stress, Plane Strain and Axisymmetric Problems..... 363
7.3 Constant Strain Triangle ..................................................... 365
7.3.1 Stiffness Matrix of a CST .......................................370
7.4 Linear Strain Triangle......................................................... 383
7.5 Bi-linear Rectangular Element ........................................... 403
7.6 Natural Coordinate & Isoparametric Representation ......... 409
7.6.1 Relationship between Global and Natural
Coordinates .............................................................411
7.7 Iso-P Representation for Quadrilateral Elements ............... 412
7.7.1 Derivative Relationships in 2D ...............................413
7.8 Numerical Integration Using Gauss Quadrature................. 419
7.9 Axisymmetric Problem....................................................... 423
7.10 Problems ............................................................................. 431
Chapter 8 3D Finite Element Analysis......................................................... 435
8.1 Introduction......................................................................... 435
8.2 Tertahedral Element............................................................ 435
8.2.1 Stiffness Matrix of a Tetrahedral Element ..............439
x Contents
8.3 Hexahedral Element............................................................ 449
8.3.1 Stiffness Matrix of a Hexahedral Element..............452
8.4 Problems ............................................................................. 468
Beam Deflection ...........................................................................................471
Fixed-End Actions .........................................................................................475
FPS vs SI Unit Conversion ............................................................................477
References ....................................................................................................479
Index...................................................................................................................... 483
Preface
The two topics Matrix Structural Analysis (MSA) and Finite Element Methods
(FEM) in Structural Analysis are usually offered as courses to senior undergrad-
uate or post graduate students in the civil, structural and mechanical engineering
programs. The Direct Stiffness Method (DSM), a major topic in MSA, deals with
structures composed of discrete elements, while the basis for the FEM in Structural
Analysis is, on the other hand, creating a mesh (discretization) of the given contin-
uum structure and then applying the procedures of the DSM on the resulting dis-
cretized structure. In this sense, the FEM in Structural Analysis is an extension of
the DSM, and that is the reason why this book has been written to integrate the fields
of MSA and FEM in a unified manner.
My journey around MSA and FEM started in the late 1980s during my MSc
courses and thesis work entitled “A Computer Program for the Elastic Analysis of
Plane Structures” [16] written in the FORTRAN programming language. Through
my experience and the many years of teaching these courses, I observed that it is
easy to understand the concepts in matrix methods. Still, using these concepts in
practically solving structural analysis problem becomes challenging. The main chal-
lenge is the difficulty in trying to track the steps and perform the essential matrix
operations to formulate and solve structural analysis problems manually (on paper).
Access to computing facilities has been increasing from time to time, and a typi-
cal college student nowadays owns a laptop or has access to a personal computer at
home or the college. Besides, there are appropriate software that assist in perform-
ing routine and complex matrix operations like matrix multiplication and inversion.
The second reason for writing this book is to overcome those difficulties associated
with formulating and solving structural analysis problems through programming or
coding on a suitable platform step by step and interactively.
The book aims to provide concise reading materials explaining the concepts and
showing the derivation of necessary equations, relationships and steps in solving
structural analysis problems. It also contains worked examples, problem sets and am-
ple Scilab and Octave code to teach structural analysis techniques using MSA/FEM.
Scilab and Octave are free and open-source software for scientific computation and
visualization. In addition to being free and open-source, they offer excellent plat-
forms for practicing computer-aided structural analysis tasks. Since the syntax for
Octave is identical to Matlab, the Octave program codes in this book can be exe-
cuted in Matlab directly without any modification.
There are several structural analysis software packages, but generally, they are
not appropriate to use in teaching MSA/FEM courses, at least in the initial phase.
The reason is the most of them focus primarily on problem definition (geometry, ma-
terial property and boundary condition) and the final step of colorfully displaying the
analysis results (displacements and stresses) performing all the other steps internally.
Such softwares are only recommended for use in the classroom to model complex
xi
xii Preface
situations once the students have experienced the problem-solving skills discussed
in this book.
The book contains two sections and eight chapters. Section I comprises Chapters
1–5 focusing on the MSA, while Section II covers Chapters 6–8 discussing the FEM.
Chapter 1 gives a general introduction to structural classification, definition of flex-
ibility and stiffness coefficients and matrices, a description and a tutorial about the
Scilab and Octave platforms and also programming using these softwares. The basic
flexibility and stiffness methods are discussed in Chapter 2. Chapter 3 explains the
formalization of the flexibility and stiffness methods. Here, the structure property
is derived from the properties of its elements by using appropriate transformation
matrices from elements to the structure. The concept of partitioning the structure
equations to solve for the main unknowns and then back substitution to solve for the
element (internal) results using the main unknowns is also explained. Chapter 4 fo-
cuses on the DSM applied to prismatic structures. Starting with spring arrangements,
the chapter discusses how the DSM is used for 1D bar elements, beams, plane trusses,
plane frames, grid structures, space trusses and space frames. Special cases that cre-
ate difficulty in the straightforward application of the DSM are treated in Chapter
5, such as different element types within a structure, non-prismatic members and
inclined roller supports.
An introduction to the FEM is provided in Chapter 6. After a brief overview of
the method, the basic relationship for the derivation of the element stiffness matrix
in general is provided in Section 6.5. The chapter also covers some parts of one-
dimensional FEM analysis, as most of this has already been covered under the DSM
in Chapters 4 and 5 for ”naturally” discretized structures. The finite element analy-
sis of two-dimensional structures and three-dimensional structures are discussed in
Chapters 7 and 8, respectively. This edition of the book does not cover finite ele-
ment analysis of plate bending, shell structures and non-linear analysis. As a quick
reference, units conversion table (FPS to SI) is provided for some of the most com-
monly encountered units in Appendix. Formulae for simple and common cases of
“Beam Deflection” as well as “Fixed-End Actions” for some common loading are
also provided in Appendix.
This book differs from other similar literature in that it guides the readers to be
able to write their program code to solve structural analysis problems throughout the
book. Instead of depending on an existing black-box type software where users have
to prepare the problem data in a specified format and then submit it to the program
for the solution, users have full control of preparing and using their code, thereby
building the confidence needed for further application of the programming skills.
The features of this book that make it distinct from other similar works are that it:
• Uses both the international (SI) and imperial (FPS) system of units
• Focuses on the analysis of statically indeterminate structures
• Clarifies static and kinematic classification of structures
• Distinguishes between the flexibility and the stiffness methods of structural
analysis
Preface xiii
• Describes the procedure to use the basic and formalized approaches to both
the flexibility and the stiffness methods
• Clearly outlines the procedure for the DSM to analyze any type of prismatic
structure
• Treats discrete and continuum structures using the identical matrix meth-
ods, showing that the FEM for structural analysis is an extension of the
MSA
• Depends only on free and open-source software Scilab and Octave, and
provides worked examples that are supported by program codes prepared
in either one of these software
• Provides sufficient didactic problem sets at the end of each chapter
Focused on problem solving through programming, the book guides the reader
from first principles to advanced algorithms. By following the path recommended in
this book, students will acquire a very important programming skill that will serve as
a research toolkit during their studies and workplaces after graduation. The student
or practicing engineer will build the confidence and be able to better understand and
assess the performance of other structural analysis software packages.
Acknowledgments
My first thanks goes to Dr. Gagandeep Singh, Senior Publisher at CRC Press, for
the initiation, organization and continuous follow up of this project. Thanks to the
team of CRC Press for all the support and providing frequent essential information
for the project; specially to Mr. Shashi Kumar of CRC for the technical support and
guidance offered in using the LaTeX book template.
I would like to thank some of my friends and relatives for trying to proofread the
first draft of this work.
I thank my family, especially my wife Mekdes and my children Hirut and
Yonatan for giving me the time and space I needed during the preparation of this
book.
Finally, thank God for letting me start and for blessing me with the strength to
finish this work.
xv
Figures
1.1 Classification of Prismatic Structures............................................................... 4
1.2 Primary Unknowns in the Flexibility and the Stiffness Methods ................... 11
1.3 Flexibility Coefficients of a Simple Beam...................................................... 11
1.4 The Stiffness Coefficients ............................................................................... 12
1.5 The Scilab Software Environment .................................................................. 16
1.6 The Octave Software Environment................................................................. 19
1.7 Problems Set 1 ................................................................................................ 31
2.1 Beam and Truss with Respective Primary Structures..................................... 36
2.2 Alternative Primary Structures ....................................................................... 37
2.3 Propped Cantilever Beam ............................................................................... 39
2.4 A Plane Truss with first Degree Statically Indeterminacy.............................. 40
2.5 Two-Span Beam with Primary Structure ........................................................ 43
2.6 Displacements DL and Flexibility Coefficients.............................................. 44
2.7 Reactions of the Two-Span Beam for w = 35 kN/m....................................... 45
2.8 Alternative Primary Structure for the Two-Span Beam.................................. 46
2.9 Displacements on Primary Structure DL and fi j ............................................. 47
2.10 (a) A Plane Frame and Loading and (b) A Particular Primary
Structure.......................................................................................................... 50
2.11 A Grid Structure ............................................................................................. 54
2.12 Analysis Results of the Grid Structure. .......................................................... 58
2.13 Basic Structure of a Beam and a Truss ........................................................... 60
2.14 Propped cantilever beam................................................................................. 62
2.15 Solution of a Propped Cantilever Beam ......................................................... 63
2.16 Basic Structure under Unit Displacements ..................................................... 64
2.17 Basic Stiffness Method for a Two-Span Beam ............................................... 68
2.18 Reactions of the Two-Span Beam Using Equivalent Nodal Load. ................. 70
2.19 Basic Structure for a Plane Frame. ................................................................. 72
2.20 Basic Structure for a Grid Structure. .............................................................. 75
2.21 Problems Set 2 ................................................................................................ 78
3.1 A Truss Member Subjected to Action am . ...................................................... 82
3.2 A Beam Member with Transverse and Rotational DOFs. .............................. 83
3.3 A Plane Frame Member with Three DOFs..................................................... 83
3.4 A Grid Member with Its Three DOFs............................................................. 84
3.5 The Six Possible DOFs of a Space Frame Member........................................ 85
3.6 Action Transformation Matrix, BMS . .............................................................. 88
3.7 (a) Plane truss and (b) Primary Structure with All Parameters Labeled......... 89
3.8 Analysis Result of the Plane Truss. ................................................................ 95
3.9 Statically Indeterminate Beam........................................................................ 96
3.10 Primary Structure of the Beam ....................................................................... 97
3.11 Analysis Result of the Beam......................................................................... 101
xvii
xviii List of Figures
3.12 Plane Frame Having Three-Members........................................................... 103
3.13 (a) Primary Structure and (b) Member Actions of the Plane Frame............. 104
3.14 Analysis Result for the Plane Frame. ........................................................... 111
3.15 Grid Structure Having Three-Members........................................................ 113
3.16 (a) Primary Structure and (b) Member Actions of the Grid Structure.......... 114
3.17 Analysis Result for the Grid Frame. ............................................................. 119
3.18 (a) Given Space Frame and (b) Corresponding Primary Structure............... 122
3.19 Free-Joint Displacements of the Space Frame.............................................. 123
3.20 A Truss Member Subjected to Unit Displacement dm .................................. 136
3.21 A Beam Member with Transverse and Rotational DOFs. ............................ 137
3.22 A Plane Frame Member with Three DOFs................................................... 138
3.23 A Grid Member with Three DOFs................................................................ 138
3.24 The Six DOFs of a Space Frame Member. ................................................... 139
3.25 Displacement Transformation Matrix, CMS . ................................................. 143
3.26 Plane Truss.................................................................................................... 143
3.27 DJ s and AR s of the Plane Truss..................................................................... 144
3.28 Unit Displacements to Determine Cms. ....................................................... 146
3.29 Two-Span Beam............................................................................................ 152
3.30 Primary Structure of the Beam ..................................................................... 153
3.31 Structure Displacements D j s = 1 and DR s = 1. ........................................... 155
3.32 Plane Frame Having Three-Members........................................................... 160
3.33 (a) Free-Joint Displacements and Reactions and (b) Member Actions of
the Plane Frame. ........................................................................................... 161
3.34 Grid Structure Having Three-members. ....................................................... 169
3.35 Member Actions of the Grid Structure. ........................................................ 170
3.36 Space Frame Structure Having Three-Members. ......................................... 179
3.37 Basic Structure of the Space Frame.............................................................. 180
3.38 Free-Joint Displacements of the Space Frame.............................................. 181
3.39 Problems Set 3 .............................................................................................. 194
4.1 Spring Element. ............................................................................................ 197
4.2 Bar Element. ................................................................................................. 198
4.3 Beam Element............................................................................................... 199
4.4 Plane Truss Element. .................................................................................... 199
4.5 2D Vector Transformation. ........................................................................... 200
4.6 Plane Frame Element.................................................................................... 202
4.7 Grid Frame Element in X–Y Plane............................................................... 203
4.8 Space Truss Element..................................................................................... 205
4.9 Vector in 3D: (a) Global Components and (b) Local Components. ............. 206
4.10 Space Frame Element. .................................................................................. 209
4.11 Springs: (a) Spring System and Loading and (b) Global Nodes, Elements
and DOFs of the Spring System. .................................................................. 212
4.12 Bar Elements: (a) 1D Structure and Loading and (b) Its Global Nodes
and DOFs ...................................................................................................... 217
4.13 (a) Fixed-End-Actions and (b) Equivalent Nodal Loads Due to the
Temperature Increase.................................................................................... 219
List of Figures xix
4.14 Beam: (a) Beam and Loading and (b) All Nodal Displacement
Components. ................................................................................................. 222
4.15 Final Member End Actions, Am s. ................................................................. 226
4.16 Plane Truss (a) Plane Truss and Loading and (b) Nodes, Elements and
Global DOFs................................................................................................. 232
4.17 (a) Plane frame and Loading and (b) Nodes, Elements and Global DOFs... 240
4.18 (a) Grid Structure Having three-Members and (b) Its Nodes, Members
and Global DOFs. ......................................................................................... 250
4.19 (a) A Four Members Space Truss and (b) Nodes, Members and Global
DOFs............................................................................................................. 259
4.20 (a) A Single-Storey One-Bay Rectangular Space Frame and
(b) Members and Global DOFs of the Space Frame .................................... 269
5.1 A Plane Frame Structure with Mixed Element Types. ................................. 285
5.2 Beam on Elastic Foundation ......................................................................... 286
5.3 Beam on Elastic Foundation with Tension Force at Ends. ........................... 286
5.4 Non-prismatic elements ................................................................................ 287
5.5 A Plane Frame with Inclined Roller Support. .............................................. 289
5.6 Inclined Roller Support with Rotated Global Coordinate System................ 289
5.7 Inclined Roller Support Substituted by an Axially Rigid Member............... 290
5.8 Inclined Roller Support with Local and Global Coordinates. ...................... 290
5.9 Beam Having a Moment Discontinuity at Distance a from Node-1............. 292
5.10 Half of a Symmetric/Anti-Symmetric Frame Considered for Analysis. ...... 293
5.11 A Structure with Different Element Types. .................................................. 293
5.12 Problems Set 5 .............................................................................................. 315
6.1 Typical Finite Elements in Structural Analysis. ........................................... 320
6.2 A Circle with Diameter = 1 unit to Approximate π .................................... 321
6.3 A 3D Stressed Element................................................................................. 325
6.4 Deformed Shape of the Stress Block. ........................................................... 326
6.5 Linear Interpolation. ..................................................................................... 328
6.6 Idealization of a Plane Truss......................................................................... 331
6.7 Nodes and Elements of the Plane Truss........................................................ 331
6.8 Linear Interpolation of a Plane Truss. .......................................................... 332
6.9 Assembling Element Stiffness into Structure One. ...................................... 332
6.10 A Plot of the vertical Displacement of the Truss.......................................... 333
6.11 A 1D Bar Element ........................................................................................ 335
6.12 Quadratic Bar Element. ................................................................................ 338
6.13 (a) Tapered Bar Under Axial Load P, (b) Two Linear Elements and
(c) Single Quadratic Element........................................................................ 339
6.14 Plot of Exact and FEM Displacement Solutions. ......................................... 342
6.15 Stress Plot for the Three Cases. .................................................................... 343
6.16 Beam Element............................................................................................... 351
6.17 Shape Functions of a Beam Element. ........................................................... 352
6.18 Problems Set 6 .............................................................................................. 358
7.1 Plate Structure............................................................................................... 362
7.2 2D Plate Structure: (a) Meshed Plate (b) Typical Triangular Element......... 362
xx List of Figures
7.3 2D Stress Components.................................................................................. 362
7.4 Tapering Plate (with a Hole) as Typical Plane Stress Problem..................... 363
7.5 2D Section of a Retaining Wall as Typical Plane Strain Problem. ............... 365
7.6 Constant Strain Triangle. .............................................................................. 366
7.7 Shape Functions of a CST Element. ............................................................. 367
7.8 Area Coordinates. ......................................................................................... 368
7.9 Shape Functions for a CST. .......................................................................... 368
7.10 (a) Rectangular Plate and Loading and (b) Two CST Elements................... 376
7.11 Nodal Loading and Support Conditions. ...................................................... 377
7.12 Symmetrically Meshed Four CST Elements. ............................................... 380
7.13 Displacement u and Stress σx Distribution for 1024 CST Elements............ 381
7.14 A Linear Strain Triangle. .............................................................................. 383
7.15 Rectangular Plate Two LST Elements. ......................................................... 385
7.16 Integration Limits for the Two Elements. ..................................................... 390
7.17 Equivalent-Nodal-Load................................................................................. 396
7.18 Rectangular Element..................................................................................... 403
7.19 Plate as a Single Rectangular Element. ........................................................ 405
7.20 Coordinate Systems ...................................................................................... 410
7.21 Quadrilateral Element: (a) Global CS, (b) Iso-P Mapping in Natural CS .... 412
7.22 IsoP Mapping of a Rectangular Element. ..................................................... 415
7.23 Conical Hollow Structure as Typical Axisymmetric Problem...................... 423
7.24 Stresses for an axisymmetric problem.......................................................... 424
7.25 Axisymmetric Elements................................................................................ 425
7.26 Problems Set 7 .............................................................................................. 433
8.1 A 3D Structure and Loading......................................................................... 436
8.2 A Tetrahedral Element. ................................................................................. 436
8.3 Tetrahedral Element for Volume Coordinates .............................................. 437
8.4 Tetrahedral Element...................................................................................... 440
8.5 Nodal Forces and Reactions for the Tetrahedral Element. ........................... 446
8.6 Hexahedral/Brick Element............................................................................ 450
8.7 Hexahedral Element...................................................................................... 453
8.8 Problems Set 8 .............................................................................................. 470
Tables
1.1 Structural Classification.................................................................................... 6
1.2 Common Operators in Scilab/Octave ............................................................. 23
2.1 Virtual Work Principle .................................................................................... 41
2.2 Virtual Work Parameters for the Plane Frame ................................................ 50
2.3 Virtual Work Parameters for the Grid Structure ............................................. 55
2.4 Member Forces Due to Unit Displacements................................................... 65
2.5 Fixed-End-Actions Plus Actions Due to Nodal Displacements ..................... 70
3.1 Action Transformation Matrix for the 6 Bars Truss ....................................... 91
3.2 Fixed-End-Actions on the Beam .................................................................... 97
3.3 Action Transformation Matrix for the Beam.................................................. 98
3.4 Unassembled Structure Flexibility Matrix for the Plane Frame ................... 106
3.5 Action Transformation Matrix for the Plane Frame ..................................... 107
3.6 Fixed-End-Actions on the Members of the Grid Structure .......................... 114
3.7 Action Transformation Matrix for the Grid Structure .................................. 116
3.8 Action Transformation (BMS ) Matrix for the Space Frame Structure .......... 127
3.9 Displacement Transformation Matrix for the 6 Bars Truss .......................... 146
3.10 Displacement Transformation Matrix for the Beam..................................... 155
3.11 Displacement Transformation Matrix for the Plane Frame .......................... 164
3.12 Fixed-End-Actions on the Members of the Grid Structure .......................... 170
3.13 Unassembled Stiffness Matrix of the Three-Members Grid......................... 172
3.14 Displacement Transformation Matrix for the Grid Structure ....................... 173
3.15 Compatibility Matrix for the Space Frame Structure ................................... 185
4.1 Total Fixed-End-Actions on the Beam ......................................................... 223
4.2 Global DOFs of the Truss, Connectivity Matrix .......................................... 233
4.3 Total Fixed-End-Actions on the Plane Frame............................................... 245
4.4 Final Member-End-Actions ......................................................................... 247
4.5 Fixed-End-Actions on the Members of the Grid Structure .......................... 254
4.6 Final Member-End-Actions ......................................................................... 256
4.7 Global DOFs of the Truss, Connectivity Matrix .......................................... 260
4.8 Global DOFs of the Space Frame, Connectivity Matrix .............................. 270
4.9 Transformation Angles (in Degrees) of the Space Frame ............................ 271
5.1 Global DOFs of the Frame, Connectivity Matrix ......................................... 285
6.1 Approximating π from Inscribed Regular Polygons .................................... 321
7.1 Nodal Stresses of the Two-LSTs Plate ......................................................... 399
7.2 Gauss Quadrature Nodes and Weights.......................................................... 420
7.3 Numerical Integration Using Gauss Quadrature in 1D................................. 421
7.4 Numerical Integration Using Gauss Quadrature in 2D................................. 423
xxi
Section I
MATRIX STRUCTURAL ANALYSIS
1 Introduction
At the end of this chapter, the reader will be able to:
• Classify structures based on the number of unknown actions and displace-
ments
• Differentiate between classical and matrix methods of structural analysis
and describe the main difference between the flexibility and stiffness meth-
ods
• Define and compute the flexibility and stiffness coefficients
• Determine the flexibility and stiffness matrices of members and simple
structures
• Use the Scilab or Octave software environments for matrix computations
1.1 STRUCTURAL CLASSIFICATION
The determination of reaction forces, member forces and the accompanying struc-
tural deformations are studied under structural analysis. It is performed on all engi-
neering structures usually during the inception and design stages of the structure’s
life. Matrix structural analysis (MSA) is concerned with the analysis of prismatic
structures – those that are made of long members with uniform and relatively small
cross-sectional dimensions and interconnected to each other at joints (nodes).
Prismatic structures are further classified based on how external action/loads are
carried by the members internally. Accordingly, there are the following classes of
prismatic structures.
1.1.1 PLANE TRUSS
All members and the corresponding loading of a plane truss lie in the same plane, see
Figure 1.1(a). A truss element carries only an axial force, since the joints are assumed
to be friction less. The joints of a plane truss structure have two possible independent
displacement components within the plane of the truss (translations along the global
x and y directions).
1.1.2 BEAM
Both shear force and bending moment are assumed to exist in each element of a
beam. Figure 1.1(b) shows a beam and the internal forces of a beam element. The
joints of a beam have two possible displacement components – transverse displace-
ment, which is translation normal to the beam axis and rotation about the normal to
the plane of the beam.
DOI:10.1201/9781003329350-2 3
4 Matrix Structural Analysis and the Finite Element Methods
FIGURE 1.1 Classification of Prismatic Structures: (a) Plane Truss, (b) Beam,
(c) Plane Frame, (d) Grid Structure, (e) Space Truss and (f) Space Frame.
Introduction 5
1.1.3 PLANE FRAME
A plane frame is a structure made up of members rigidly connected at the joints.
Internally, the members are assumed to be subjected to axial force shear force and
bending moment. All members and the corresponding loading of a plane frame lie
in the same plane; see Figure 1.1(c). The joints of a plane frame have three possible
displacement components (translation along the global x, translation along the global
y and rotation about the normal to the plane of the frame).
1.1.4 GRID
Like a plane frame structure, a grid is also a structure made up of members rigidly
connected at the joints. All members of a grid structure lie in the same plane, however
it is subjected to transverse loading that causes the grid to experience an out-of-
plane bending. Internally, the members are assumed to be subjected to a shear force,
a torsion and a bending moment, as shown in Figure 1.1(d). The joints of a grid
structure have three possible displacement components (translation along the global
z (normal to the plane of the grid), rotation about x and y axes where x–y is the plane
of the grid).
1.1.5 SPACE TRUSS
Like in a plane truss, elements of a space truss are connected at frictionless joints and
the members carry only axial forces. The elements and loading of a space truss are
oriented freely in three dimensions, as shown in Figure 1.1(e). The joints of a space
truss structure have three possible displacement components (translations along the
three global coordinates).
1.1.6 SPACE FRAME
The most complex type of prismatic structure is the space frame. A space frame el-
ement is supposed to carry all six types of actions, namely an axial force, two shear
forces, a torsional moment and two bending moments; see Figure 1.1(f). The ele-
ments and loading of a space frame are oriented freely in three dimensions, as shown
in Figure 1.1(f). The joints of a space frame structure have six possible displacement
components (translations along and rotations about the three global coordinates).
1.2 STATIC/KINEMATIC INDETERMINACY
Structures can be classified into different categories based on the number of reac-
tion and member forces or displacement components that occur in a structure for
structural analysis purposes. The well-known static and kinematic classifications are
based on counting the number of reactions and free joint displacement in the struc-
ture. In MSA, it is important to adopt a classification that ranges from completely
restrained to unrestrained, as depicted in Table 1.1.
6 Matrix Structural Analysis and the Finite Element Methods
TABLE 1.1
Structural Classification
MSA Static Kinematic Reactions/Displacements
Completely Indeterminate Determinate All joints are completely restrained,
restrained no nodal movements are allowed.
Over- Indeterminate Indeterminate More than sufficient displacement
restrained components are restrained, some
nodal movements are allowed.
Sufficiently Determinate Indeterminate Minimum number of reaction
restrained forces are provided to maintain
structural stability and equilibrium.
Under- Unstable Unstable Not enough reactions are provided,
restrained structure becomes unstable.
Unrestrained Unstable Unstable All joints are completely free, struc-
ture is unstable.
Definition 1.1 (Static Indeterminacy) The static indeterminacy of a structure is the
number of unknown force components (actions) that exceed the number of available
equilibrium equations, also known as the degree of static indeterminacy.
A structure that is not completely restrained will have some free (unrestrained)
joint displacements. These unknown displacement components of a structure are re-
ferred as the degrees of freedom.
Definition 1.2 (Kinematic Indeterminacy) The kinematic indeterminacy of a struc-
ture is the number of unknown displacement components of a given structure, also
known as a degree of freedom.
The static indeterminacy of a sufficiently restrained structure is equals zero; like-
wise, the kinematic indeterminacy of a completely restrained structure is also zero.
Example 1.1 Determine the static and kinematic indeterminacies of each of the
structures shown in Figure 1.1.
SOLUTION
The truss in (a):
The number of members, m = 11
The number of external (support) reaction forces, r = 5
The number of joints, j = 6
Static classification
The total available joint equilibrium equations is 2 × j = 12, to be compared with
the total unknown actions, which is m + r = 16. Since the unknown forces are more
that the available equilibrium equations by 16 − 12 = 4, the plane truss is statically
indeterminate to the 4th degree.
Introduction 7
Kinematic classification
Unless restrained, every joint of a plane truss has two degrees of freedom (i.e., a
joint can move both in the X- and Y-axis). Total possible DOFs of the plane truss are
2 × j = 12, of which five are restrained (at the roller and two pin supports). Hence,
the given plane truss is kinematically indeterminate to the 12 − 5 = 7th degree.
The beam in (b):
The number of members, m = 2
The number of external (support) reaction forces, r = 4
The number of joints, j = 3
Static classification
The total available joint equilibrium equations (i.e., ∑ Fx = 0, ∑ Fy = 0, ∑ M = 0)
equals 3 × j = 9; to be compared with the total unknown actions (a beam member
can carry axial, shear and moment), which equals 3 ×m + r = 10. Since the unknown
forces are more that the available equilibrium equations by 10 − 9 = 1, the beam is
statically indeterminate to the 1st degree.
Kinematic classification
Assuming the axial movements are ignored, joints in a beam structure have two de-
grees of freedom (i.e., transverse displacement and rotation). Total possible DOFs of
the beam are 2 × j = 6; of which three are restrained (at the two rollers and the pin
supports). Hence, the given beam is kinematically indeterminate to the 6 − 3 = 3rd
degree.
Note: If axial displacement has to be considered, the kinematic indeterminacy be-
comes 3 + 2 = 5th degree, i.e., adding the two horizontal movements of the roller
supports.
The plane frame in (c):
The number of members, m = 10
The number of external (support) reaction forces, r = 9
The number of joints, j = 9
Static classification
The total available joint equilibrium equations (∑ Fx = 0, ∑ Fy = 0, ∑ M = 0) equals
3 × 9 = 27; to be compared with the total unknown actions (a plane frame member
can carry an axial-force, a shear-force and a bending moment), which equals 3×m+
r = 39. Since the unknown forces are more that the available equilibrium equations
by 39 − 27 = 12, the plane frame is statically indeterminate to the 12th degree.
Kinematic classification
The joints in a plane frame structure have three degrees of freedom (i.e., two linear
displacement in the X- and Y-direction and rotation). Total possible DOFs of the
plane frame are 3 × j = 27; of which nine are restrained (at the fixed supports).
Hence, the given plane frame is kinematically indeterminate to the 27 − 9 = 18th
degree.
8 Matrix Structural Analysis and the Finite Element Methods
The grid structure in (d):
The number of members, m = 12
The number of joints, j = 9
The number of support reaction forces, r = 6 (the six vertical reactions at the pins);
or r = 18, three reactions at each pin support as a space frame structure.
Static classification
The total available joint equilibrium equations (sum of forces about Z = 0 and sum
of moments about both X- and Y-axis = 0) equals 3 × 9 = 27, to be compared with the
total unknown actions (a grid member can carry three forces: shear forces, a torque
and a bending moments), which equals 3 × m + r = 36 + 6 = 42. Since the unknown
forces are more that the available equilibrium equations by 42 − 27 = 15; hence, the
grid is statically indeterminate to the 15th degree.
Alternatively, the static classification of a grid structure can also be performed
similar to a space frame. The total available joint equilibrium equations (three
forces- and three moments-equilibrium about X-, Y- and Z-axis, respectively) equals
6 × 9 = 54, to be compared with the total unknown actions (a grid member can carry
six forces: three forces and three moments), which equals 6 × m + r = 90. Since the
unknown forces are more that the available equilibrium equations by 90 − 54 = 36;
hence the grid is statically indeterminate to the 36th degree.
Kinematic classification
The joints in a grid structure have three degrees of freedom (neglecting the in-plane
displacement and the rotation about the normal to the plane of the grid). Total pos-
sible DOFs of the grid are 3 × j = 27; of which six are restrained (transverse dis-
placements at the pin supports). Hence, the given plane frame is kinematically inde-
terminate to the 27 − 6 = 21st degree.
If all possible displacements were to be considered, the kinematic indeterminacy
becomes 6 × j − 6 × 3 = 54 − 18 = 36th degree.
The space truss in (e):
The number of members, m = 16
The number of joints, j = 9
The number of support reaction forces, r = 12, three reactions at each pin support.
Static classification
The total available joint equilibrium equations equals 3 × j = 27, to be compared
with the total unknown actions (a grid member can carry six forces: three forces and
three moments), which equals m+r = 28. Since the unknown forces are more that the
available equilibrium equations by 28 − 27 = 1; hence, the space truss is statically
indeterminate to the 1st degree.
Kinematic classification
The joints in a space truss structure have three degrees of freedom. Total possible
DOFs of the space truss are 3 × j = 27; of which twelve are restrained (at the pin
Introduction 9
supports). Hence, the given plane frame is kinematically indeterminate to the 27 −
12 = 15th degree.
The space frame in (f):
The number of members, m = 16
The number of joints, j = 12
The number of support reaction forces, r = 24, three reactions at each pin support.
Static classification
The total available joint equilibrium equations (three forces- and three moments-
equilibrium about X-, Y- and Z-axis, respectively) equals 6 × j = 72, to be compared
with the total unknown actions (a grid member can carry six forces: three forces and
three moments), which equals 6 × m + r = 120. Since the unknown forces are more
that the available equilibrium equations by 120 − 72 = 48; hence, the space frame
is statically indeterminate to the 48th degree.
Kinematic classification
The joints in a grid structure have six degrees of freedom. Total possible DOFs of the
space frame are 6 × j = 72; of which 24 are restrained (all six displacements at the
fixed supports). Hence, the given space frame is kinematically indeterminate to the
74 − 24 = 50th degree.
Practically unstable structures are unusable, whereas completely restrained cases
are commonly not encountered. If the structure to be analyzed is statically determi-
nate, the reaction forces can be computed by using equilibrium equations alone. In
the analysis of indeterminate structures, both the classical and the matrix methods
employ the three principles of structural analysis listed below.
• Equilibrium: the structure and any part thereof shall be in equilibrium,
• Compatibility: the displacements are continuous and they are the same for
all members connected at a joint,
• Stress–strain relationship: the material behavior relates the actions to
the corresponding displacements in a structure. A linear-elastic analysis
(straight-line relationship between stress and strain) is assumed throughout
this book.
The classical methods of structural analysis, also known in a nutshell as a theory
of structures employ explicit techniques to analyze a given structure. The consistent-
deformation, the conjugate beam, the slope deflection, the cross method of moment-
distribution, and Kani’s methods are some of the methods that are considered clas-
sical methods. These topics are usually covered in undergraduate structural analysis
courses, providing techniques each of which is applicable respectively to a group of
structures possessing a specified set of properties and characteristics. A number of
these methods are iterative approximations of the exact solution. Some of the tech-
niques treated in the classical methods are essential in establishing the flexibility and
stiffness characteristics of structures for the matrix methods.
The topics from fundamental structural analysis that are recommended for revi-
sion are static and kinematic classification, analysis of determinate structures, slope-
10 Matrix Structural Analysis and the Finite Element Methods
deflection equation, and the virtual work method using additional readings from rel-
evant sources such as [27, 28, 47, 49, 51].
1.3 MATRIX STRUCTURAL ANALYSIS
In matrix methods for structural analysis, MSA, in short, characteristics of members
as well as those of the whole structure are described in matrix form, while the un-
known member forces, support reactions and nodal displacements can be obtained
using prescribed matrix operations [5, 35, 40]. Based on the primary type of un-
known considered in a given structural analysis problem, matrix methods can further
be classified into the flexibility and stiffness methods. In the flexibility method, the
primary unknowns are the redundant actions on the structure, while in the stiffness
method, the unknown nodal displacements of a structure are taken as the primary
unknowns.
1.3.1 THE FLEXIBILITY COEFFICIENT
In the flexibility method, the DOFs (degrees of freedom) are considered to be those
displacement components aligned1 with the redundant actions that need to been
removed to render the structure statically determinate. The number of DOFs in this
method usually corresponds to the static indeterminacy of the structure. In Figure 1.2,
the vertical reaction force RB can be considered as the primary unknown; see Fig-
ure 1.2(b). Removing RB results in a cantilever beam, which is statically determinate;
hence, the DOF in this case would be the vertical displacement of the cantilever beam
at B. In this book, upward displacements and counterclockwise rotations in beams
are conventionally assumed to be the positive displacement directions.
Definition 1.3 (Flexibility Coefficient) The flexibility coefficient fi j is defined as
the displacement (linear or rotational) along the DOF i, that is, caused by a unit
action (force or moment) applied along DOF j.
Flexibility coefficients, of statically determinate structures, can be computed us-
ing basic relationships studied under theory of structures. Specifically, one has to
apply a unit action along the jth DOF and compute the corresponding displacement
along the ith DOF, which would then be the flexibility coefficient fi j . In Figure 1.3(a),
the given beam is indeterminate to the third degree. The vertical reactions at B and
C as well as the moment reaction at D are considered as the primary unknowns; the
corresponding DOFs are the vertical displacement at B and C as well as the rotation
at D, identified as 1, 2 and 3, respectively, as shown in Figure 1.3(b). In Figure 1.3(c),
(d) and (e), unit actions have been applied along the three DOFs, respectively, and
the flexibility coefficients along each of the three DOFs were determined.
The flexibility coefficients of the beam in Figure 1.3 – nine coefficients altogether
– are computed as displacements at the three DOFs, due to unit actions at those
DOFs. Out of these coefficients, f11 , f22 and f33 are said to be aligned since the unit
load and the displacement sought are along the same DOF.
1 Action and displacement are said to be aligned if they are at the same point and in the same direction.
Introduction 11
FIGURE 1.2 Primary Unknowns in the Flexibility and the Stiffness Methods:
(a) The given structure, (b) The vertical reaction force at B is taken as the pri-
mary unknown in the flexibility method and (c) The rotation of the beam at B is the
primary unknown in the stiffness method.
FIGURE 1.3 Flexibility Coefficients: (a) The given structure, (b) The three DOFs
considered, (c) Unit action along DOF-1, (d) Unit action along DOF-2 and (e) Unit
action along DOF-3.
12 Matrix Structural Analysis and the Finite Element Methods
1.3.2 THE STIFFNESS COEFFICIENTS
In the stiffness method, the DOFs are the actual unknown displacement components
of the given structure, also referred to as the kinematic indeterminacy of the structure.
In Figure 1.2, the rotation at B is the unknown displacement, which is considered to
be the DOF of the given propped cantilever beam.
The three-span beam in Figure 1.4 has three unknown rotations at 1, 2 and 3, as
indicated in Figure 1.4(a). Unit rotations are applied along each of the three DOFs,
one at a time, as shown in Figure 1.4(b)–(d), respectively. The corresponding stiff-
ness coefficients were then determined along those three DOFs using equilibrium
requirements.
The stiffness coefficients of the beam in Figure 1.3 – totally nine coefficients –
can be computed as the actions needed at the three DOFs, in order to cause a unit
displacement at one of the DOFs, keeping all other DOFs restrained. s11 , s22 and s33
are said to be aligned since the unit displacement and the action sought are along the
same DOF.
Definition 1.4 (Stiffness Coefficient) The stiffness coefficient si j is defined as the
action (force or moment) that has to be applied along DOF i to cause a unit dis-
placement (linear or rotational, respectively) along DOF j, while keeping all other
displacements of the structure to zero.
For a given completely restrained (kinematically determinate) structure, the stiff-
ness coefficients of the structure corresponding to any specific DOF, can be computed
FIGURE 1.4 The Stiffness Coefficients
Introduction 13
using basic action-displacement relationships. This is performed by exerting a unit
displacement along the jth DOF and computing, from equilibrium, the necessary
actions along the ith DOF, to obtain the stiffness coefficient si j .
1.3.3 FLEXIBILITY AND STIFFNESS MATRICES
If a structure has n redundant actions to be removed to make it sufficiently restrained,
an n × n matrix of flexibility coefficients, known as flexibility matrix, could be estab-
lished as depicted in Equation (1.1). This matrix is an important characteristic of
the given structure that would be used in the flexibility method of MSA. Likewise,
for a structure that has n unknown displacement components, an n by n matrix of
stiffness coefficients, known as stiffness matrix, could be established, as shown in
Equation (1.1).
Some common characteristics of flexibility and stiffness matrices of a linear elas-
tic structure are as follows:
• For the same structure and a common set of DOFs, flexibility is the inverse
of stiffness and vice versa; F = S−1 and S = F −1
• For linear elastic structures the flexibility matrix is symmetric fi j = f ji ac-
cording to Maxwell’s reciprocal theorem [21, 31, 47]
• For linear elastic structures the stiffness matrix is also symmetric si j = s ji
because of the minimum-potential-energy principle [3, 20, 48]
• Values on the main diagonal of the flexibility as well as the stiffness ma-
trix should always be greater than 0, they can’t be 0 or negative (positive-
definite)
f11 f12 f13 s11 s12 s13
F = f21 f22 f23 S = s21 s22 s23 (1.1)
f31 f32 f33 s31 s32 s33
Example 1.2 Determine the 3 × 3 flexibility matrix of the continuous beam in Fig-
ure 1.3(b) if each of the three spans are of 1.5 length units and they have a constant
EI.
SOLUTION
Using the various displacement computation methods, one can determine the dis-
placements due to unit loads. The deflection formulae provided in Appendix could
alternatively be used to determine the various deflections. In this example, the vir-
tual work method is used to compute the flexibility coefficients, as follows.
Z
mi m j dx
fi j =
L EI
where: fi j = flexibility coefficient (i − j); displacement along i caused by a
unit action along j
mi = bending moment due to unit action along i
m j = bending moment due to unit action along j
14 Matrix Structural Analysis and the Finite Element Methods
The bending moment equations due to the various unit actions are provided in
the following equation.
Span m1 (P1 = 1) m2 (P2 = 1) m3 (M = 1)
0 ≤ x ≤ 1.5 −2x/3 −x/3 x/4.5
1.5 ≤ x ≤ 3 x/3 − 1.5 −x/3 x/4.5
3 ≤ x ≤ 4.5 x/3 − 1.5 2x/3 − 3 x/4.5
The flexibility coefficients f11 and f23 ( f32 ) are computed as follows.
Z
m1 · m1 dx
f11 =
L EI
Z 1.5
(−2x/3)2 dx Z 3 (x/3 − 1.5)2 dx Z 4.5 (x/3 − 1.5)2 dx
= + +
0 EI 1.5 EI 3 EI
81
=
4EI
m2 · m3 dx
Z
f23 = f32 =
L EI
Z 1.5
(−x/3) ∗ (x/4.5)dx Z 3 (−x/3) ∗ (x/4.5)dx
= +
0 EI 1.5 EI
Z 4.5
(2x/3 − 3) ∗ (x/4.5)dx
+
3 EI
27
=−
4EI
And the complete 3 × 3 flexibility matrix of the given beam is as follows.
f11 f12 f13 324 243 −108
1
f f22 f23 = 243 324 −108
F =
21 16EI
f31 f32 f33 −108 −108 72
Example 1.3 Determine the 3 × 3 stiffness matrix of the continuous beam in Fig-
ure 1.4(a) if each of the three spans are of 1.5 length units and they have a constant
EI.
SOLUTION
To cause only a unit rotation at one end of a fixed beam with span L and constant EI,
bending moments of ( 4EI 2EI
L ) and ( L ) are required at its near and far ends, respec-
Introduction 15
tively (see Fixed-End Actions in Appendix).
Accordingly, the stiffness coefficients S21 (S12 ) and s22 are computed by setting
θ2 = 1 as follows.
2EI 4EI
S21 = S12 = =
1.5 3
4EI 4EI 16EI
S22 = + =
1.5 1.5 3
Thus the complete 3 × 3 stiffness matrix of the given beam is shown below.
s11 s12 s13 8 4 0
EI
s s22 s23 = 4 16 4
S=
21 3
s31 s32 s33 0 4 8
1.4 SCILAB SOFTWARE ENVIRONMENT
Scilab is a free software for scientific computation and visualization. It provides a
command-line interface for user communication and contains a programming envi-
ronment and a set of tools that will expand its functionality. It can be downloaded
from the Scilab website; furthermore, an installation guide and getting-started tuto-
rials are available there. One can also refer to related online tutorials like the one
provided on the Scilab website at [11] and books such as [4, 18, 34].
Figure 1.5 shows the Scilab software environment. Menu bars and tool bars are
provided at the top, while the command window (Console) is docked to the left
and the SciNotes window (the code editor of Scilab) to the right. By default, Scilab
provides other windows like the file browser and variables browser windows, which
are not shown in Figure 1.5. For efficient use of the screen and the frequently used
parts for working with the contents of this book are the Console and the SciNotes.
Furthermore, the onscreen help window can be opened using the Help menu (?) on
the menu bar, which contains documentation of all the details about Scilab.
As a brief introduction, it is recommended to execute2 at the Scilab command
prompt for each of the statements provided in Listing 1.1. In the listing, there are
simple mathematical expressions, including a few built-in constants and functions,
followed by definitions of vectors and matrices, as well as how to perform different
mathematical operations on them. Note that any text on a line after // is a comment
and is ignored in Scilab. Immediate explanations and hints regarding the statements
in Listing 1.1 are provided in the form of such comments.
2 Statement(s) (lines) can be copied from the listing and pasted on the command prompt; by hitting
enter, the statement(s) can be executed.
16 Matrix Structural Analysis and the Finite Element Methods
FIGURE 1.5 The Scilab Software Environment
// This is a comment; single-line comments begin with //
// First-time users are advised to go through
// the "Getting-started" tutorial on Scilab Homepage
clear // Clear user defined variables from Scilab
// Mathematical expressions and calculations
9-3/(1/3)+1
-0.5^2+3.5/9 // x^y equals x raised to y
// Scilab contains built-in functions and constants
sqrt(2)+cos(%pi/3)
exp(-0.5^2) // e raised to -(0.5 squared)
// sqrt, cos, exp are built-in functions;
// %pi, %e are built-in constants
// Defining and using variables
n = 4, price = 30.65; c = "Total price = "
// Calculations using variables
d = n*price;
// Manipulating strings and displaying results
disp(c + string(d))
// COMPUTATION WITH VECTORS and MATRICES
Introduction 17
// Vectors and Matrices are to be
// enclosed in square brackets []
A = [1 2 3]
B = [4,3,2] // row vectors
// Space or comma separates each element in a row
C = [0.5; 1; 1.5] // use (;) for a new row
C1 = [0.5
1
1.5] // alternatively, new line used for new row
f = 2.05*A // multiply by a constant
S = A+B // addition, subtraction
dif = C-C1
At = A' // transpose a vector/matrix with (')
sc = A.*B // element wise product
s1 = sum(A) // add elements of a vector or matrix
s2 = A*B' // same as the dot product of vectors
rec = 1./B // element wise reciprocal
// Special vectors
a = [-1.5:4] // generates [-1.5,0.5,1.5,2.5,3.5];
// Column (":") is a range operator
// [x:y] = [x, x+1, ..., x+n]; where n = int(y - x)
b = [1:0.5:3.1] // results in [1,1.5,2,2.5,3]
// [x:r:y] = [x, x+r, x+2r ..., x+nr];
// where n = int((y-x)/r)
x = linspace(0,9,5) // results in [0, 2.25, 4.5, 6.75, 9]
// linspace(a,b,n) create an array of n
// equally spaced elements between a and b, inclusive
// MATRICES AND MATRIX OPERATIONS
A = [1 2 3 -5; 4,3,2 1; 0 -1 3, 2] // 3x4 matrix
// Sub-matrices can be created using range operator
s1 = A(1:2,2:3) // row 1 to 2; column 2 to 3 of A
s2 = A(1,:) // first row of A
s3 = A(:,3) // 3rd column of A
sz = size(A) // size of a matrix
D = diag(A) // the diag function in this case
// gives a column vector containg
// the main diagonals of A
// A*A would be illegal, unless A is square matrix
A(:,3) = [] // emptying (deleting) the 3rd column
// the size of matrix A is reduced
18 Matrix Structural Analysis and the Finite Element Methods
s2 = size(A) // gives 3x3
// Some matrix operations need compatible dimensions
e = A.*A // element-wise product of matrices;
S = A^2 // power of a matrix
d = det(A) // determinant of a matrix
Ainv = inv(A) // inverse of a matrix
A = [1 2 3 -5; 4,3,2 1; 0 -1 3, 2]
B = [-1 2.5 3; 1 1, 1]; // a 2x3 matrix
C = B*A; // matrix product
d = c - 2*B; // Error, c is not defined
// Scilab is case sensitive
// (c is not the same as C)
big1 = [A ; B] // Augmenting matrices into one
big2 = [A B']
// In big1 B is augmented column-wise to A, size = 5x3
// In big2 B' is augmented row-wise to A, size = 3x5
// Special matrices
cero = zeros(3,2) // a 3 by 2 matrix of all zeros
wan = ones(2,3) // a 2 by 3 matrix of all ones
ai = eye(4,3) // a 4 by 3 identity matrix;
// ai(i,i) = 1, else 0
S = [1 -.5; -.5 1] // s symmetric matrix
X = [1 -2 0.5 3 0; 2 -1 1 3 1] // arbitrary matrix
Symm = X'*S*X // gives a symmetric matrix!
v = [1 2 -1]
dia = diag(v) // a square diagonal matrix,
// the matrix dia has its diagonal elements = v, all others = 0
R = rand(3,3) // matrix of random elements in (0,1)
sym = R*inv(R) // Identity matrix expected
v = clean(sym) // discard very small values to zero
// Solution of simultaneous equations
b = [-1; 2.4; 3]
// To solve for A*x = b, use
sola = inv(A)*b // solution using the inverse function
solb = A \ b // or using \ (backslash) operator
Listing 1.1 Simple Computation in Scilab
Introduction 19
1.5 OCTAVE SOFTWARE ENVIRONMENT
Octave, also known as GNU Octave, is a high-level programming language primar-
ily intended for numerical computations. It is used for solving linear and nonlinear
equations, numerical linear algebra, statistical analysis and for performing other nu-
merical experiments [10]. It is open-source and available for any operating system.
It can be downloaded and installed from [46].
The Octave user interface is shown in Figure 1.6. Menu bars and tool bars are pro-
vided at the top, while the Console window is docked to the left and the Code Editor
window to the right. The onscreen help is also provided behind the command win-
dow. After installation, the default configuration of the Octave user interface looks
different, providing other windows like the file- and variable-browser windows. Most
of these components are closed in Figure 1.6 for efficient use of the screen. The
Console and the Code-editor are the most important windows for working with the
content of this book. Further readings are provided in these selected books [6, 33].
Listing 1.2 provides a brief introduction to the Octave software environment. It
is recommended that each statement provided in the listing be executed at the Octave
command prompt and the resulting output studied. It contains simple mathematical
expressions, including a few built-in constants and functions, followed by definitions
of vectors and matrices, as well as how to perform different mathematical operations
on them. Note that any text on a line after # or % is a comment and ignored in
Octave. Immediate explanations and hints regarding the statements in Listing 1.2 are
provided in the form of such comments.
% This is a comment; single-line comments begin with % or #
FIGURE 1.6 The Octave Software Environment
20 Matrix Structural Analysis and the Finite Element Methods
% First-time users are advised to go through
% the "Getting-started" tutorial on Octave Homepage
clear % Clear user defined variables from Octave
% Mathematical expressions and calculations
9-3/(1/3)+1
-0.5^2+3.5/8 % x^y equals x raised to y
% Octave contains built-in functions and constants
sqrt(2)+cos(pi/3)
exp(-0.5^2) % e raised to -(0.5 squared)
% pi, e are built-in constants
% sqrt, cos, exp are built-in functions;
% sin/cos/tan take angles in radian;
% sind, cosd are trig. functions taking angles in degree
% Defining and using variables
n = 4, price = 30.65; str = "Total price"
% Calculations using variables
d = n*price;
% Manipulating strings and displaying results
disp(strcat(str, " = ", num2str(d)))
% disp - to display; strcat - to concatenate;
% num2str - to convert number to string
% COMPUTATION WITH VECTORS and MATRICES
% Vectors and Matrices are to be
% enclosed in square brackets []
A = [1 2 3]
B = [4,3,2] % row vectors
% Space or comma separates each element in a row
C = [0.5; 1; 1.5] % use (;) for a new row
C1 = [0.5
1
1.5] % alternatively, new line used for new row
f = 2.05*A % multiply a matrix by a constant
S = A+B % matrix addition, subtraction
dif = C-C1
At = A' % transpose a vector/matrix with (')
sc = A.*B % element wise product
s1 = sum(A) % add elements of a vector or matrix
s2 = A*B' % same as the dot product of vectors
Introduction 21
rec = 1./B % element wise reciprocal
% Special vectors
a = [-1.5:4] % generates [-1.5,0.5,1.5,2.5,3.5];
% Column (":") is a range operator
% [x:y] = [x, x+1, ..., x+n]; where n = int(y - x)
b = [1:0.5:3.1] % results in [1,1.5,2,2.5,3]
% [x:r:y] = [x, x+r, x+2r ..., x+nr];
% where n = int((y-x)/r)
x = linspace(0,9,5) % results in [0, 2.25, 4.5, 6.75, 9]
% linspace(a,b,n) create an array of n
% equally spaced elements between a and b, inclusive
% MATRICES AND MATRIX OPERATIONS
A = [1 2 3 -5; 4,3,2 1; 0 -1 3, 2] % 3x4 matrix
% Sub-matrices can be created using range operator
s1 = A(1:2,2:3) % row 1 to 2; column 2 to 3 of A
s2 = A(1,:) % first row of A
s3 = A(:,3) % 3rd column of A
sz = size(A) % size of a matrix
D = diag(A) % the diag function in this case
% gives a column vector containg
% the main diagonals of A
% A*A would be illegal, unless A is square matrix
A(:,3) = [] % emptying (deleting) the 3rd column
% the size of matrix A is reduced
s2 = size(A) % gives 3x3
% Some matrix operations need compatible dimensions
e = A.*A % element-wise product of matrices;
S = A^2 % power of a matrix
d = det(A) % determinant of a matrix
Ainv = inv(A) % inverse of a matrix
A = [ 2 3 -5; 4,3,2 ; -1 3, 2]
B = [-1 2.5 3; 1 1, 1]; % a 2x3 matrix
C = B*A; % matrix product
d = c - 2*B; % Error, c is not defined
% Octave and Octave are case sensitive
% (c is not the same as C)
big1 = [A ; B] % Augmenting matrices into one
big2 = [A B']
% In big1 B is augmented column-wise to A, size = 5x3
22 Matrix Structural Analysis and the Finite Element Methods
% In big2 B' is augmented row-wise to A, size = 3x5
% Special matrices
cero = zeros(3,2) % a 3 by 2 matrix of all zeros
wan = ones(2,3) % a 2 by 3 matrix of all ones
ai = eye(4,3) % a 4 by 3 identity matrix;
% ai(i,i) = 1, else 0
S = [1 -.5; -.5 1] %% s symmetric matrix
X = [1 -2 0.5 3 0; 2 -1 1 3 1] %% arbitrary matrix
Symm = X'*S*X %% gives a symmetric matrix
v = [1 2 -1]
dia = diag(v) % a square diagonal matrix,
% the matrix dia has diagonal elements = v, all others = 0
R = rand(3,3) % matrix of random elements in (0,1)
id = R*inv(R) % Identity matrix expected
v = num2str (id, "%5.1f") % convert small values to zero
% Solution of simultaneous equations
b = [-1; 2.4; 3]
% To solve for A*x = b, use
sola = inv(A)*b % solution using the inverse function
solb = A \ b % or using \ (backslash) operator
Listing 1.2 Simple Computation in Octave
1.6 PROGRAMMING IN SCILAB AND OCTAVE
Programming is preparing a series of computer code (statements) to accomplish a
specific task. Both Scilab and Octave environments have many similar programming
features. The program code is written using the code editor and will be saved in a file.
Commonly, filenames with a file extension of .sci or .sce are associated with Scilab as
program files, while in Octave the file extension .m is used. After that the code in the
file is executed within the Scilab or Octave environment, respectively. Unlike some
other programming languages, no code compilation process is needed. If there’s any
syntax error (mistakes in the code), the program execution stops after displaying the
specific error message; otherwise, the program runs and finishes executing all the
statements sequentially.
The following set of programming elements and features apply to Scilab and
Octave; any discrepancy will be pointed out as it is encountered. Only a limited
number of features are discussed here that would be relevant to comfortably working
with the concepts in this book. The respective manuals and references can also be
used for additional information [4, 10, 17, 33, 34].
Introduction 23
TABLE 1.2
Common Operators in Scilab/Octave
Symbol Rank
Bracket () 1st
Transpose and exponent ' ∧ ** .∧ .** 2nd
Unary plus/minus, not + - ~ 3rd
Multiplication, division * / \ .* ./ 4th
Addition, subtract + - 5th
Relational < <= == >= > ~= 6th
Logical (and/or) || && 7th
Assignment = 8th
1.6.1 OPERATORS AND THEIR PRECEDENCE
A statement or a command is usually a line of computer code that can be executed
giving some output. Statements are constructed using variables and operators. Some
of the most common operators are shown in Table 1.2 according to their precedence
(rank). In any statement, brackets are to be handled first, while assignment comes
last. Those operators in the same rank will be executed left to right, so brackets
should be used to maintain the actual purpose of the statement.
1.6.2 VARIABLES
A variable is a character or set of characters (like A, var1, A_Somewhat_Very_Long_
Variable_Name, etc.) used as an identifier (name) intended to hold some value in
a given computational code. Variables can be assigned any type of value (numeri-
cal, string, boolean, array or matrix, etc.). In both Scilab and Octave environments,
a variable is assumed to be a matrix before it is assigned a specific value. In creating
variable names (variables), it is necessary to follow the rules listed below:
• Variables are case sensitive, A and a are different
• Must start with an alphabet A ... Z, a ... z, or underscore (_)
• Should contain only alphabets, numbers and underscore
• Avoid using reserved words or functions as variable name like or, sin, sqrt,
...
• Should not contain operators and special characters like :, $, ∧, *, &, ...
• The length is practically unlimited, but it is helpful to use shorter and mean-
ingful variable names
1.6.3 DATA TYPES
The basic built-in data types are numeric (integer and decimal numbers with single/-
double precision), character (string) and boolean (true or false). Variables need not
be declared to hold specific data types; they are dynamically switched to the type of
24 Matrix Structural Analysis and the Finite Element Methods
value they are assigned in a given program statement. When defining a vector/matrix,
all the individual elements need to be of or convertible to the same data type.
• A = [1 2.354 sqrt(3)] is acceptable
• B1 = [1 %T] in Scilab, B2 = [1 true] in Octave is acceptable
• C = ["Name:", "Habte"; "from:", 'AAiT'; 'year:', "2023"] is
acceptable; single or double quote is used for string constants
• D1 = ["T and", %F] (Scilab) and D2 = ["2^2= ", 2^2] do not
work
Note that the boolean constants are (%T / %F) in Scilab and (true / false)
in Octave. As it could be seen by executing the assignment statements B1 and B2
above, true is internally converted to a numerical value of 1; false to 0.
1.6.4 EXPRESSIONS AND STATEMENTS
Any combination of numbers, user-defined variables, operators, built-in constants/-
functions, etc., is defined as an expression. A program statement is written by putting
such expressions together to perform specific computer instructions. The most com-
mon statement is the assignment statement (=). In this case, the left-hand side of the
= sign should always be a variable, and whatever is the result of the expression on
the right-hand side is assigned to the variable on the left. Note that = has the lowest
rank in the operators list in Table 1.2. The code Listings 1.1 and 1.2 provided in the
earlier sections are full of assignment statements. In the following sections, some of
the essential flow control statements used to structure and organize a program are
explained.
1.6.5 If/Else STATEMENT
An if statement is conditional with the general form shown in the code below.
if EXPR1
STATEMENT(S)-1
elseif EXPR2
STATEMENT(S)-2
....
else
STATEMENT(S)-n
end
EXPR1, EXPR2, ... are conditional expressions like i < 5, A == b, ...
that evaluate to either true or false. Hence, if EXPR1 is true, then the program will ex-
ecute the corresponding statement or sets of statements (STATEMENT(S)-1) and then
go to the end expression to finish the if statement. Otherwise, successive elseif
expressions are tested and the program will execute the particular statement or sets
of statements (STATEMENT(S)-i) that correspond to the EXPRi, whichever evaluates
to true. However, if none of the EXPRi is true, the last statement (STATEMENT(S)-n)
Introduction 25
corresponding to else will be executed. It is not required to have an elseif or else
statement in an if statement; the following if statements are both acceptable.
a) if EXPR2
STATEMENT(S)-1
else
STATEMENT(S)-2
end
b) if EXPR STATEMENT(S) end
1.6.6 While STATEMENT
A while statement is a loop that executes the statement(s) in the body after testing the
given conditional expression. The code below shows the structure of a while state-
ment with a conditional expression EXPR. If the value of EXPR equals or evaluates to
true, then the program executes STATEMENT(S). This is performed repeatedly until
EXPR becomes false, at which time, the program goes to the end expression to finish
the while statement.
while EXPR
STATEMENT(S)
end
Here is a brief example that adds positive integers up to 10. The final result,
which is displayed as the output of the sum is 55.
sum2ten = 0; i = 0;
while i <= 10
sum2ten = sum2ten + i;
i = i + 1;
end
disp(sum2ten)
1.6.7 For STATEMENT
The for statement is another loop statement. Unlike the while statement, the state-
ment(s) inside a for loop will be executed a known number of times. The following
code shows the general structure of a for loop. EXPR is usually an array created us-
ing the colon operator (:), like 1:10, which means the ten integer values (1,2,3,...,10).
Every time the loop is executed, each value in the EXPR will be assigned to the var
variable, sequentially starting with the first. Then, the STATEMENT(S) block is ex-
ecuted for each case.
for var = EXPR
STATEMENT(S)
end
26 Matrix Structural Analysis and the Finite Element Methods
The code below shows the for loop in action to add the numbers up to 10, which
gives the same result as shown earlier in the case of the while statement.
sum2ten = 0;
for i = 1:10
sum2ten = sum2ten + i;
end
disp(sum2ten)
1.6.8 BRANCHING/CASE STATEMENTS
A branching statement is another code construct used to structure a program. It
is usually used instead of an if statement with several elseif parts. The codes
listing shown below provides the general structure of a branching statement in
both Scilab and Octave. With the exception of the keywords select/switch and
else/otherwise, they both are identical.
Scilab Octave
select EXPR switch EXPR
case ID -1 case ID -1
STATEMENT ( S ) -1 STATEMENT ( S ) -1
case ID -2 case ID -2
STATEMENT ( S ) -2 STATEMENT ( S ) -2
... ...
else otherwise
STATEMENT ( S ) - n STATEMENT ( S ) - n
end end
When running a branching statement, if the program finds an ID-i that equals
the given EXPR, the program executes the STATEMENT(S)-i under the particu-
lar ID-i case. Then, it goes to the end expression to finish the branching. Suppose
none of the ID-s match the expression (EXPR). In that case, the statement under the
else/otherwise case will be executed, if such a case exists (an else/otherwise
statement within a branching statement is optional). The following code gives an
example of the branching statement in action.
Introduction 27
Scilab Octave
AE = 1; L = 2; AE = 1; L = 2;
EI = 1; EI = 1;
elmt = 'BEAM'; elmt = 'TRUSS';
select elmt switch elmt
case 'TRUSS' case 'TRUSS'
f = L/AE; f = L/AE;
case 'BEAM' case 'BEAM'
f = [L^3/3 L^2/2 f = [L^3/3 L^2/2
L^2/2 L]/EI; L^2/2 L]/EI;
else otherwise
disp("Unknown type!") disp("Unknown type!")
end end
1.6.9 USER-DEFINED FUNCTIONS
Scilab and Octave have many predefined built-in functions like sin(), inv(), etc.
However, it is sometimes necessary to write one’s own functions that are used to
perform specific tasks. User-defined functions help to better organize a program,
increase re-usability and avoid code repetition. They are defined in a separate file or
together with other code. The general structure of a user-defined function is given in
the code shown below.
function[OUT1, OUT2, ...] = funcName(VAR1, VAR2, ...)
STATEMENT(S)
OUT1 = STATEMENT-1
OUT2 = STATEMENT-2
...
STATEMENT(S)
end
A user defined function contains the following parts:
• The keyword function
• Optional return value(s) OUT1, OUT2, ...
• Name of the function funcName that’ll later be used to call it in a program
• Optional input value(s) VAR1, VAR2, ...
• The closing key word end
Once a user function is defined, it can be called and used by its name (funcName),
just like other built-in functions. Here is an example of a user-defined function that
takes the (x,y) Cartesian coordinates of two points as input variables, then computes
and returns the length and the direction cosines of the line segment from point-1 to
point-2 as outputs.
1 function[L, c, s] = getLengthCS(p1, p2)
2 X = [p1(1) p2(1)]; Y = [p1(2) p2(2)];
28 Matrix Structural Analysis and the Finite Element Methods
3 L = sqrt((X(2)-X(1))^2 + (Y(2)-Y(1))^2);
4 c = (X(2)-X(1))/L;
5 s = (Y(2)-Y(1))/L;
6 end
7 -- a comment in Scilab
8 // Coordinates of the two points p1 and p2
9 -- a comment in Octave
10 %% Coordinates of the two points p1 and p2
11 point1 = [2,5]; point2 = [5,9];
12
13 [Length, Cos, Sin] = getLengthCS(point1, point2)
14
15 // Using the resulting output -- a comment in Scilab
16 %% Using the resulting output -- a comment in Octave
17 disp("The length from point-1 to point-2 is:"),
18 disp(Length)
19 disp("Cosine of the angle from X to line p1-p2 is:")
20 disp(Cos);
21 disp("Sine of the angle from X to line p1-p2 is:")
22 disp(Sin);
The function is defined in lines 1–6. Comments are provided in lines 7–10; use
the appropriate one for your platform. The two points are defined in line 11 and the
function is called with the two points as parameters in line 13. The three results are
saved in the vector of variables Length, Cos and Sin for further usage.
1.6.10 SIMPLE FILE INPUT/OUTPUT
Scilab and Octave have several built-in functions that can be used to read and write
files. In the codes below, the simplest functions are provided to store the contents of
a numeric matrix into an external file as well as to read the content of such a file.
Scilab Octave
write ( outfile , VAR ); dlmwrite ( outfile , VAR );
X = read ( infile ,r , c ); X = dlmread ( infile );
In Scilab, the read function requires the number of rows and columns of data
to be read from the file; if the size is unknown, use read(infile,-1) to read the
whole file. The outfile and infile are strings of the corresponding file names to write to
as well as to read from, respectively. These files must contain the full path unless the
files are placed in the same directory as the program using them. VAR is the variable
(matrix) whose content is to be written, while the contents of the infile are assigned
to the new variable X. Here is a simple file input/output example.
Introduction 29
Scilab Octave
ks = 20; ks = 20;
k = ks *[1 -1; -1 1]; k = ks *[1 -1; -1 1];
write ( ' k1 . txt ' ,k ); dlmwrite ( ' k1 . txt ' ,k );
k1 = read ( ' k1 . txt ' ,2 ,2); k1 = dlmread ( ' k1 . txt ' );
1.7 PROBLEMS
1.1 For the truss shown in Figure 1.1(a), determine the static and kinematic inde-
terminacy if (a) (any) three of the diagonal members are removed and (b) the pin
support on the right is removed.
1.2 For the beam shown in Figure 1.1(b), determine the static and kinematic indeter-
minacy if (a) a hinge is introduced just to the left of the middle support, (b) the roller
support on the right is changed to a fixed support and (c) there are two overhanging
segments on both sides.
1.3 For the plane frame shown in Figure 1.1(c), determine the static and kinematic
indeterminacy if (a) hinges are introduced at all the middle (1st level) joints, (b)
hinges are introduced at all the top level joints, (c) all the fixed supports are pin
supports.
1.4 For the grid structure shown in Figure 1.1(d), determine the static and kinematic
indeterminacy if (a) all the pin supports are fixed, (b) a hinge is introduced at the
central node o.
1.5 Define flexibility coefficient fi j . What is the flexibility matrix of a given structure
and what are its characteristics?
1.6 Define stiffness coefficient si j . What is the stiffness matrix of a given structure
and what are its characteristics?
1.7 If a plane truss has 7 nodes, 8 members as well as 5 (properly arranged) support
reactions, determine its static and kinematic indeterminacy.
1.8 If a beam has 7 nodes, 6 members, 5 support reactions and also two condition
equations, determine its static and kinematic indeterminacy.
1.9 If a plane frame has 7 nodes, 8 members as well as 9 (properly arranged) support
reactions, determine its static and kinematic indeterminacy.
1.10 For the frame in Problem 1.9, determine the static and kinematic indeterminacy
if there are 3 more condition equations.
1.11 If a grid structure has 5 nodes, 6 members, 7 (properly arranged) support re-
actions and 2 condition equations, determine its static and kinematic indeterminacy.
30 Matrix Structural Analysis and the Finite Element Methods
1.12 If a space truss has 10 nodes, 15 members as well as 10 (properly arranged)
support reactions, determine its static and kinematic indeterminacy.
1.13 If a space frame has 10 nodes, 15 members as well as 15 (properly arranged)
support reactions, determine its static and kinematic indeterminacy.
1.14 If an action A applied to a linear elastic structure along DOF-1 causes a dis-
placement of d along DOF-2, then an action B applied to the same structure along
DOF-2 would cause a displacement of along DOF-1.
1.15 If the response of an elastic structure to an arbitrary action A1 is y1, and its
response to a second independent action A2 is y2, then the response to the combined
action (c*A1 + d*A2) would be (c + d)*(y1 + y2) for any constant values c and d.
This statement is true / false, choose the correct one.
1.16 Given a linear elastic continuous beam, consider the two arbitrary points N
and M such that if a downward force of 10 F applied at N causes point M to displace
an amount of 0.02 D upwards (take F and D as units of measurement for force and
displacement, respectively):
• the flexibility coefficient of the beam fMN equals ,
• the flexibility coefficient of the beam fNM equals ,
• the stiffness coefficient of the beam sMN equals ,
• the flexibility coefficient of the beam fNN equals ,
• an upward force of 5 F applied at M would cause a displacement of
at N.
For Problems 1.17–1.30 assume, constant material and cross-sectional properties
(E, A, I, G, J) unless otherwise stated.
1.17 For the spring system shown in Figure 1.7(a), compute the 3×3 flexibility matrix
along the given DOFs. What is the corresponding stiffness matrix?
1.18 For the spring system shown in Figure 1.7(b), compute the 2×2 flexibility matrix
along the given DOFs. What is the corresponding stiffness matrix?
1.19 For the bar system shown in Figure 1.7(c), compute the 2 × 2 flexibility matrix
along the given DOFs. What is the corresponding stiffness matrix?
1.20 For the bar system shown in Figure 1.7(d), compute the 2 × 2 flexibility matrix
along the given DOFs. What is the corresponding stiffness matrix?
1.21 For the beam shown in Figure 1.7(e), compute the 2 × 2 flexibility matrix along
the given DOFs.
1.22 For the beam shown in Figure 1.7(f), compute the 2 × 2 flexibility matrix along
the given DOFs.
Introduction 31
FIGURE 1.7 Problems Set 1: (a, b) Spring Systems; (c, d) Bar Elements; (e) Can-
tilever Beam; (f) Cantilever Beam with Variable Moment of Inertia; (g) Fixed-
Continuous Beam; (h) Fixed Beam; (i) Two Bars Plane Truss; (j) Three Bars Plane
Truss; (k) Two Members Cantilever Plane Frame; (l) Two Members Fixed-Supported
Plane Frame; (m) Two Members Cantilever Grid Structure; (n) Two Members Fixed
Grid Structure.
32 Matrix Structural Analysis and the Finite Element Methods
1.23 For the beam shown in Figure 1.7(g), compute the 2 × 2 stiffness matrix along
the given DOFs.
1.24 For the beam shown in Figure 1.7(h), compute the 2 × 2 stiffness matrix along
the given DOFs.
1.25 For the beam shown in Figure 1.7(i), compute the 2 × 2 flexibility matrix along
the given DOFs. What is the corresponding stiffness matrix?
1.26 For the beam shown in Figure 1.7(j), compute the 2 × 2 stiffness matrix along
the given DOFs.
1.27 For the plane frame shown in Figure 1.7(k), compute the 3 × 3 flexibility matrix
along the given DOFs.
1.28 For the plane frame shown in Figure 1.7(l), compute the 3 × 3 stiffness matrix
along the given DOFs.
1.29 For the grid structure shown in Figure 1.7(m), compute the 3 × 3 flexibility
matrix along the given DOFs. Take Ix = Iy = I.
1.30 For the grid structure shown in Figure 1.7(n), compute the 3×3 stiffness matrix
along the given DOFs. Take Ix = Iy = I.
Answer the following problems only in reference to programming using Scil-
ab/Octave.
1.31 Which of the following are legal variable names?
m24 first&second last iJ 3D _XYZ sin Sin A_or_B A+B but
1.32 Given:
A = [1 0 2;2 1 -3]; B = [3 0 7;5 1 2]; C = [ 1 1 -1]; D = 1:4
Before running any of the given matrix operations, determine the size of the result
of the following code; if operation is not legal, say undefined.
A.*B; A*A’; B.*C; A+4; [A;B]; A+[C;C]; A*C’; C*B; D.∧2; B-C
1.33 Given the matrices A, B, C and D as above, evaluate E = [[A;B] D’].
What will be the size of the result of the following statements?
E(:,1:3); E([1,4],2:4); det(A); sqrt(B); inv([A C]);
det(B’*A); square([A;C]); inv(E)
1.34 The result of each of the following command line statements is (True/False),
choose one.
a) 5 > 4 > 1
b) result = -20; 0 <= result <= 10
1.35 The variable name used to store the result of the last command (expression) in
the console is, by default .
Introduction 33
1.36 The expression cos(90) is equal to 0. (True/False)
1.37 What are semicolons (;) used for in programming?
1.38 What is the output of the following program code?
for i = 5:15
disp(i)
if (i == 8)
break
end
end
1.39 What is the output of the following program code?
i = 10
while (i > 2)
disp(i)
if (i < 5)
break
end
i = i - 1
end
1.40 Write a program statement to compute each of the following: (a) cosine of 45
degrees, (b) natural logarithm of 12, (c) 5 raised to the power of square root of 3, (d)
inverse tangent (arc tan) of 0.8 and (e) the length of the line joining two points (x1,
y1, z1) and (x2, y2, z2) in space.
1.41 What is the output of each of the following statements executed sequentially?
a) 5D-2, b) 2e3, c) I = -1:3:10, d) A=2/3*9/2; B=A*A/A*A
e) C=sind(30)+1/2; D=1-C, f) E=A+B*C-D g) X = 1; atan(X)
h) r = linspace(2,6,9); [m,i] = max(r)
1.42 Scilab / Octave is an interpreted language, it is slow compared to compiled
programming languages. (True/False)
1.43 Write a series of expressions/statements to ask for the name of the user, accept
from the console a sting as Name and output the name preceded with Welcome; like
Welcome Habte.
1.44 key combination is used to stop (interrupt) the execution of a program
code or a command?
1.45 How is a cell array used to store material and cross-sectional properties of a
truss, beam, grid or space frame element? How are these values accessed? Write the
corresponding code block(s).
34 Matrix Structural Analysis and the Finite Element Methods
1.46 Assume three points P1 at (x1, y1, z1), P2 at (x2, y2, z2) and P3 at (x3,
y3, z3) are given in a global coordinate system X −Y − Z. Consider another (local)
−−→
coordinate system x̂ − ŷ − ẑ having the same origin but with x̂ directed along P1 P2
and point P3 is on the ŷ − ẑ plane. Write a Scilab/Octave program to compute and
print out all the direction cosines cos(θJi ) in which J is any one of the global axis (X,
Y or Z), i is the local axis (x̂, ŷ or ẑ) and θJi is the angle from the global axis J and to
the local axis i, as provided in the matrix below. Hint: Refer to vector algebra.
cos(θX x̂ ) cos(θY x̂ ) cos(θZ x̂ )
cos(θX ŷ ) cos(θY ŷ ) cos(θZ ŷ )
cos(θX ẑ ) cos(θY ẑ ) cos(θZ ẑ )
References
A. Sengupta . Symbolic Toolbox for Scilab, 2024. https://github.com/sengupta/scilab-
maxima/tree/master.
AEM. Applied Element Method , 2023. www.appliedelementmethod.org/.
K. J. Bathe . Finite Element Procedures. Prentice Hall, NJ, 1996.
S. L. Campbell , J.-P. Chancelier and R. Nikoukhah . Modeling and Simulation in Scil- ab/Scicos
with ScicosLab 4.4. Springer, NY, USA, 2010.
S. Chandrasekaran . Advanced Structural Analysis with MATLAB. CRC Press, Boca Raton, FL,
USA, 2019.
A. Pajankar and S. Chandu . GNU Octave by Example – A Fast and Practical Approach to
Learning GNU Octave. Apress, U.K., 2020.
S. W. Lee and P. W. Chung . Finite Element Method for Solids and Structures: A Concise
Approach. Cambridge University Press, 2021.
R. W. Clough . Early history of the finite element method from the view point of a pioneer.
International Journal for Numerical Methods in Engineering, 483–487, 2004.
R. D. Cook . Finite Element Modelling for Stress Analysis. John Wiley & Sons, Canada, 1994.
J. W. Eaton , D. Bateman , S. Hauberg and R. Wehbring . GNU Octave Version 8.2.0 Man- ual:
A High-Level Interactive Language for Numerical Computations, 2022,
https://docs.octave.org/v8.2.0/.
ESI Group. Scilab , 2024. Website: www.scilab.org/tutorials.
F. Moukalled , et al. The Finite Volume Method in Computational Fluid Dynamics, Fluid
Mechanics and Its Applications. Springer, 2016.
C. A. Felippa . A historical outline of matrix structural analysis: a play in three acts. Computers &
Structures, 79(14):1313–1324, 2001.
W. McGuire , R. H. Gallagher and R. D. Ziemian . Matrix Structural Analysis. Wiley, New York,
2015.
K. K. Gupta and J. L. Meek . A brief history of the beginning of the finite element method.
International Journal for Numerical Methods in Engineering, 47:3761–3774, 2000.
B. Habte . A Computer Program for the Elastic Analysis of Plane Structures. Addis Ababa
University, Unpublished MSc thesis, 1988.
J. S. Hansen . GNU Octave: Beginner’s Guide. Packt, Birmingham, UK – Mumbai, India 2011.
C. Jain . Advanced Programming in SCILAB. Alpha Science International Ltd., Oxford, 2017.
Mike Pomax Kamermans . Gaussian quadrature weights and abscissae, 2011.
https://pomax.github.io/bezierinfo/legendre-gauss.html.
A. Kassimali . Matrix Analysis of Structures. Cengage, Stamford, CT, 2012.
A. Kassimali . Structural Analysis. Cengage, Boston, MA, 2020.
J. T. Katsikadelis . The Boundary Element Method for Engineers and Scientists – Theory and
Applications. Elsevier, 2016.
A. R. Khoei . Extended Finite Element Method Theory and Applications. John Wiley & Sons,
2015.
G. R. Liu . Meshfree Methods — Moving Beyond the Finite Element Method. CRC Press, Boca
Raton, FL, 2010.
D. L. Logan . A First Course in the Finite Element Method. Cengage Learning, 2017.
D. Madier . Practical Finite Element Analysis for Mechanical Engineering. FEA Academy, 2020.
P. Marti . Theory of Structures: Fundamentals of Framed Structures, Plates and Shells. Wilhelm
Ernst & Sohn, Berlin, 2013.
S. T. Mau . Introduction to Structural Analysis: Displacement and Force Methods. CRC Press,
Berlin, 2012.
Maxima CAS Foundation. Maxima CAS, 2024. https://maxima.sourceforge.io/.
S. Mazumder . Numerical Methods for Partial Differential Equations – Finite Difference and
Finite Volume Methods. Elsevier, U.K., 2016.
J. C. McCormac . Structural Analysis: Using Classical and Matrix Methods. John Wiley and
Sons, 2007.
K. B. Mustapha . Finite Element Computations in Mechanics with R. Taylor & Francis Group,
Boca Raton, FL, USA, 2018.
S. Nagar . Introduction to Octave: For Engineers and Scientists. Apress, NY, 2017.
S. Nagar . Introduction to Scilab: For Engineers and Scientists. Apress, 2017.
P. Nagarajan . Matrix Methods of Structural Analysis. CRC Press, Boca Raton, FL, 2019.
Octave Package. Octave Symbolic Functions , 2024.
https://octave.sourceforge.io/symbolic/overview.html.
Octave Package . The Octave Symbolic Package, 2024. https://gnu-
octave.github.io/packages/symbolic/.
Octave-Wiki. Octave Wiki , 2024. https://wiki.octave.org/Symbolic_package.
E. Onate . Structural Analysis with the Finite Element Method (Linear Statics) Volume 1. Basis
and Solids. International Center for Numerical Methods in Engineering (CIMNE), 2009.
M. Paz and W. Leigh . Integrated Matrix Analysis of Structures: Theory and Computa- tion.
Alpha Science International Ltd., Oxford, 2017.
T. H. H. Pian . Some notes on the early history of hybrid stress finite element method.
International Journal for Numerical Methods in Engineering, 47:419–425, 2000.
S. S. Rao . The Finite Element Method in Engineering. Elsevier Ltd., 2018.
A. Runchal . Origins and development of the finite volume CFD method at Imperial Col- lege.
ICHMT International Symposium on Advances in Computational Heat Transfer, pp. 923–924,
2017.
Sage Software. Sage Software Manual , 2024. https://www.sagemath.org/tour-quickstart.html.
Scilab India . Scilab Symbolic Toolbox, (n.d.). https://scilab.in/scilab-symbolic-toolbox.
The Octave Project. GNU Octave Manual , 2024. https://octave.org.
J. D. Todd . Structural Theory and Analysis. The Macmillan Press Ltd., London, 1974.
O. C. Zienkiewicz and R. L. Tylor . Structural Analysis withthe Finite Element Method (Linear
Statics) Volume 1. Basis and Solids. Elsevier Ltd., 2013.
W. Weaver and J. M. Gere . Matrix Analysis of Framed Structures. Van Nostrand Rein- hold,
New York, 1990.
Wikimedia Foundation . Wikipedia Website, 2024.
https://en.wikipedia.org/wiki/List_of_finite_element_software_packages.
A. Williams . Structural Analysis: In Theory and Practice. Elsevier, 2009.
A. Worku . Development of a calibrated pasternak foundation model for practical use.
International Journal of Geotechnical Engineering, 8(1):26–33, 2014.
A. Worku & B. Habte . Analytical formulation and finite-element implementation tech- nique of a
rigorous two-parameter foundation model to beams on elastic foundations. Geomechanics and
Geoengineering, 17(2):547–560, 2022.
View publication stats