Direct Stiffness Method: Dr. Amit R. Singh March 4, 2024
Direct Stiffness Method: Dr. Amit R. Singh March 4, 2024
1 Introduction
Direct Stiffness Method is a simplified form of Finite Element Method that can be used to analyze systems of
springs, bars, or trusses. In the case of bars, and trusses, we will first have to discretize them into springs. Thus,
ultimately, we will be solving a system of springs. For simplicity, in this presentation, we will restrict ourselves
to linear 1D springs.
2 A Spring Element
We are familiar with the governing equation of linear springs. Our aim in this section, is to rewrite the spring
equation as a system of equations that relate the displacements of the end-points of the spring with the forces
acting at the end-points. Figure 1 shows a single spring element. The number in circle is called the element
index and it will identify a spring uniquely in a system of springs. The spring element has two nodes indexed 1,
and 2. The forces and displacements of the spring element have been indexed based on the node to which they
belong.
Figure 1: A single spring element with two nodes labeled 1, and 2. The spring element is numbered as 1 (in
circle). The nodal forces, F1 , and F2 , and the nodal displacements, u1 , and u2 , are as shown as arrows pointing
in their positive directions. The spring constant is k1 .
1
Case (c): both the nodes are free.
The nodal forces vary linearly with the nodal displacements. Therefore, when both the nodes are allowed to
move, the nodal forces can be obtained by superposing the nodal forces of Cases (a), and (b) above.
where K is called the element stiffness matrix and the number in the parenthesis in the superscript denotes the
element index.
3 A Network of Springs
The aim of this section is write a matrix equation for a network of springs analogous to equation 8. The
displacements of the unique nodes of the network will be the unknowns u. We have to find the global stiffness
matrix K that relates u to the applied loads F . We will start with a simple system of two springs connected in
series.
Figure 2 shows two spring elements connected in series. Although there are two springs, and each spring
element has two nodes, the number of unique nodes in this system is only three because the second node of the
first element and the first node of the second element are coupled and will always move together. So this system
has three degrees of freedom.
Figure 2: Two spring elements connected in series. The circled numbers are the spring indices. The global node
indices have been shown as numbers without circles.
To write down the governing equation of the system, we will again use the principle of superposition. We
will first split the system into two springs and then add-up the appropriate force equations. Figure 3 shows the
separated springs with their local node indices.
Figure 3: The separated spring elements. The circled numbers are the spring indices. The local node indices
have been shown as numbers without circles.
2
Applying equations 5 and 6 to spring 1, we can write
(1) (1) (1)
F1 = k1 u1 − k1 u2 (9)
(1) (1) (1)
F2 = −k1 u1 + k1 u2 (10)
In the above equations, the numbers in the parenthesis in the superscripts denote the spring element indices. We
(1) (2)
note that u2 and u1 represent the same physical point which corresponds to global nodal displacement u2 .
(1) (2)
Therefore, by the principle of linear superposition, we can add up the forces F2 , and F1 . Thus, we get three
force equations for this spring network.
(1) (1) (1)
F1 = k1 u1 − k1 u2 (13)
(1) (2) (1) (1) (2) (2)
F2 + F1 = −k1 u1 + k1 u2 + k2 u1 − k2 u2 (14)
(2) (2) (2)
F2 = −k2 u1 + k2 u2 (15)
Now we can switch from local force and node indices to the global force and node indices by noting that
(1) (1)
F1 = F1 u1 = u1
(1) (2) (1) (2)
F2 + F1 = F2 u2 = u1 = u2
(2) (2)
F2 = F3 u2 = u3
F1 = k1 u1 − k1 u2 (16)
F2 = −k1 u1 + (k1 + k2 )u2 − k2 u3 (17)
F3 = −k2 u2 + k2 u3 (18)
Thus, we have found a matrix equation of the form Ku = F where K is the global stiffness matrix or the
stiffness matrix of the spring network. It should be noted that because a single spring element has two degrees
of freedom, the element stiffness matrix is of shape 2×2. The spring network we have considered in this section
has three degrees of freedom and, as shown above, the global stiffness matrix is of shape 3×3. In general, the
global stiffness matrix of a spring network with M unique nodes will be of shape M × M . We should also note
that both the element stiffness matrix and the global stiffness matrix are symmetric.
4 Assembly
In the previous section, we derived the governing equation of the spring network by writing the force equations
for each node of each element separately and then adding up the forces that act on the same global node. This
approach will quickly become tedious as the number of springs in our system increases. Fortunately, there is a
systematic procedure to derive the global stiffness matrix from the element stiffness matrices. This process is
called assembly in finite element method context.
Let N be the number of springs in a network. Let each spring have n local nodes. Let M be the number of
unique nodes in the entire system. So M ≤ N × n. Assembly entails the following steps.
1. Map the local degrees of freedom of every element to the global degrees of freedom. Let G : (e, i) → I
denote a function that accepts element index e, and element node index i as inputs, and returns the global
node index I as an output. For the spring network of Section 3, using figures 2 and 3, we can write the
mapping as follows:
3
Element Index (e) Local Node Index (i) Global Node Index (G(e, i) = I)
1 1 1
1 2 2
2 1 2
2 2 3
2. Initialize the global stiffness matrix as a matrix of zeros of size M × M where M is the number of unique
degrees of freedom of the system.
3. Update the elements of the global stiffness matrix K using the element stiffness matrices K (e) as follows:
for e in (1, N ) do
for i in (1, n) do
for j in (1, n) do
I = G(e, i)
J = G(e, j)
K[I, J] = K[I, J] + K (e) [i, j]
end for
end for
end for
If we apply this algorithm to the example of Section 3, we will get
Suppose, as a boundary condition, it is given that u1 = U . Let force F3 = 5 units. Since force is not specified
for node 2, we will take it as 0.
k1 −k1 0 U F1
−k1 k1 + k2 −k2 u2 = 0
0 −k2 k2 u3 5
4
Now we have three equations for just two unknowns u2 , and u3 . We need to get rid of one equation. We
should note that F1 is a reaction force and it is an unknown. If we remove equation 1 from our system then
there will be no unknown force on the RHS. Therfore, we will remove the first row of the coefficient matrix and
the RHS vector.
U
−k1 k1 + k2 −k2 0
u =
0 −k2 k2 2 5
u3
Our coefficient matrix is not a square matrix anymore so we cannot invert it. But we have a known quantity
u1 = U in the vector that we want to solve for. Let’s shift the terms corresponding to u1 = U to the RHS. This
amounts to removing the first column from the coefficient matrix, removing the first row of the u vector and
modifying the entries of the RHS vector.
k1 + k2 −k2 u2 0 k1 U k1 U
= + =
−k2 k2 u3 5 0 5
Now the coefficient matrix is not singular and it can be inverted. Solving this system gives us
5
u2 = U +
k1
5 5
u3 = U + +
k2 k1
Finally, using the values of u1 , u2 , and u3 , we can calculate the reaction force F1 = −5.
Summarizing, for every displacement uI where I is the global node index, that is specified as a boundary
condition, we need to reduce the governing matrix equation as follows:
1. Subtract the product of uI and the I th column of the global stiffness matrix from the RHS F vector.
2. Drop the I th row and the I th column from the global stiffness matrix.
3. Drop the I th row from the u vector.
4. Drop the I th row from the RHS F vector.
5. Solve the reduced system of equation for the unknown nodal dispalcements obtained after the above steps.
6. Finally, use the nodal dispalcement values to calculate the reaction force at the I th node.
5
ME F318 Computer Aided Design
Geometric Transformations
1 / 23
What is a Geometric Transformation?
Definition
If (x, y ) are the Euclidean coordinates of a point P, in R2 , and if
(x1 , x2 , x3 ) are any three real numbers such that x1 /x3 = x and
x2 /x3 = y , then the triple (x1 , x2 , x3 ) is said to be a set of
homogeneous coordinates for P.
Definition
The general form of an 2D isometric transformation is
′
x ϵ cos θ − sin θ tx x
y ′ = ϵ sin θ cos θ ty y
1 0 0 1 1
Definition
The general form of a similarity transformation is
′
x s cos θ −s sin θ tx x
y ′ = s sin θ s cos θ ty y
1 0 0 1 1
Definition
The general form of an affine transformation or an affinity is
′
x a11 a12 tx x
y ′ = a21 a22 ty y
1 0 0 1 1
A = R(θ)R(−ϕ)DR(ϕ)
λ 0
where the R denote rotations and D = 1 is a scaling
0 λ2
matrix. This scaling happens along x and y directions which
are rotated by an angle −ϕ with respect to the original x − y -
axes.
• An affinity has 6 degrees of freedom. Hence it requires, 3
points in correspondence to uniquely determine it.
Definition
The general form of a projective transformation or a projectivity is
′
x a11 a12 tx x
y ′ = a21 a22 ty y
1 v1 v2 v 1
Note
The element v in the transformation matrix is generally used to
scale all the other elements. So it is generally equal to 1. But in
some situations, its value needs to be set to 0. Therefore, we say
that the matrix has only 8 degrees of freedom.
T = Tn Tn−1 . . . T1 .
T = T1 T2 . . . Tn .
Definition
A fixed point of a transformation remains unchanged under the
action of the transformation.
You can check out the interactive plots in the following notebooks
• DemoIsometry.ipynb
• DemoSimilarity.ipynb
• DemoAffinity.ipynb
3. In the demo, the original points and lines are shown in gray. Under the action of
the elation matrix, the points are projected to the red points that lie in a 3D
plane whose equation is z = v1 x + v2 y + v .
4. The final result of the projective transformation, shown in blue, are obtained by
modifying the homogeneous coordinates of the red-points such that their third
coordinate is 1. This is equivalent to projecting them to z = 1 plane. If we join
the blue points with their red counterparts, we will get lines which converge at
the origin i.e. origin is the point of projection.
1 / 23
Resources
The equation of faces should be such that the normal vector points
outwards.
Following information is
needed for each edge
1. vertices
2. left and right faces,
3. the “predecessor” and
“successor” of this edge
when traversing its left
face, and
4. the predecessor and
successor of this edge
when traversing its right
face.
b, c, d, and e are the “wings” of a.
9 / 23 BITS Pilani, Pilani Campus
The Winged-Edge Data Structure
Example
Next, we can expand the top hole till the sphere reduces to a disk!
1 / 36
A Variety of Mathematical Surfaces
• Surfaces of revolution
• Quadric surfaces
• Sweep surfaces
• Bilinear surfaces
• Ruled surfaces
• Coon’s surfaces
• NURBS surfaces
• Surfaces of revolution
• Quadric surfaces
• Sweep surfaces
• Bilinear surfaces
• Ruled surfaces
• Coon’s surfaces
• NURBS surfaces
In matrix form,
P(0, 0) P(0, 1) 1 − v
Q(u, v ) = 1 − u u
P(1, 0) P(1, 1) v
In matrix form,
P(0, 0) P(0, 1) 1 − v
Q(u, v ) = 1 − u u
P(1, 0) P(1, 1) v
In matrix form,
P(u, 0)
Q(u, v ) = 1 − v v
P(u, 1)
In matrix form,
P(u, 0)
Q(u, v ) = 1 − v v
P(u, 1)
Or alternatively,
P(0, v )
Q(u, v ) = 1 − u u
P(1, v )
In matrix form,
P(u, 0)
Q(u, v ) = 1 − v v
P(u, 1)
Or alternatively,
P(0, v )
Q(u, v ) = 1 − u u
P(1, v )
AC − B 2
K=
|Qu × Qv |4
AC − B 2
K=
|Qu × Qv |4
A
B = {Quu } {Quv } {Qvv } Qu × Qv
C
In matrix form,
−P(0, 0) −P(0, 1) P(0, v ) 1 − v
Q(u, v ) = 1 − u u 1 −P(1, 0) −P(1, 1) P(1, v ) v
P(u, 0) P(u, 1) 0 1
In matrix form,
−P(0, 0) −P(0, 1) P(0, v ) 1 − v
Q(u, v ) = 1 − u u 1 −P(1, 0) −P(1, 1) P(1, v ) v
P(u, 0) P(u, 1) 0 1
There is also a Coon’s bicubic surface. But we will not discuss it.
We can write it as
n X
X m
Q(u, v ) = Bi,j Si,j (u, v )
i=0 j=0
where
h N (u)Mj,l (v )
Si,j (u, v ) = Pn Pi,jm i,k
p=0 q=0 hp,q Np,k (u)Mq,l (v )
1. Non-negativity:
Si,j (u, v ) ≥ 0 ∀u, v
1. Non-negativity:
Si,j (u, v ) ≥ 0 ∀u, v
2. Partition of unity:
n X
X m
Si,j (u, v ) ≡ 1
i=0 j=0
1. Non-negativity:
Si,j (u, v ) ≥ 0 ∀u, v
2. Partition of unity:
n X
X m
Si,j (u, v ) ≡ 1
i=0 j=0
1. Non-negativity:
Si,j (u, v ) ≥ 0 ∀u, v
2. Partition of unity:
n X
X m
Si,j (u, v ) ≡ 1
i=0 j=0
1. Non-negativity:
Si,j (u, v ) ≥ 0 ∀u, v
2. Partition of unity:
n X
X m
Si,j (u, v ) ≡ 1
i=0 j=0
1 / 50
Resources
Definition
Bernstein polynomials are defined as
n!
Bi,n (t) = (1 − t)n−i t i , i = 0, 1, . . . , n
i!(n − i)!
where
and
B0,0 (t) = 1.
5. Derivative:
dBi,n (t)
= n [Bi−1,n−1 (t) − Bi,n−1 (t)] .
dt
Note: B−1,n−1 (t) = Bn,n−1 (t) = 0
Bi,n(t)
i=4
0.4 0.4
0.2 0.2
0.0 0.0
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
t t
Definition
A Bézier curve of degree n, (and order n + 1), is defined as
n
X
P(t) = Pi Bi,n (t), 0 ≤ t ≤ 1.
i=0
where Pi are the control points and the basis functions Bi,n (t) are
the Bernstein polynomials.
Lines joining the control points (in sequence) form the control
polygon. What is a convex hull?
Definition
A domain is called convex if for any two points P1 and P2 , the
segment P1 P2 lies entirely in the domain.
Definition
The convex hull of a set of points P is the boundary of the
smallest convex domain containing P.
4 Bézier Curve
Control Polygon
Convex Hull
3
0
0 1 2 3 4 5 6
2 2
1 1
0 0
0 1 2 3 4 5 6 −6 −5 −4 −3 −2 −1 0
0
0 1 2 3 4 5 6
4. Bézier curve lies entirely within the convex hull of the control
points.
4 Bézier Curve
Control Polygon
Convex Hull
3
0
0 1 2 3 4 5 6
Problem
Given the control points, how to calculate the point P(t0 ) i.e. the
point on the Bézier curve at t = t0 ?
• We can certainly evaluate the Bernstein polynomials at
t = t0 , and multiply with the corresponding control points
and add them up.
• But this method may have numerical instabilities especially if
the degree of the Bernstein polynomials is large.
• de Casteljau’s algorithm is a numerically stable alternative
(and an elegant result!)
P(t0 ) = Pn,0
Iteration 0
12
t = 0.4
10
0
0 5 10 15
Iteration 1
12
t = 0.4
10
0
0 5 10 15
Iteration 2
12
t = 0.4
10
0
0 5 10 15
Iteration 3
12
t = 0.4
10
0
0 5 10 15
Iteration 4
12
t = 0.4
10
0
0 5 10 15
Iteration 5
12
t = 0.4
10
6
P (t = 0.4)
4
0
0 5 10 15
Problem
Derive the conditions for tangent and curvature continuity across
two Bézier curves P (1) (t) and P (2) (t).
Hint:
We need to know about derivatives of Bernstein polynomials.
You can tinker with this Jupyter notebook to explore Bézier curves.
I came across a very nice website which has live demos of many
examples of Bézier and B-spline curves. Check it out:
https://pomax.github.io/bezierinfo.
T = (t0 , t1 , . . . , tm )
is a knot vector.
Definition
For a given knot vector T and order k, the associated B-spline
functions are
t − ti ti+k − t
Ni,k (t) = Ni,k−1 (t) + Ni+1,k−1 (t)
ti+k−1 − ti ti+k − ti+1
dNi,k (t) k −1 k −1
= Ni,k−1 (t) − Ni+1,k−1 (t).
dt ti+k−1 − ti ti+k − ti+1
0.6
0.5
N0,4 (t)
0.4
Ni,k (t)
N1,4 (t)
0.3 N2,4 (t)
N3,4 (t)
0.2
0.1
0.0
0 2 4 6
t
1.0
N0,4 (t)
N1,4 (t)
0.8
N2,4 (t)
N3,4 (t)
0.6
Ni,k (t)
N4,4 (t)
N5,4 (t)
0.4
N6,4 (t)
0.2
0.0
0 1 2 3 4
t
N4,4 (t)
0.4
0.2
0.0
0 2 4 6 8 10
t
1.0
N0,3 (t)
N1,3 (t)
0.8
N2,3 (t)
N3,3 (t)
0.6
Ni,k (t)
N4,3 (t)
N5,3 (t)
0.4
0.2
0.0
0 2 4 6
t
Definition
Given a set of n control points Pi , and an order 1 ≤ k ≤ n + 1, a
B-spline curve is defined as
n
X
P(t) = Pi Ni,k (t) for t ∈ [tk−1 , tn+1 ]
i=0
where Ni,k (t) are the B-spline basis functions and ti are elements
of a knot vector T = (t0 , t1 , . . . , tn+k ).
8 B-spline curve
Control Polygon
7
Convex hull
Pi : (1, 1), (3, 8), (6, 3), (9, 6)
6 Knot Points
T = (0, 1, 2, 3, 4, 5, 6)
5
6 6
5 5
4 4
3 3
2 2
1 1
2 4 6 8 −8 −6 −4 −2
2 B-spline curve
Control Polygon
2 4 6 8 10 12 14
t − ti Ni,k
Ni,k (t) = Ni,k−1 (t) Ni,k−1 Ni+1,k−1
ti+k−1 − ti Ni,k−2 Ni+1,k−2 Ni+2,k−2
ti+k − t . . .
+ Ni+1,k−1 (t) . . .
ti+k − ti+1 Ni,1 Ni+1,1 ... Ni+k−1,1
Definition
A parametric curve expressed in “homogeneous coordinates” is
called as a “rational” curve.
In homogeneous coordinates, a generic parametric space curve can
be written as P(t) = (x(t), y (t), z(t), w (t)).
By definition of homogeneous coordinates, this corresponds to the
following Cartesian coordinates
x(t) y (t) z(t)
P(t) = , ,
w (t) w (t) w (t)
Therefore,
n
1 X
P(t) = Pn hi Ni,k (t)Pi
j=0 hj Nj,k (t)
i=0
h1 = 0 : Straight-line
0 < h1 < 1 : Elliptical curve
h1 = 1 : Parabolic curve
h1 > 1 : Hyperbolic curve