哈工大材料力學(xué)上機_第1頁
哈工大材料力學(xué)上機_第2頁
哈工大材料力學(xué)上機_第3頁
哈工大材料力學(xué)上機_第4頁
哈工大材料力學(xué)上機_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、材料力學(xué)上機大作業(yè)應(yīng)力狀態(tài)分析 曹啟迪 1120810831一、 問題的提出該程序可以解決的問題: 平面應(yīng)力狀態(tài),已知x,y,xy和角度的情況下計算不同任意截面的應(yīng)力分量,還可以計算平面應(yīng)力狀態(tài)主應(yīng)力的大小和方向并能畫出應(yīng)力圓; 空間應(yīng)力狀態(tài),已知x,y,z,xy等的情況下計算主應(yīng)力和最大切應(yīng)力。2、 程序源代碼平面private sub command1_click()dim x as double, y as double, xy as double, as double, x as double, y as double, z as doublex = val(text1.text)y

2、= val(text2.text)xy = val(text3.text) = val(text4.text)x = 0y = (x + y) / 2 + (x - y) 2 / 4 + xy 2) 0.5z = (x + y) / 2 - (x - y) 2 / 4 + xy 2) 0.5if x = y and x = z thentext5.text = str(x)text6.text = str(y)text7.text = str(z)text8.text = str(x - z) / 2) else if x = y and x = z thentext5.text = str(

3、y)text6.text = str(z)text7.text = str(x)text8.text = str(y - x) / 2) elsetext5.text = str(y)text6.text = str(x)text7.text = str(z)text8.text = str(y - z) / 2)end ifend iftext9.text = str(x + y) / 2 + (x - y) / 2 * cos(2 * ) + xy * sin(2 * )text10.text = str(-(x - y) / 2 * sin(2 * ) + xy * cos(2 * )i

4、f x = y thentext11.text = str(45) else text11.text = str(atn(xy 2 / (x - y) / 2)end ifif (x - y) 2 / 4 + xy 2) 0.5 = 20 thenpicture1.scalemode = 3picture1.scale (0, 0)-(200, 80)picture1.scale (-100, 40)-(100, -40)picture1.line (-100, 0)-(100, 0)picture1.line (0, -40)-(0, 40)picture1.circle (x + y) /

5、 2, 0), (x - y) 2 / 4 + xy 2) 0.5, qbcolor(12) else if (x - y) 2 / 4 + xy 2) 0.5 0 thenpicture1.scalemode = 3picture1.scale (0, 0)-(80, 40)picture1.scale (-40, 20)-(40, -20)picture1.line (-40, 0)-(40, 0)picture1.line (0, -20)-(0, 20)picture1.circle (x + y) / 2, 0), (x - y) 2 / 4 + xy 2) 0.5, qbcolor

6、(12) elsepicture1.scalemode = 3picture1.scale (0, 0)-(400, 200)picture1.scale (-200, 100)-(200, -100)picture1.line (-200, 0)-(200, 0)picture1.line (0, -100)-(0, 100)picture1.circle (x + y) / 2, 0), (x - y) 2 / 4 + xy 2) 0.5, qbcolor(12) end ifend ifend subprivate sub command2_click()text1.text = tex

7、t2.text = text3.text = text4.text = text5.text = text6.text = text7.text = text8.text = text9.text = text10.text = text11.text = picture1.clsend sub空間private sub command1_click()dim x as double, y as double, z as double, xy as double, yz as double, zx as doublex = val(text1.text)y = val(text3.text)z

8、 = val(text2.text)xy = val(text4.text)yz = val(text5.text)zx = val(text6.text) i1 = x + y + z i2 = x * y - xy 2 + y * z - yz 2 + z * x - zx 2 i3 = (y * z - yz 2) * x - (xy * z - yz * zx) * xy + (xy * yz - zx * y) * zxa = i1 2 - 3 * 1 * i2b = -i1 * i2 + 9 * 1 * i3c = i2 2 - 3 * i1 * i3d = b 2 - 4 * a

