版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Harbin Institute of Technology材料力学电算大作业题目名称: 梁的力学分析 作者班级: 1402401 作者学号: 作者姓名: 指导教师: 完成时间: 2016年6月20日 目 录一 组合截面几何性质计算11 理论12 程序()2二 应力状态分析81 理论82 程序()9三 绘制梁的剪力、弯矩图191理论192 程序()20四 启动窗体29五 算例311组合截面几何性质计算312 应力状态分析323 绘制梁的剪力、弯矩图34一 组合截面几何性质计算1 理论(一)计算质心 若截面为矩形,则 若截面为圆形,则 若截面为环形,则 (二)计算主惯性矩 若截面为矩形,则 若截
2、面为圆形,则 若截面为环形,则 2 程序()Public Class Geometric Private intShape As Integer = -1 '定义储存cmb.item值的参数 '定义绘图类 Dim graph As Graphics Dim penCoordinate As New Pen(Color.Black, 3) Dim penInertia As New Pen(Color.Blue, 2) Dim penNet As New Pen(Color.Gray) Dim figureColor As Brush Private Sub Geometric_
3、Load(sender As Object, e As EventArgs) Handles MyBase.Load graph = picGeometric.CreateGraphics penCoordinate.EndCap = Drawing2D.LineCap.ArrowAnchor penNet.DashStyle = Drawing2D.DashStyle.DashDot figureColor = Brushes.LemonChiffon End SubPrivate Sub cmbShape_SelectedIndexChanged(sender As Object, e A
4、s EventArgs) _ Handles cmbShape.SelectedIndexChanged intShape = cmbShape.SelectedIndex If intShape = 0 Then '选择圆 lblOne.Text = "D:" lblTwo.Text = "" txtOne.Enabled = True txtOne.Text = "" txtTwo.Enabled = False txtTwo.Text = "" lblI.Text = "X轴主惯性矩:&qu
5、ot; & vbNewLine & vbNewLine & "Y轴主惯性矩:" ElseIf intShape = 1 Then '选择圆环 lblOne.Text = "D:" lblTwo.Text = "d:" txtOne.Enabled = True txtOne.Text = "" txtTwo.Enabled = True txtTwo.Text = "" lblI.Text = "X轴主惯性矩:" & vbNewLine
6、 & vbNewLine & "Y轴主惯性矩:" Else '选择矩形 lblOne.Text = "h:" lblTwo.Text = "b:" txtOne.Enabled = True txtOne.Text = "" txtTwo.Enabled = True txtTwo.Text = "" lblI.Text = "X轴主惯性矩:" & vbNewLine & vbNewLine & "Y轴主惯性矩:&qu
7、ot; End If End SubPrivate Sub btnCalculate_Click(sender As Object, e As EventArgs) _ Handles btnCalculate.Click '定义输入参数 Dim r As Single Dim r1 As Single Dim r2 As Single Dim h As Single Dim b As Single Dim x As Single Dim y As Single '定义坐标缩放比例参数 Dim kx As Single Dim ky As Single Dim k As Sin
8、gle '定义输出惯性矩 Dim ix As Single Dim iy As Single '错误提示 If intShape = -1 Then MessageBox.Show("请选择截面形状!", "错误") Exit Sub End If If txtX.Text = "" Or txtY.Text = "" Then MessageBox.Show("请输入形心坐标!", "错误") Exit Sub End If graph.Clear(Colo
9、r.White) '清空绘图区 If intShape = 0 Then '错误提示 If txtOne.Text = "" Then MessageBox.Show("请输入直径!", "错误") Exit Sub End If r = txtOne.Text / 2 x = txtX.Text y = txtY.Text '计算惯性矩 ix = Math.PI * r 4 / 4 iy = ix '计算缩放比例 kx = (Math.Abs(x) + r) / (picGeometric.Width
10、 / 2 - 30) ky = (Math.Abs(y) + r) / (picGeometric.Height / 2 - 30) k = Math.Max(kx, ky) If k < 0.1 Then k = 0.1 ElseIf k < 1 Then k = Math.Round(k, 1) Else k = Math.Round(k, 0) End If '坐标变换 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, 1) '绘图 graph.FillEllip
11、se(figureColor, (x - r) / k, (y - r) / k, 2 * r / k, 2 * r / k) '坐标复原 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, -1) '绘制坐标系 Form1.DrawCoordinate(graph, penCoordinate, penNet, picGeometric.Width, picGeometric.Height, k) '坐标变换 Form1.CoordinateTransform(graph,
12、 picGeometric.Width, picGeometric.Height, 1) '绘制主轴 graph.DrawLine(penInertia, CType(x - 1.5 * r) / k, Single), y / k, CType(x + 1.5 * r) / k, Single), y / k) graph.DrawLine(penInertia, x / k, CType(y - 1.5 * r) / k, Single), x / k, CType(y + 1.5 * r) / k, Single) '坐标复原 Form1.CoordinateTransf
13、orm(graph, picGeometric.Width, picGeometric.Height, -1) '输出惯性矩 lblI.Text = "X轴主惯性矩:" & ix & vbNewLine & "Y轴主惯性矩:" & iy ElseIf intShape = 1 Then '错误提示 If txtOne.Text = "" Or txtTwo.Text = "" Then MessageBox.Show("请输入直径!", "
14、;错误") Exit Sub End If r1 = txtOne.Text / 2 r2 = txtTwo.Text / 2 x = txtX.Text y = txtY.Text '计算惯性矩 ix = Math.PI * (r1 4 - r2 4) / 4 iy = ix '计算缩放比例 kx = (Math.Abs(x) + r1) / (picGeometric.Width / 2 - 30) ky = (Math.Abs(y) + r1) / (picGeometric.Height / 2 - 30) k = Math.Max(kx, ky) If k
15、< 0.1 Then k = 0.1 ElseIf k < 1 Then k = Math.Round(k, 1) Else k = Math.Round(k, 0) End If '坐标变换 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, 1) '绘图 graph.FillEllipse(figureColor, (x - r1) / k, (y - r1) / k, 2 * r1 / k, 2 * r1 / k) graph.FillEllipse(Brushes
16、.White, (x - r2) / k, (y - r2) / k, 2 * r2 / k, 2 * r2 / k) '坐标复原 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, -1) '绘制坐标系 Form1.DrawCoordinate(graph, penCoordinate, penNet, picGeometric.Width, picGeometric.Height, k) '坐标变换 Form1.CoordinateTransform(graph, pic
17、Geometric.Width, picGeometric.Height, 1) '绘制主轴 graph.DrawLine(penInertia, CType(x - 1.5 * r1) / k, Single), y / k, CType(x + 1.5 * r1) / k, Single), y / k) graph.DrawLine(penInertia, x / k, CType(y - 1.5 * r1) / k, Single), x / k, CType(y + 1.5 * r1) / k, Single) '坐标复原 Form1.CoordinateTransf
18、orm(graph, picGeometric.Width, picGeometric.Height, -1) '输出惯性矩 lblI.Text = "X轴主惯性矩:" & ix & vbNewLine & "Y轴主惯性矩:" & iy Else '错误提示 If txtOne.Text = "" Or txtTwo.Text = "" Then MessageBox.Show("请输入直径!", "错误") Exit Sub
19、End If h = txtOne.Text b = txtTwo.Text x = txtX.Text y = txtY.Text '计算惯性矩 ix = h 3 * b / 12 iy = h * b 3 / 12 '计算缩放比例 kx = (Math.Abs(x) + b / 2) / (picGeometric.Width / 2 - 30) ky = (Math.Abs(y) + h / 2) / (picGeometric.Height / 2 - 30) k = Math.Max(kx, ky) If k < 0.1 Then k = 0.1 ElseIf
20、k < 1 Then k = Math.Round(k, 1) Else k = Math.Round(k, 0) End If '坐标变换 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, 1) '绘图 graph.FillRectangle(figureColor, (x - b / 2) / k, (y - h / 2) / k, b / k, h / k) '坐标复原 Form1.CoordinateTransform(graph, picGeometric.
21、Width, picGeometric.Height, -1) '绘制坐标系 Form1.DrawCoordinate(graph, penCoordinate, penNet, picGeometric.Width, picGeometric.Height, k) '坐标变换 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, 1) '绘制主轴 graph.DrawLine(penInertia, CType(x - 0.75 * b) / k, Single), y /
22、k, CType(x + 0.75 * b) / k, Single), y / k) graph.DrawLine(penInertia, x / k, CType(y - 0.75 * h) / k, Single), x / k, CType(y + 0.75 * h) / k, Single) '坐标复原 Form1.CoordinateTransform(graph, picGeometric.Width, picGeometric.Height, -1) '输出惯性矩 lblI.Text = "X轴主惯性矩:" & ix & vb
23、NewLine & "Y轴主惯性矩:" & iy End If End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Close() End SubEnd Class二 应力状态分析1 理论(一)二向应力状态分析任意截面上的应力 主应力及主方向 最大切应力 (一)三向应力状态分析特征方程 式中系数 利用卡尔丹诺法解特征方程得三个主应力最大切应力 2 程序()(一)窗体Public Class StressState '定义绘图
24、类 Dim graph As Graphics Dim penCoordinate As New Pen(Color.Black, 3) Dim penNet As New Pen(Color.Gray) Dim penFigure As New Pen(Color.Black, 2) Dim penAuxiliary As New Pen(Color.Black) Dim figureColor As Brush Private Sub StressState_Load(sender As Object, e As EventArgs) Handles MyBase.Load graph =
25、 picStressState.CreateGraphics penCoordinate.EndCap = Drawing2D.LineCap.ArrowAnchor penNet.DashStyle = Drawing2D.DashStyle.DashDot figureColor = Brushes.LightGray End SubPrivate Sub btnPlaneCalculate_Click(sender As Object, e As EventArgs) _ Handles btnPlaneCalculate.Click '定义输入参数 Dim sigmax As
26、Double Dim sigmay As Double Dim tauxy As Double Dim alpha As Double '定义输出参数 Dim sigma1 As Double Dim sigma2 As Double Dim sigma3 As Double Dim tauMax As Double Dim sigma_alpha As Double Dim tau_alpha As Double Dim alpha1 As Double Dim alpha2 As Double '定义应力圆参数 Dim Cx As Double Dim Cy As Doub
27、le Dim r As Double '定义绘图参数 Dim kx As Single Dim ky As Single Dim k As Single '错误提示 If txtPlaneSigmaX.Text = "" Or txtPlaneSigmaY.Text = "" Or txtPlaneTauXY.Text = "" Then MessageBox.Show("请输入应力状态!", "错误") Exit Sub End If If txtPlaneAlpha.Text
28、 = "" Then MessageBox.Show("请输入截面方位角!", "错误") Exit Sub End If '初始化参数 sigmax = txtPlaneSigmaX.Text sigmay = txtPlaneSigmaY.Text tauxy = txtPlaneTauXY.Text alpha = txtPlaneAlpha.Text / 180 * Math.PI Cx = (sigmax + sigmay) / 2 Cy = 0 r = Math.Sqrt(sigmax - sigmay) * (s
29、igmax - sigmay) / 4 + tauxy * tauxy) '计算主应力及最大切应力 sigma1 = Cx + r sigma3 = Cx - r If sigma1 < 0 Then sigma2 = sigma1 sigma1 = 0 ElseIf sigma3 > 0 Then sigma2 = sigma3 sigma3 = 0 Else sigma2 = 0 End If tauMax = (sigma1 - sigma3) / 2 '计算主方位角 If sigmax > sigmay Then alpha1 = Math.Atan(
30、2 * tauxy / (sigmax - sigmay) / 2 alpha1 = Math.Round(alpha1 / Math.PI * 180, 2) alpha2 = alpha1 + 90 ElseIf sigmax < sigmay Then alpha2 = Math.Atan(2 * tauxy / (sigmax - sigmay) / 2 alpha2 = Math.Round(alpha2 / Math.PI * 180, 2) alpha1 = alpha2 + 90 Else If tauxy = 0 Then alpha1 = 0.00 alpha2 =
31、90.0 ElseIf tauxy > 0 Then alpha1 = 45.0 alpha2 = 135.0 Else alpha1 = -45.0 alpha2 = 45.0 End If End If '计算截面的正应力及切应力 sigma_alpha = Cx + (sigmax - sigmay) / 2 * Math.Cos(2 * alpha) + tauxy _ * Math.Sin(2 * alpha) tau_alpha = -(sigmax - sigmay) / 2 * Math.Sin(2 * alpha) + tauxy _ * Math.Cos(2
32、* alpha) '输出主应力及最大切应力 lblPlaneSigma1.Text = "= " & CType(sigma1, Single) lblPlaneSigma2.Text = "= " & CType(sigma2, Single) lblPlaneSigma3.Text = "= " & CType(sigma3, Single) lblPlaneTauMax.Text = "= " & CType(tauMax, Single) '输出主方位角 lb
33、lPlaneAlpha1.Text = "= " & alpha1 lblPlaneAlpha2.Text = "= " & alpha2 '输出截面的正应力及切应力 lblPlaneSigmaAlpha.Text = "= " & CType(sigma_alpha, Single) lblPlaneTauAlpha.Text = "= " & CType(tau_alpha, Single) '计算缩放比例 kx = (Math.Abs(Cx) + r) / (p
34、icStressState.Width / 2 - 40) ky = (Math.Abs(Cy) + r) / (picStressState.Height / 2 - 40) k = Math.Max(kx, ky) If k < 0.1 Then k = 0.1 ElseIf k < 1 Then k = Math.Round(k, 1) Else k = Math.Round(k, 0) End If graph.Clear(Color.White) '坐标变换 Form1.CoordinateTransform(graph, picStressState.Width
35、, picStressState.Height, 1) '绘图 graph.DrawEllipse(penFigure, CType(Cx - r) / k, Single), CType(Cy - r) / k, Single), CType(2 * r / k, Single), CType(2 * r / k, Single) graph.DrawLine(penAuxiliary, CType(sigmax / k, Single), CType(-tauxy / k, Single), CType(sigmay / k, Single), CType(tauxy / k, S
36、ingle) '坐标复原 Form1.CoordinateTransform(graph, picStressState.Width, picStressState.Height, -1) '绘制坐标系 Form1.DrawCoordinate(graph, penCoordinate, penNet, picStressState.Width, picStressState.Height, k) End SubPrivate Sub btnPlaneExit_Click(sender As Object, e As EventArgs) _ Handles btnPlaneE
37、xit.Click Close() End SubPrivate Sub btnSpaceCalculate_Click(sender As Object, e As EventArgs) _ Handles btnSpaceCalculate.Click '定义输入参数 Dim sigmaX As Double Dim sigmaY As Double Dim sigmaZ As Double Dim tauXY As Double Dim tauYZ As Double Dim tauZX As Double '定义输出参数 Dim sigma1 As Double Dim
38、 sigma2 As Double Dim sigma3 As Double Dim tauMax As Double '定义中间参数 Dim I1 As Double Dim I2 As Double Dim I3 As Double Dim Equation As CubicEquation '定义应力圆参数 Dim C12x As Double Dim C12y As Double Dim r12 As Double Dim C23x As Double Dim C23y As Double Dim r23 As Double Dim C13x As Double Dim
39、 C13y As Double Dim r13 As Double '定义绘图参数 Dim kx As Single Dim ky As Single Dim k As Single '错误提示 If txtSpaceSigmaX.Text = "" Or txtSpaceSigmaY.Text = "" Or _ txtSpaceSigmaZ.Text = "" Or txtSpaceTauXY.Text = "" Or txtSpaceTauYZ.Text = "" Or t
40、xtSpaceTauZX.Text Then MessageBox.Show("请输入应力状态!", "错误") Exit Sub End If '初始化参数 sigmaX = txtSpaceSigmaX.Text sigmaY = txtSpaceSigmaY.Text sigmaZ = txtSpaceSigmaZ.Text tauXY = txtSpaceTauXY.Text tauYZ = txtSpaceTauYZ.Text tauZX = txtSpaceTauZX.Text I1 = sigmaX + sigmaY + sigma
41、Z I2 = Form1.Det2(sigmaX, tauXY, tauXY, sigmaY) + _ Form1.Det2(sigmaY, tauYZ, tauYZ, sigmaZ) + _ Form1.Det2(sigmaZ, tauZX, tauZX, sigmaX) I3 = sigmaX * Form1.Det2(sigmaY, tauYZ, tauYZ, sigmaZ) - _ tauXY * Form1.Det2(tauXY, tauZX, tauYZ, sigmaZ) + tauZX * _ Form1.Det2(tauXY, tauZX, sigmaY, tauYZ)
42、9;计算主应力及最大切应力 Equation = New CubicEquation(1, -I1, I2, -I3) sigma1 = Equation.X1 sigma2 = Equation.X2 sigma3 = Equation.X3 tauMax = (sigma1 - sigma3) / 2 '输出主应力及最大切应力 lblSpaceSigma1.Text = "= " & CType(sigma1, Single) lblSpaceSigma2.Text = "= " & CType(sigma2, Single)
43、 lblSpaceSigma3.Text = "= " & CType(sigma3, Single) lblSpaceTauMax.Text = "= " & CType(tauMax, Single) '计算应力圆参数 C12x = (sigma1 + sigma2) / 2 C12y = 0 r12 = (sigma1 - sigma2) / 2 C23x = (sigma2 + sigma3) / 2 C23y = 0 r23 = (sigma2 - sigma3) / 2 C13x = (sigma1 + sigma3)
44、 / 2 C13y = 0 r13 = (sigma1 - sigma3) / 2 '计算缩放比例 kx = (Math.Abs(C13x) + r13) / (picStressState.Width / 2 - 40) ky = (Math.Abs(C13y) + r13) / (picStressState.Height / 2 - 40) k = Math.Max(kx, ky) If k < 0.1 Then k = 0.1 ElseIf k < 1 Then k = Math.Round(k, 1) Else k = Math.Round(k, 0) End I
45、f graph.Clear(Color.White) '坐标变换 Form1.CoordinateTransform(graph, picStressState.Width, picStressState.Height, 1) '绘图 graph.FillEllipse(figureColor, CType(C13x - r13) / k, Single), CType(C13y - r13) / k, Single), CType(2 * r13 / k, Single), CType(2 * r13 / k, Single) graph.FillEllipse(Brushe
46、s.White, CType(C12x - r12) / k, Single), CType(C12y - r12) / k, Single), CType(2 * r12 / k, Single), CType(2 * r12 / k, Single) graph.FillEllipse(Brushes.White, CType(C23x - r23) / k, Single), CType(C23y - r23) / k, Single), CType(2 * r23 / k, Single), CType(2 * r23 / k, Single) '坐标复原 Form1.CoordinateTransform(graph, picStressState.Width, picStressState.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学五年级音乐《彼得与狼》聆赏与音色叙事教学设计
- 小学一年级音乐歌唱教学设计:《小雨沙沙》情境律动课教案
- 初中英语七年级上册Unit 1 Trying new things单元同步写作教学设计
- 初中数学八年级下册 勾股定理实际应用教学设计
- 初中八年级地理《世界人口数量与分布》教学设计
- 九年级数学《利用二次函数图象求一元二次方程近似解》教学设计
- 小学六年级信息技术教学设计《有趣的面具》-基于图层蒙版的创意合成与表达
- 文秘岗 2026综合事务岗事业编面试高频题试卷及参考答案
- 计算机岗2026事业单位面试考点训练试卷及解析
- 2026中国二手车交易市场发展瓶颈及转型升级策略研究
- (正式版)DB32∕T 5387-2026 电动车充电基础设施建设技术规程 第1部分:电动自行车
- 2026年美容中医技术基础试题库附参考答案详解【能力提升】
- 2.5+中国现当代音乐(1)课件-高一音乐湘教版(2019)必修1+音乐鉴赏
- 防灾减灾科学与工程 课件 第2章-地震灾害
- 第16课 祖国我为您自豪 课件-2025-2026学年道德与法治二年级上册统编版
- 张仁针刺疗法对病理性近视治疗效果的深度剖析与临床验证
- 托管安全应急救援预案
- DB62-T 5117-2025 盐渍土地区公路设计与施工技术规范
- 煤矿矿灯充电工培训课件
- 汽修门店年终活动方案
- 纹身教学课件
评论
0/150
提交评论