Professional Documents
Culture Documents
Mathematical Presetup Code
Mathematical Presetup Code
Mathematical Presetup Code
Jide Williams
Now because element is Isoparametric, iso-same, para- parameter; the same shape
function is used to interpolate both displacements, (field quantity) and geometry
(shape). In other words, you can use shape functions to estimate the displacement of a
node through interpolation, with the same shape functions you can estimate the
geometry or location of a point within the element, interpolated from the nodal
coordinate points. Isoparametric elements are useful for many applications including
plane stress, plane strain, 3D elements and so on
∑ 𝑁𝑖 𝑋𝑖
𝑋 𝑖=1
{ }= 𝑛 = [𝑁]{𝑐 }𝑜𝑟
𝑌
∑ 𝑁𝑖 𝑌𝑖
{ 𝑖=1 }
T
{c} = [ x1 y1, x2 y2, x3 y3, x4 y4,]
𝑋 = 𝑁1 𝑋1 + 𝑁2 𝑋2 + 𝑁3 𝑋3 + 𝑁4 𝑋4 ;
𝑌 = 𝑁1 𝑌1 + 𝑁2 𝑌2 + 𝑁3 𝑌3 + 𝑁4 𝑌4 ;
The solution will give us a single value for X and Y stating that point for a single
element.
∑ 𝑁𝑖 𝑈𝑖
𝑈 𝑖=1
[𝑁]{𝑑 } 𝑜𝑟
{ }= 𝑛
𝑉
∑ 𝑁𝑖 𝑉𝑖
{ 𝑖=1 }
T
{d} = [ u1 v1 u2 v2 u3 v3 u4 v4]
𝑈 = 𝑁1 𝑈1 + 𝑁2 𝑈2 + 𝑁3 𝑈3 + 𝑁4 𝑈4 ;
𝑉 = 𝑁1 𝑉1 + 𝑁2 𝑉2 + 𝑁3 𝑉3 + 𝑁4 𝑉4 ;
Again, 𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑛𝑜𝑑𝑎𝑙 𝑝𝑜𝑖𝑛𝑡𝑠, 𝑓𝑜𝑟 𝑒𝑥𝑎𝑚𝑝𝑙𝑒 𝑖𝑓 𝑤𝑒 𝑎𝑟𝑒 𝑑𝑒𝑎𝑙𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 𝑎 𝑄4, 𝑛 =
4, 𝑜𝑟 𝑛 = 8 𝑓𝑜𝑟 𝑎 𝑄8. U1, V1…. Un Vn are the nodal displacements of the first node,
and the nth node
The shape functions are being derived in another article, here they are stated as follow:
N 1⁄4 * (1 – ξ) (1 – η);
1=
N 1⁄4 * (1 + ξ) (1 – η);
2=
N 1⁄4 * (1 + ξ) (1 + η);
3=
N 1⁄4 * (1 – ξ) (1 + η);
4=
In the pseudocode, these can be defined right off the back, and can be written in matrix
form as:
1 1 1 1 1
𝑁1
𝑋1 𝑋2 𝑋3 𝑋4 𝑋
𝑁
𝑌1 𝑌2 𝑌3 𝑌4 *[ 2 ] = 𝑌
𝑁3
𝑈1 𝑈2 𝑈3 𝑈4 𝑈
𝑁 [𝑉 ]
( 𝑉1 𝑉2 𝑉3 𝑉4 ) 4
So that now,
𝜕𝑈 𝜕(𝑁1 𝑈1 + 𝑁2 𝑈2 + 𝑁3 𝑈3 + 𝑁4 𝑈4 )
𝜀𝑥 = =
𝜕𝑋 𝜕𝑋
But U1, U2, U3, V1, V2, V3… Un, Vn are real numbers…. They are constants, I can factor
them out
We are differentiating with respect to X and not X1, X2, X3, Xn, are real numbers but N is
a function
In the same manner,
𝜕𝑈 𝜕(𝑁1 𝑈1 + 𝑁2 𝑈2 + 𝑁3 𝑈3 + 𝑁4 𝑈4 )
𝜀𝑦 = =
𝜕𝑌 𝜕𝑌
And,
𝛛𝐍𝑖 𝛛𝛏 𝛛𝛈 𝛛𝐍𝑖
{ 𝛛𝐗 } = [𝛛𝐗 𝛛𝐗] ∗ { 𝛛𝛏 }
𝛛𝐍𝑖 𝛛𝛏 𝛛𝛈 𝛛𝐍𝑖
𝛛𝐘 𝛛𝐘 𝛛𝐘 𝛛𝛈
𝛛𝐍𝑖 𝛛𝐍𝑖
But recall that , 𝛛𝛈 𝑎𝑟𝑒 𝑒𝑎𝑠𝑦 𝑡𝑜 𝑓𝑖𝑛𝑑 𝑏𝑒𝑐𝑎𝑢𝑠𝑒 𝑁𝑖 𝑖𝑠 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑥𝑖 𝑎𝑚𝑑 𝑒𝑡𝑎.
𝛛𝛏
𝛛𝛏 𝛛𝛈 𝛛𝛏 𝛛𝛈
So now, to find 𝛛𝐗 , 𝛛𝐗, 𝛛𝐘 , 𝛛𝐘 we use another characteristic of Isoparametric element. That
is:
𝑋 = 𝑁1 𝑋1 + 𝑁2 𝑋2 + 𝑁3 𝑋3 + 𝑁4 𝑋4 ;
But X1, X2, X3, X4 …Xn are constants they are real numbers and Ni are functions of
natural coordinates 𝜉 𝑎𝑛𝑑 𝜂.
Taking partials of X, Y with respect to 𝜉 𝑎𝑛𝑑 𝜂 𝑏𝑒𝑐𝑜𝑚𝑒𝑠
And since we have already initialized N 1⁄4 * (1 – ξ) (1 – η); N2, N3 and N4,
1=
We can write
𝛛𝐍1 1 𝛛𝐍3 1
= ∗ (𝜂 − 1 ); = ∗ (𝜂 + 1);
𝛛𝛏 4 𝛛𝛏 4
𝛛𝐍2 1 𝛛𝐍4 1
= ∗ (1 − 𝜂 ); = ∗ (−𝜂 − 1);
𝛛𝛏 4 𝛛𝛏 4
𝛛𝐍1 1 𝛛𝐍3 1
= ∗ (𝜉 − 1 ) = ∗ (𝜉 + 1);
𝛛𝛈 4 𝛛𝛈 4
𝛛𝐍2 1 𝛛𝐍4 1
= ∗ (−𝜉 − 1) = ∗ (1 − 𝜉 );
𝛛𝛈 4 𝛛𝛈 4
𝛛𝛏 𝛛𝛈
[𝛛𝐗
𝛛𝛏
𝛛𝐗
𝛛𝛈
] inverting this matrix, we get what we want which is
𝛛𝐘 𝛛𝐘
𝛛𝐗 𝛛𝐘
𝛛𝛏 𝛛𝛏
[𝐽] = [𝛛𝐗 𝛛𝐘]
𝛛𝛈 𝛛𝛈
This is what J is Jacobian matrix so that if we invert it we will still obtain the same
answer
𝜕𝜉 𝜕𝜂
𝐽−1 [= 𝜕𝑋 𝜕𝑋 ]
𝜕𝜉 𝜕𝜂
𝜕𝑌 𝜕𝑌
The utility here is that once we find the [J] matrix above, we just invert it.
This can be written in matrix form for computational analysis and pseudocode.
[B] which is a combination of the derivatives strains in the X, Y direction, and shear in
the X-Y direction, is
One-point rule
𝟏 𝟏
∫ 𝑭(𝝃) 𝒅𝝃 ≈ ∑ 𝒘𝒊 ∗ 𝑭(𝝃) = 𝟐𝑭(𝑶)
−𝟏 𝒊=𝟏
Essentially what this means is that you are integrating or summing at xi value = 0 and
using a weight value w = 2, 𝑖. 𝑒 . , 𝜉 = 0, 𝑎𝑛𝑑 𝑤𝑒𝑖𝑔ℎ𝑡 𝑣𝑎𝑙𝑢𝑒 𝑖𝑠 𝑖𝑛 𝑎 𝑜𝑛𝑒 −
𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛
𝟏 𝟑 𝟓 √𝟑 𝟖 𝟓 √𝟑
∫ 𝑭(𝝃) 𝒅𝝃 ≈ ∑ 𝒘𝒊 ∗ 𝑭(𝝃) ≈ ∗ 𝑭 (− ) + ∗ 𝑭(𝟎) + ∗ 𝑭 ( )
−𝟏 𝒊=𝟏 𝟗 𝟓 𝟗 𝟗 𝟓
With 3 point rule, weight factor is ranges from w1 to w3, which are 5/9, 8/9, and 5/9
respectively and we are integrating
−√𝟑 −√𝟑
𝜉 𝑣𝑎𝑙𝑢𝑒𝑠 𝑓𝑟𝑜𝑚 ( 𝟓 ) 𝑡𝑜 0, 𝑡𝑜 ( 𝟓 ) 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑦𝑖𝑛𝑔 𝑏𝑦 𝑖𝑡𝑠 𝑤𝑒𝑖𝑔ℎ𝑡 𝑎𝑡 𝑒𝑎𝑐ℎ 𝑝𝑜𝑖𝑛𝑡 𝑎𝑛𝑑 𝑠𝑢𝑚𝑚𝑖𝑛𝑔 𝑓𝑟𝑜𝑚 𝑓𝑖𝑟𝑠𝑡
𝑠𝑒𝑐𝑜𝑛𝑑 𝑝𝑜𝑖𝑛𝑡 𝑖𝑛 𝑎 𝑜𝑛𝑒 𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛
One-Point rule therefore will mean integrating that point twice, one along
𝜉, 𝑎𝑛𝑑 𝑡ℎ𝑒 𝑜𝑡ℎ𝑒𝑟 𝑎𝑙𝑜𝑛𝑔 𝜂.
𝟏 𝟏
𝟏
∬ 𝑭(𝝃) 𝒅𝝃𝒅𝜼 ≈ ∑ ∑ 𝒘𝒊 ∗ 𝒘𝒋 ∗ 𝑭(𝝃𝒊 𝜼𝒋 ) = 𝟐 ∗ 𝟐 ∗ 𝑭(𝟎, 𝟎)
−𝟏 𝒊=𝟏
𝒋=𝟏
Essentially what this means when 𝑖 𝑎𝑛𝑑 𝑗 = 1 you are integrating two times summing at
𝜉 = 0, η = 0, and using a weight values wi and wj = 2 at each point 𝑖. 𝑒 . , 𝑖𝑛 𝑎 𝑡𝑤𝑜 −
𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛
The key here is 𝑖 𝑙𝑜𝑜𝑝𝑠 𝑜𝑛𝑐𝑒, 𝑗 𝑙𝑜𝑜𝑝𝑠 𝑜𝑛𝑐𝑒 𝑚𝑎𝑘𝑒 𝑡𝑤𝑜 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛𝑠
A 1D will only integrate across a line. That is, you could have a 1 Gaussian point (GP),
2 GP, or 3 GP along a line. Similarly, a 2D or 3D integration would mean integrating
across a plane geometry with X, and Y, directions, or volumetric integration, with X, Y,
and Z orientations respectively.
Using the formula for a 3 gaussian points (GP), 1D, i.e. one integral will be: 31 =
3 𝑡𝑒𝑟𝑚𝑠
Using the formula for a 4 gaussian points (GP), 2D, i.e. two integrals will be: 42 =
16 𝑡𝑒𝑟𝑚𝑠
Using the formula for a 3 gaussian points (GP), 3D, i.e. three integrals will be: 33 =
27 𝑡𝑒𝑟𝑚𝑠
To understand how the terms are laid out, we will turn to tables as below
Let us assume we want to numerically integrate 4 points in 1D, that’s a 4-point rule.
𝑖, 𝑖𝑠 𝑡ℎ𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑒𝑟𝑚𝑠 𝑜𝑟 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑡𝑒𝑟𝑚𝑠. 𝑇ℎ𝑒𝑟𝑒 ′ 𝑠 𝑛𝑜 𝑗, 𝑠𝑖𝑛𝑐𝑒 𝑖𝑡𝑠 1𝐷, 𝑜𝑛𝑒 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑙
𝑊𝑒 𝑡ℎ𝑒𝑛 𝑛𝑒𝑒𝑑 𝑡𝑜 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒 𝑡ℎ𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑒𝑟𝑚𝑠, 𝑢𝑠𝑖𝑛𝑔:
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑇𝑒𝑟𝑚𝑠 = 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐺𝑎𝑢𝑠𝑠𝑖𝑎𝑛 𝑃𝑜𝑖𝑛𝑡𝑠(𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛 𝑝𝑜𝑖𝑛𝑡𝑠)𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑙𝑠
= 21 = 2 𝑡𝑒𝑟𝑚𝑠
𝟏
Formula is ∫−𝟏 𝑭(𝝃) 𝒅𝝃 ≈ ∑𝟐𝒊=𝟏 𝒘𝒊 ∗ 𝑭(𝝃𝒊 )𝒅𝝃, 𝑖 goes from 1:4 since there are only 2 GP
𝑤𝑖 is given in literature for 4 points, GP is also given in literature, also called sampling
points
We then need to estimate 𝑭(𝝃𝒊 )𝒅𝝃, the function value at 𝜉𝑖
To obtain the function value at that point, we turn to the shape function at that point, and
that is N 1⁄4 * (1 – ξ) (1 – η) or its derivative in most case; as we can see, since we
1=
are dealing with a 1D problem in this case 𝜂, 𝑖𝑠 𝑖𝑛𝑐𝑜𝑠𝑒𝑞𝑢𝑒𝑛𝑡𝑖𝑎𝑙 𝑖𝑓 𝑖𝑡 𝑔𝑜𝑒𝑠 𝑡𝑜 0, which
becomes
𝑭(𝝃𝒊 ) 1⁄4 * (1 – 𝜉𝑖 )
=
𝑖 𝒘𝒊 GP (𝜉𝑖 ) 𝑭(𝝃𝒊 ) 𝒘𝒊 ∗ 𝑭(𝝃𝒊 )
1 0.652145154862546 -0.3399810435848563 1.339981 -0.45557
2 0.652145154862546 0.3399810435848563 0.660019 -0.45557
3 0.3478548451374538 -0.8611363115940526 1.861136 -1.60269
4 0.3478548451374538 0.8611363115940526 1.861136 0.119581
4 -1.71429
∑ 𝑤𝑖 ∗ 𝑭(𝝃𝒊 )
𝑖=1
𝜐,
𝜂 = []
𝜉 = []
𝜂𝑖
𝜉𝑗
𝜂 𝑎𝑛𝑑 𝜉
𝑑𝜉𝑖 𝑑𝜂𝑗
ENDDO.
ENDDO.
[𝐾 ] = ∬ 𝑡 ∗ 𝐽𝑑𝑒𝑡[𝐵]𝑇 [𝐶 ][𝐵]𝑑𝑥𝑑𝑦
𝑡 𝑖𝑠 𝑡ℎ𝑒 𝑝𝑙𝑎𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑡ℎ𝑖𝑐𝑘𝑛𝑒𝑠𝑠
𝐵 𝑖𝑠 𝑡ℎ𝑒 𝐵 𝑚𝑎𝑡𝑟𝑖𝑥 𝑑𝑒𝑣𝑒𝑙𝑜𝑝𝑒𝑑 𝑎𝑛𝑑 𝑖𝑡𝑠 𝑡𝑟𝑎𝑛𝑠𝑝𝑜𝑠𝑒, [𝐶 ]𝑖𝑠 𝑎 2𝐷 𝑐𝑜𝑛𝑠𝑡𝑖𝑡𝑢𝑡𝑖𝑣𝑒 𝑚𝑎𝑡𝑟𝑖𝑥
1 𝑣 0
𝐸 𝑣 1 0
𝑃𝑙𝑎𝑛𝑒 𝑆𝑡𝑟𝑒𝑠𝑠 [𝐶 ] = ∗[ 1 − 𝑣]
(1 − 𝑣 )
2
0 0
2
1−𝑣 𝑣 0
𝐸 𝑣 1−𝑣 0
𝑃𝑙𝑎𝑛𝑒 𝑆𝑡𝑟𝑎𝑖𝑛 = ∗[ 1 − 2𝑣]
(1 + 𝑣)(1 − 2𝑣)
0 0
2
Using degree of freedom