9、 * cif (a = 0 and b = 0) thenx1 = i1 / 3x2 = i1 / 3x3 = i1 / 3end ifif (a 0 and d = 0) thenx1 = i1 + b / ax2 = -b / (2 * a)x3 = -b / (2 * a)end ifif (d 0) then t = (-2 * a * i1 - 3 * b) / (2 * a (3 / 2) if (t = 0) then u = 3.14159265357979 / 2 x1 = (i1 - 2 * a (1 / 2) * cos(u / 3) / 3 x2 = (i1 + a (

10、1 / 2) * (cos(u / 3) + 3 (1 / 2) * sin(u / 3) / 3 x3 = (i1 + a (1 / 2) * (cos(u / 3) - 3 (1 / 2) * sin(u / 3) / 3 else if (-1 t and t 1 and t 0) then u = atn(1 - t 2) / t) x1 = (i1 - 2 * a (1 / 2) * cos(u / 3) / 3 x2 = (i1 + a (1 / 2) * (cos(u / 3) + 3 (1 / 2) * sin(u / 3) / 3 x3 = (i1 + a (1 / 2) *

11、 (cos(u / 3) - 3 (1 / 2) * sin(u / 3) / 3 end if end ifend ifif (d 0 or d 0 and a = x2 and x2 = x3) then text7.text = str(x1) text8.text = str(x2) text9.text = str(x3) text10.text = str(x1 - x3) / 2) picture2.scalemode = 3 picture2.scale (0, 0)-(200, 80) picture2.scale (-100, 40)-(100, -40) picture2

12、.line (-100, 0)-(100, 0) picture2.line (0, -40)-(0, 40) picture2.circle (x1 + x2) / 2, 0), (x1 - x2) / 2, qbcolor(12) picture2.circle (x1 + x3) / 2, 0), (x1 - x3) / 2, qbcolor(12) picture2.circle (x2 + x3) / 2, 0), (x2 - x3) / 2, qbcolor(12) end if if (x1 = x3 and x3 = x2) then text7.text = str(x1)

13、text8.text = str(x3) text9.text = str(x2) text10.text = str(x1 - x2) / 2) picture2.scalemode = 3 picture2.scale (0, 0)-(200, 80) picture2.scale (-100, 40)-(100, -40) picture2.line (-100, 0)-(100, 0) picture2.line (0, -40)-(0, 40) picture2.circle (x1 + x2) / 2, 0), (x1 - x2) / 2, qbcolor(12) picture2

14、.circle (x1 + x3) / 2, 0), (x1 - x3) / 2, qbcolor(12) picture2.circle (x2 + x3) / 2, 0), (x3 - x2) / 2, qbcolor(12) end if if (x2 = x1 and x1 = x3) then text7.text = str(x2) text8.text = str(x1) text9.text = str(x3) text10.text = str(x2 - x3) / 2) picture2.scalemode = 3 picture2.scale (0, 0)-(200, 8

15、0) picture2.scale (-100, 40)-(100, -40) picture2.line (-100, 0)-(100, 0) picture2.line (0, -40)-(0, 40) picture2.circle (x1 + x2) / 2, 0), (x2 - x1) / 2, qbcolor(12) picture2.circle (x1 + x3) / 2, 0), (x1 - x3) / 2, qbcolor(12) picture2.circle (x2 + x3) / 2, 0), (x2 - x3) / 2, qbcolor(12) end if if

16、(x2 = x3 and x3 = x1) then text7.text = str(x2) text8.text = str(x3) text9.text = str(x1) text10.text = str(x2 - x1) / 2) picture2.scalemode = 3 picture2.scale (0, 0)-(200, 80) picture2.scale (-100, 40)-(100, -40) picture2.line (-100, 0)-(100, 0) picture2.line (0, -40)-(0, 40) picture2.circle (x1 +

17、x2) / 2, 0), (x2 - x1) / 2, qbcolor(12) picture2.circle (x1 + x3) / 2, 0), (x3 - x1) / 2, qbcolor(12) picture2.circle (x2 + x3) / 2, 0), (x2 - x3) / 2, qbcolor(12) end if if (x3 = x1 and x1 = x2) then text7.text = str(x3) text8.text = str(x1) text9.text = str(x2) text10.text = str(x3 - x1) / 2) pict

18、ure2.scalemode = 3 picture2.scale (0, 0)-(200, 80) picture2.scale (-100, 40)-(100, -40) picture2.line (-100, 0)-(100, 0) picture2.line (0, -40)-(0, 40) picture2.circle (x1 + x2) / 2, 0), (x1 - x2) / 2, qbcolor(12) picture2.circle (x1 + x3) / 2, 0), (x3 - x1) / 2, qbcolor(12) picture2.circle (x2 + x3

19、) / 2, 0), (x3 - x2) / 2, qbcolor(12) end if if (x3 = x2 and x2 = x1) then text7.text = str(x3) text8.text = str(x2) text9.text = str(x1) text10.text = str(x3 - x1) / 2) picture2.scalemode = 3 picture2.scale (0, 0)-(200, 80) picture2.scale (-100, 40)-(100, -40) picture2.line (-100, 0)-(100, 0) picture2.line (0, -40)-(

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論