19 January 2020 11:30:35 AM
FEM1D_LAGRANGE_TEST
C version.
Test the FEM1D_LAGRANGE library.
LEGENDRE_SET_TEST
LEGENDRE_SET returns points and weights of
Gauss-Legendre quadrature rules.
N 1 X^4 Runge
1 2 0 2
2 2 0.222222 0.214286
3 2 0.4 0.958333
4 2 0.4 0.370927
5 2 0.4 0.706948
6 2 0.4 0.461701
7 2 0.4 0.616122
8 2 0.4 0.508122
9 2 0.4 0.578703
10 2 0.4 0.530372
LAGRANGE_VALUE_TEST
LAGRANGE_VALUE evaluates the Lagrange basis polynomials.
Lagrange basis points:
0: 0
1: 1
2: 2
3: 3
4: 4
I X L1(X) L2(X) L3(X) L4(X) L5(X)
0 0.0000 1.0000 0.0000 -0.0000 0.0000 -0.0000
1 0.5000 0.2734 1.0938 -0.5469 0.2188 -0.0391
2 1.0000 -0.0000 1.0000 0.0000 -0.0000 0.0000
3 1.5000 -0.0391 0.4688 0.7031 -0.1562 0.0234
4 2.0000 0.0000 -0.0000 1.0000 0.0000 -0.0000
5 2.5000 0.0234 -0.1562 0.7031 0.4688 -0.0391
6 3.0000 -0.0000 0.0000 -0.0000 1.0000 0.0000
7 3.5000 -0.0391 0.2188 -0.5469 1.0938 0.2734
8 4.0000 0.0000 -0.0000 0.0000 -0.0000 1.0000
LAGRANGE_DERIVATIVE_TEST
LAGRANGE_DERIVATIVE evaluates the Lagrange basis derivative.
Lagrange basis points:
0: 0
1: 1
2: 2
3: 3
4: 4
I X L1'(X) L2'(X) L3'(X) L4'(X) L5'(X)
0 0.0000 -2.0833 4.0000 -3.0000 1.3333 -0.2500
1 0.5000 -0.9167 0.7083 0.3750 -0.2083 0.0417
2 1.0000 -0.2500 -0.8333 1.5000 -0.5000 0.0833
3 1.5000 0.0417 -1.1250 1.1250 -0.0417 0.0000
4 2.0000 0.0833 -0.6667 0.0000 0.6667 -0.0833
5 2.5000 0.0000 0.0417 -1.1250 1.1250 -0.0417
6 3.0000 -0.0833 0.5000 -1.5000 0.8333 0.2500
7 3.5000 -0.0417 0.2083 -0.3750 -0.7083 0.9167
8 4.0000 0.2500 -1.3333 3.0000 -4.0000 2.0833
FEM1D_LAGRANGE_STIFFNESS_TEST
FEM1D_LAGRANGE_STIFFNESS computes the stiffness matrix,
the mass matrix, and right hand side vector for a
finite element problem using Lagrange interpolation
basis polynomials.
Solving:
-u''+u=x on 0 < x < 1
u(0) = u(1) = 0
Exact solution:
u(x) = x - sinh(x)/sinh(1)
Number of mesh points = 11
Number of quadrature points = 5
I X U U(exact) Error
0 0.0000 -1.73472e-15 0 1.73472e-15
1 0.1000 0.0956213 0.0147663 0.080855
2 0.2000 0.227141 0.0286795 0.198462
3 0.3000 0.25017 0.0408782 0.209292
4 0.4000 0.406593 0.0504834 0.35611
5 0.5000 0.5 0.0565906 0.443409
6 0.6000 0.498838 0.0582599 0.440578
7 0.7000 0.676584 0.0545074 0.622077
8 0.8000 0.74956 0.0442945 0.705265
9 0.9000 0.744763 0.0265183 0.718244
10 1.0000 0 0 0
FEM1D_LAGRANGE_STIFFNESS_TEST
FEM1D_LAGRANGE_STIFFNESS computes the stiffness matrix,
the mass matrix, and right hand side vector for a
finite element problem using Lagrange interpolation
basis polynomials.
Solving:
-u''+u=x on 0 < x < 1
u(0) = u(1) = 0
Exact solution:
u(x) = x - sinh(x)/sinh(1)
Number of mesh points = 11
Number of quadrature points = 10
I X U U(exact) Error
0 0.0000 -3.88578e-16 0 3.88578e-16
1 0.1000 0.0147663 0.0147663 2.02616e-15
2 0.2000 0.0286795 0.0286795 1.77081e-14
3 0.3000 0.0408782 0.0408782 2.08167e-15
4 0.4000 0.0504834 0.0504834 2.67286e-14
5 0.5000 0.0565906 0.0565906 1.07692e-14
6 0.6000 0.0582599 0.0582599 7.02216e-15
7 0.7000 0.0545074 0.0545074 2.06155e-14
8 0.8000 0.0442945 0.0442945 1.79717e-15
9 0.9000 0.0265183 0.0265183 4.80171e-15
10 1.0000 0 0 0
FEM1D_LAGRANGE_TEST
Normal end of execution.
19 January 2020 11:30:35 AM
C 代码 设置与有限元关联的矩阵和向量 边界值问题 (BVP) 的方法 (FEM) 求解 -u''+u=f(x).rar
版权申诉
67 浏览量
2023-05-27
00:52:14
上传
评论
收藏 12KB RAR 举报
卷积神经网络
- 粉丝: 338
- 资源: 8460
最新资源
- python-leetcode面试题解之第157题用Read4读取N个字符-题解.zip
- python-leetcode面试题解之第156题上下翻转二叉树-题解.zip
- python-leetcode面试题解之第155题最小栈-题解.zip
- python-leetcode面试题解之第153题寻找旋转排序数组中的最小值-题解.zip
- python-leetcode面试题解之第152题乘积最大子数组-题解.zip
- python-leetcode面试题解之第151题反转字符串中的单词-题解.zip
- python-leetcode面试题解之第150题逆波兰表达式求值-题解.zip
- python-leetcode面试题解之第149题直线上最多的点数-题解.zip
- python-leetcode面试题解之第148题排序链表-题解.zip
- python-leetcode面试题解之第147题对链表进行插入排序-题解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