形函数构造
构造单元1的一般近似函数
V
(
x
)
‾
(
1
)
\overline{V(x)}^{(1)}
V(x)(1),由于该单元只有两个节点
x
1
x_1
x1和
x
2
x_2
x2,我们选择包含两个参数
α
1
\alpha_1
α1和
α
2
\alpha_2
α2的近似方程
V
(
x
)
‾
(
1
)
=
α
1
+
α
2
×
x
\overline{V(x)}^{(1)}=\alpha_1+\alpha_2\times x
V(x)(1)=α1+α2×x
令试函数与
V
(
x
)
V(x)
V(x)在节点
x
1
x_1
x1和
x
2
x_2
x2处相等,可以得
V
(
x
1
)
‾
(
1
)
=
α
1
+
α
2
×
x
1
=
V
1
V
(
x
2
)
‾
(
1
)
=
α
1
+
α
2
×
x
2
=
V
2
\overline{V(x_1)}^{(1)}=\alpha_1+\alpha_2\times x_1=V_1\\\overline{V(x_2)}^{(1)}=\alpha_1+\alpha_2\times x_2=V_2
V(x1)(1)=α1+α2×x1=V1V(x2)(1)=α1+α2×x2=V2
求解$\alpha_1 $ 和 $\alpha_2 $,可得
{
α
1
α
2
}
=
1
x
2
−
x
1
×
[
x
2
x
1
−
1
1
]
×
{
V
1
V
2
}
\left\{\begin{array}{l} \alpha_{1} \\ \alpha_{2} \end{array}\right\}=\frac{1}{x_{2}-x_{1}} \times\left[\begin{array}{cc} x_{2} & x_{1} \\ -1 & 1 \end{array}\right] \times\left\{\begin{array}{l} V_{1} \\ V_{2} \end{array}\right\}
{α1α2}=x2−x11×[x2−1x11]×{V1V2}
将
α
{\alpha}
α代入,试函数变成
V
(
x
)
‾
(
1
)
=
1
x
2
−
x
1
×
[
1
x
]
×
[
x
2
x
1
−
1
1
]
×
{
V
1
V
2
}
\overline{V(x)}^{(1)}=\frac{1}{x_2-x_1}\times\begin{bmatrix}1&x\end{bmatrix}\times\begin{bmatrix}x_2&x_1\\-1&1\end{bmatrix}\times\begin{Bmatrix}V_1\\V_2\end{Bmatrix}
V(x)(1)=x2−x11×[1x]×[x2−1x11]×{V1V2}
整理可得
V
(
x
)
‾
(
1
)
=
[
x
2
−
x
x
2
−
x
1
−
x
1
+
x
x
2
−
x
1
]
×
{
V
1
V
2
}
=
N
1
(
x
)
(
1
)
×
V
1
+
N
2
(
x
)
(
1
)
×
V
2
\overline{V(x)}^{(1)}=\left[\frac{x_2-x}{x_2-x_1}\quad\frac{-x_1+x}{x_2-x_1}\right]\times\left\{V_1\atop V_2\right\}=N_1(x)^{(1)}\times V_1+N_2(x)^{(1)}\times V_2
V(x)(1)=[x2−x1x2−xx2−x1−x1+x]×{V2V1}=N1(x)(1)×V1+N2(x)(1)×V2
其中
N
1
(
x
)
(
1
)
=
x
2
−
x
x
2
−
x
1
N
2
(
x
)
(
1
)
=
−
x
1
+
x
x
2
−
x
1
N_{1}(x)^{(1)}=\frac{x_{2}-x}{x_{2}-x_{1}}\\N_{2}(x)^{(1)}=\frac{-x_{1}+x}{x_{2}-x_{1}}
N1(x)(1)=x2−x1x2−xN2(x)(1)=x2−x1−x1+x
构造单元2到n-1
∙
单元 2:
V
(
x
)
‾
(
2
)
=
N
1
(
x
)
(
2
)
×
V
2
+
N
2
(
x
)
(
2
)
×
V
3
∙
⋯
∙
单元
n
−
1
:
V
(
x
)
‾
(
n
−
1
)
=
N
1
(
x
)
(
n
−
1
)
×
V
n
−
1
+
N
2
(
x
)
(
n
−
1
)
×
V
n
\begin{aligned}&\bullet\quad\text{单元 2:}\quad\overline{V(x)}^{(2)}=N_{1}(x)^{(2)}\times V_{2}+N_{2}(x)^{(2)}\times V_{3}\\&\bullet\quad\cdots\\&\bullet\quad\text{单元 }n-1:\quad\overline{V(x)}^{(n-1)}=N_1(x)^{(n-1)}\times V_{n-1}+N_2(x)^{(n-1)}\times V_n\end{aligned}
∙单元 2:V(x)(2)=N1(x)(2)×V2+N2(x)(2)×V3∙⋯∙单元 n−1:V(x)(n−1)=N1(x)(n−1)×Vn−1+N2(x)(n−1)×Vn
对于每个单元,性函数N(x)具有相同的形式,只是坐标不同,对于单元n-1
N
1
(
x
)
(
n
−
1
)
=
x
n
−
x
x
n
−
x
n
−
1
N_1(x)^{(n-1)}=\frac{x_n-x}{x_n-x_{n-1}}
N1(x)(n−1)=xn−xn−1xn−x
在整个区域,可以得到近似函数相加
V
‾
(
x
)
=
∑
e
=
1
n
−
1
V
‾
e
(
x
)
\overline{V}(x)=\sum_{e=1}^{n-1}\overline{V}^e(x)
V(x)=e=1∑n−1Ve(x)
平面线性三角元
我们选择试函数
U
‾
(
x
,
y
)
=
a
+
b
x
+
c
y
\overline{U}(x,y)=a+bx+cy
U(x,y)=a+bx+cy
U ‾ ( x , y ) = [ 1 x y ] { a b c } \overline{U}(x,y)=\begin{bmatrix}1&x&y\end{bmatrix}\begin{Bmatrix}a\\b\\c\end{Bmatrix} U(x,y)=[1xy]⎩ ⎨ ⎧abc⎭ ⎬ ⎫
令试函数与待求函数相等
U
‾
(
x
1
,
y
1
)
=
a
+
b
x
1
+
c
y
1
=
F
1
U
‾
(
x
2
,
y
2
)
=
a
+
b
x
2
+
c
y
2
=
F
2
U
‾
(
x
3
,
y
3
)
=
a
+
b
x
3
+
c
y
3
=
F
3
\overline{U}(x_1,y_1)=a+bx_1+cy_1=F_1\\\overline{U}(x_2,y_2)=a+bx_2+cy_2=F_2\\\overline{U}(x_3,y_3)=a+bx_3+cy_3=F_3
U(x1,y1)=a+bx1+cy1=F1U(x2,y2)=a+bx2+cy2=F2U(x3,y3)=a+bx3+cy3=F3
写成矩阵形式
[
1
x
1
y
1
1
x
2
y
2
1
x
3
y
3
]
{
a
b
c
}
=
{
F
1
F
2
F
3
}
\begin{bmatrix}1&x_1&y_1\\1&x_2&y_2\\1&x_3&y_3\end{bmatrix}\begin{Bmatrix}a\\b\\c\end{Bmatrix}=\begin{Bmatrix}F_1\\F_2\\F_3\end{Bmatrix}
111x1x2x3y1y2y3
⎩
⎨
⎧abc⎭
⎬
⎫=⎩
⎨
⎧F1F2F3⎭
⎬
⎫
如果上面的矩阵不奇异,也就是说三个节点不重合而且不共线,则方程可以解出a,b和c
{
a
b
c
}
=
[
1
x
1
y
1
1
x
2
y
2
1
x
3
y
3
]
−
1
{
F
1
F
2
F
3
}
\begin{Bmatrix}a\\b\\c\end{Bmatrix}=\begin{bmatrix}1&x_1&y_1\\1&x_2&y_2\\1&x_3&y_3\end{bmatrix}^{-1}\begin{Bmatrix}F_1\\F_2\\F_3\end{Bmatrix}
⎩
⎨
⎧abc⎭
⎬
⎫=
111x1x2x3y1y2y3
−1⎩
⎨
⎧F1F2F3⎭
⎬
⎫
上式可以写成
U
‾
(
x
,
y
)
=
[
N
1
(
x
,
y
)
N
2
(
x
,
y
)
N
3
(
x
,
y
)
]
{
F
1
F
2
F
3
}
\overline{U}(x,y)=\begin{bmatrix}N_1(x,y)&N_2(x,y)&N_3(x,y)\end{bmatrix}\begin{Bmatrix}F_1\\F_2\\F_3\end{Bmatrix}
U(x,y)=[N1(x,y)N2(x,y)N3(x,y)]⎩
⎨
⎧F1F2F3⎭
⎬
⎫
因此插值函数可表示为
N
1
(
x
,
y
)
=
1
2
A
(
(
y
3
−
y
2
)
(
x
2
−
x
)
−
(
x
3
−
x
2
)
(
y
2
−
y
)
)
N
2
(
x
,
y
)
=
1
2
A
(
(
y
1
−
y
3
)
(
x
3
−
x
)
−
(
x
1
−
x
3
)
(
y
3
−
y
)
)
N
3
(
x
,
y
)
=
1
2
A
(
(
y
2
−
y
1
)
(
x
1
−
x
)
−
(
x
2
−
x
1
)
(
y
1
−
y
)
)
\begin{gathered} N_{1}(x,y) =\frac1{2A}((y_3-y_2)(x_2-x)-(x_3-x_2)(y_2-y)) \\ N_{2}(x,y) =\frac1{2A}((y_1-y_3)(x_3-x)-(x_1-x_3)(y_3-y)) \\ N_3(x,y) =\frac1{2A}((y_2-y_1)(x_1-x)-(x_2-x_1)(y_1-y)) \end{gathered}
N1(x,y)=2A1((y3−y2)(x2−x)−(x3−x2)(y2−y))N2(x,y)=2A1((y1−y3)(x3−x)−(x1−x3)(y3−y))N3(x,y)=2A1((y2−y1)(x1−x)−(x2−x1)(y1−y))
其中
A
=
1
2
det
[
1
x
1
y
1
1
x
2
y
2
1
x
3
y
3
]
A=\frac{1}{2}\det\begin{bmatrix}1&x_1&y_1\\1&x_2&y_2\\1&x_3&y_3\end{bmatrix}
A=21det
111x1x2x3y1y2y3
插值函数也可以表示为
N
1
(
x
,
y
)
=
m
11
+
m
12
x
+
m
13
y
N
2
(
x
,
y
)
=
m
21
+
m
22
x
+
m
23
y
N
3
(
x
,
y
)
=
m
31
+
m
32
x
+
m
33
y
N_{1}(x,y)=m_{11}+m_{12}x+m_{13}y\\N_{2}(x,y)=m_{21}+m_{22}x+m_{23}y\\N_{3}(x,y)=m_{31}+m_{32}x+m_{33}y
N1(x,y)=m11+m12x+m13yN2(x,y)=m21+m22x+m23yN3(x,y)=m31+m32x+m33y
其中
m
11
=
x
2
y
3
−
x
3
y
2
2
A
m
12
=
y
2
−
y
3
2
A
m
13
=
x
3
−
x
2
2
A
m
21
=
x
3
y
1
−
x
1
y
3
2
A
m
22
=
y
3
−
y
1
2
A
m
23
=
x
1
−
x
3
2
A
m
31
=
x
1
y
2
−
x
2
y
1
2
A
m
32
=
y
1
−
y
2
2
A
m
33
=
x
2
−
x
1
2
A
m_{11}=\frac{x_2y_3-x_3y_2}{2A}m_{12}=\frac{y_2-y_3}{2A}m_{13}=\frac{x_3-x_2}{2A}\\m_{21}=\frac{x_3y_1-x_1y_3}{2A}m_{22}=\frac{y_3-y_1}{2A}m_{23}=\frac{x_1-x_3}{2A}\\m_{31}=\frac{x_1y_2-x_2y_1}{2A}m_{32}=\frac{y_1-y_2}{2A}m_{33}=\frac{x_2-x_1}{2A}
m11=2Ax2y3−x3y2m12=2Ay2−y3m13=2Ax3−x2m21=2Ax3y1−x1y3m22=2Ay3−y1m23=2Ax1−x3m31=2Ax1y2−x2y1m32=2Ay1−y2m33=2Ax2−x1
插值函数满足的条件
N
i
(
x
j
,
y
j
)
=
{
1
,
i
=
j
0
,
i
≠
j
在节点 1 处,
N
1
(
x
1
,
y
1
)
=
1
,
N
2
(
x
1
,
y
1
)
=
0
,
N
3
(
x
1
,
y
1
)
=
0
在节点 2 处,
N
1
(
x
2
,
y
2
)
=
0
,
N
2
(
x
2
,
y
2
)
=
1
,
N
3
(
x
2
,
y
2
)
=
0
在节点 3 处,
N
1
(
x
3
,
y
3
)
=
0
,
N
2
(
x
3
,
y
3
)
=
0
,
N
3
(
x
3
,
y
3
)
=
1
N_{i}(x_{j},y_{j})=\begin{cases}1,\quad i=j\\0,\quad i\neq j\end{cases}\\\text{在节点 1 处,}N_1(x_1,y_1)=1,\quad N_2(x_1,y_1)=0,\quad N_3(x_1,y_1)=0\\\text{在节点 2 处,}N_1(x_2,y_2)=0,\quad N_2(x_2,y_2)=1,\quad N_3(x_2,y_2)=0\\\text{在节点 3 处,}N_1(x_3,y_3)=0,\quad N_2(x_3,y_3)=0,\quad N_3(x_3,y_3)=1
Ni(xj,yj)={1,i=j0,i=j在节点 1 处,N1(x1,y1)=1,N2(x1,y1)=0,N3(x1,y1)=0在节点 2 处,N1(x2,y2)=0,N2(x2,y2)=1,N3(x2,y2)=0在节点 3 处,N1(x3,y3)=0,N2(x3,y3)=0,N3(x3,y3)=1
在三角形内部
∑
i
=
1
3
N
i
(
x
,
y
)
=
1
\sum_{i=1}^3 N_i(x,y)=1
i=1∑3Ni(x,y)=1
等参元
试函数还可以在母单元上进行构建,然后使用几何变换
τ
\tau
τ将其转换为子单元。几何变换用母单元的坐标来确定子单元的坐标(x,y)
τ
:
(
ξ
,
η
)
⟼
(
x
,
y
)
=
τ
(
ξ
,
η
)
\tau:\quad(\xi,\eta)\quad\longmapsto\quad(x,y)=\tau(\xi,\eta)
τ:(ξ,η)⟼(x,y)=τ(ξ,η)
为了定义几何变换,假设子单元是母单元在局部坐标系定义内的函数
x
=
α
1
+
α
2
ξ
+
α
3
η
x=\alpha_1+\alpha_2\xi+\alpha_3\eta
x=α1+α2ξ+α3η
上式可以写成矩阵形式
x
=
[
1
ξ
,
η
]
[
α
1
α
2
α
3
]
x=\begin{bmatrix}1&\xi,&\eta\end{bmatrix}\begin{bmatrix}\alpha_1\\\alpha_2\\\alpha_3\end{bmatrix}
x=[1ξ,η]
α1α2α3
利用节点1,2,3处的节点值
x
1
,
x
2
,
x
3
x_1,x_2,x_3
x1,x2,x3, 表示为节点解
x
1
=
α
1
x
2
=
α
1
+
α
2
x
3
=
α
1
+
α
3
\begin{aligned}&x_{1}=\alpha_{1}\\&x_{2}=\alpha_1+\alpha_2\\&x_{3}=\alpha_{1}+\alpha_{3}\end{aligned}
x1=α1x2=α1+α2x3=α1+α3
写成矩阵形式
{
x
1
x
2
x
3
}
=
[
1
0
0
1
1
0
1
0
1
]
{
α
1
α
2
α
3
}
\begin{Bmatrix}x_1\\x_2\\x_3\end{Bmatrix}=\begin{bmatrix}1&0&0\\1&1&0\\1&0&1\end{bmatrix}\begin{Bmatrix}\alpha_1\\\alpha_2\\\alpha_3\end{Bmatrix}
⎩
⎨
⎧x1x2x3⎭
⎬
⎫=
111010001
⎩
⎨
⎧α1α2α3⎭
⎬
⎫
简写为
{
X
}
=
[
A
]
{
α
}
\{X\}=[A]\{\alpha\}
{X}=[A]{α}
通过求解可以得到参数
α
i
\alpha_i
αi,矩阵的逆为
[
A
]
−
1
=
[
1
0
0
−
1
1
0
−
1
0
1
]
[A]^{-1}=\begin{bmatrix}1&0&0\\-1&1&0\\-1&0&1\end{bmatrix}
[A]−1=
1−1−1010001
因此参数
α
i
\alpha_i
αi为
{
α
1
α
2
α
3
}
=
[
1
0
0
−
1
1
0
−
1
0
1
]
{
x
1
x
2
x
3
}
\begin{Bmatrix}\alpha_1\\\alpha_2\\\alpha_3\end{Bmatrix}=\begin{bmatrix}1&0&0\\-1&1&0\\-1&0&1\end{bmatrix}\begin{Bmatrix}x_1\\x_2\\x_3\end{Bmatrix}
⎩
⎨
⎧α1α2α3⎭
⎬
⎫=
1−1−1010001
⎩
⎨
⎧x1x2x3⎭
⎬
⎫
将参数
α
i
\alpha_i
αi代入可得
x
(
ξ
,
η
)
=
[
1
ξ
,
η
]
[
1
0
0
−
1
1
0
−
1
0
1
]
{
x
1
x
2
x
3
}
x(\xi,\eta)=\begin{bmatrix}1&\xi,&\eta\end{bmatrix}\begin{bmatrix}1&0&0\\-1&1&0\\-1&0&1\end{bmatrix}\begin{Bmatrix}x_1\\x_2\\x_3\end{Bmatrix}
x(ξ,η)=[1ξ,η]
1−1−1010001
⎩
⎨
⎧x1x2x3⎭
⎬
⎫
整理可得
x
(
ξ
,
η
)
=
τ
1
(
ξ
,
η
)
x
1
+
τ
2
(
ξ
,
η
)
x
2
+
τ
3
(
ξ
,
η
)
x
3
x(\xi,\eta)=\tau_1(\xi,\eta)x_1+\tau_2(\xi,\eta)x_2+\tau_3(\xi,\eta)x_3
x(ξ,η)=τ1(ξ,η)x1+τ2(ξ,η)x2+τ3(ξ,η)x3
而且
τ
1
(
ξ
,
η
)
=
1
−
ξ
−
η
τ
2
(
ξ
,
η
)
=
ξ
τ
3
(
ξ
,
η
)
=
η
\begin{aligned}&\tau_{1}(\xi,\eta)=1-\xi-\eta\\&\tau_{2}(\xi,\eta)=\xi\\&\tau_{3}(\xi,\eta)=\eta\end{aligned}
τ1(ξ,η)=1−ξ−ητ2(ξ,η)=ξτ3(ξ,η)=η
同理可以得到y的表达式
y
(
ξ
,
η
)
=
τ
1
(
ξ
,
η
)
y
1
+
τ
2
(
ξ
,
η
)
y
2
+
τ
3
(
ξ
,
η
)
y
3
y(\xi,\eta)=\tau_1(\xi,\eta)y_1+\tau_2(\xi,\eta)y_2+\tau_3(\xi,\eta)y_3
y(ξ,η)=τ1(ξ,η)y1+τ2(ξ,η)y2+τ3(ξ,η)y3