结构力学 结构矩阵程序设计原理源程序代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
'===========================================
'Structural Analysis Program for Plane Frame
'===========================================
Option Explicit
Dim nn As Integer, ne As Integer, nd As Integer, ndf As Integer
Dim nf As Integer, npj As Integer, npe As Integer, n As Integer
Dim al(50) As Double, t(6, 6) As Double, x(40) As Double, y(40) As Double
Dim jl(50) As Integer, jr(50) As Integer, ea(50) As Double, ei(50) As Double
Dim c(6, 6) As Double, r(120, 120) As Double, p(120) As Double, pe(120) As Double
Dim ibd(20) As Integer, ii(6) As Integer, bd(20) As Double, ff(6) As Double
Dim mj(20) As Integer, qj(20, 3) As Double, f(6) As Double, dis(6) As Double
Dim mf(30) As Integer, ind(30) As Integer, aq(30) As Double, bq(30) As Double
Dim q1(30) As Double, q2(30) As Double
'===================================
'SUB-1 Read and Print Initial Data
'===================================
Sub input1()
Dim inti As Integer, intj As Integer, i As Integer, j As Integer, k As Integer
Dim dx, dy As Double
Print #2, "Plane Frame Structural Analysis"
Print #2, "****************************"
Print #2, "Input Data"
Print #2, "= = = = = = = "
Print #2,
Print #2, "Structural Control Data"
Print #2, "------------------------------"
Print #2, "nn"; Spc(3); "ne"; Spc(3); "nf"; Spc(3); "nd"; Spc(3); "ndf"; Spc(2); "npj"; Spc(2); "npe"; Spc(3); "n"
Input #1, nn, ne, nf, nd, ndf, npj, npe
n = 3 * (nn - nf)
Print #2, nn; Spc(2); ne; Spc(2); nf; Spc(2); nd; Spc(2); ndf; Spc(2); npj; Spc(2); npe; Spc(2); n Print #2,
Print #2, "Nodal Coordinates"
Print #2, "---------------------------"
Print #2, "Node"; Spc(2); "x"; Spc(5); "y"
i = nn
For inti = 1 To i
Input #1, inti, x(inti), y(inti)
Print #2, inti; Spc(2); x(inti); Spc(3); y(inti)
Next inti
Print #2,
Print #2, "Element Information"
Print #2, "-----------------------------"
Print #2, "Ele.No."; Spc(2); "jl"; Spc(2); "jr"; Spc(5); "ea"; Spc(7); "ei"; Spc(5); "al"
i = ne
For inti = 1 To i
Input #1, inti, jl(inti), jr(inti), ea(inti), ei(inti)
Next inti
For inti = 1 To i
If jl(inti) >= jr(inti) Then Stop
Next inti
For inti = 1 To i
j = jl(inti)
k = jr(inti)
dx = x(k) - x(j)
dy = y(k) - y(j)
al(inti) = Sqr(dx * dx + dy * dy)
Print #2, Spc(3); inti; Spc(4); jl(inti); Spc(3); jr(inti); Spc(2); ea(inti); Spc(2); ei(inti); Spc(2); al(inti)
Next inti
Print #2,
k = npj
If k <> 0 Then
Print #2, "Nodal Load"
Print #2, "---------------"
Print #2, "i"; Spc(3); "mj"; Spc(2); "xd"; Spc(2); "yd"; Spc(2); "md"
For inti = 1 To k
Input #1, inti, mj(inti), qj(inti, 1), qj(inti, 2), qj(inti, 3)
Print #2, inti; Spc(2); mj(inti); Spc(2); qj(inti, 1); Spc(2); qj(inti, 2); Spc(2); qj(inti, 3) Next inti
End If
Print #2,
i = npe
If i <> 0 Then
Print #2, "Element Loads"
Print #2, "-------------------"
Print #2, "i"; Spc(3); "mf"; Spc(2); "ind"; Spc(2); "aq"; Spc(2); "bq"; Spc(2); "q1"; Spc(3); "q2"
For inti = 1 To i
Input #1, inti, mf(inti), ind(inti), aq(inti), bq(inti), q1(inti), q2(inti)
Print #2, inti; Spc(2); mf(inti); Spc(3); ind(inti); Spc(2); aq(inti); Spc(2); bq(inti); Spc(2); q1(inti); Spc(3); q2(inti)
Next inti
End If
Print #2,