基于Matlab绘制剪切力和弯曲矩图

该文介绍了Matlab在结构力学中用于计算剪切力和弯曲矩的程序,提供了创建和使用SFBMProb对象的详细步骤,包括如何添加各种类型的载荷(点载荷、分布载荷、扭矩)以及如何解决和绘制分析图。此外,还展示了多个示例问题的解决过程。
摘要由CSDN通过智能技术生成

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

剪切力(Shear Force)和弯曲矩(Bending Moment)是结构力学中的两个重要概念。

剪切力是作用在结构横截面上的垂直于截面平面的力,它可以导致结构的横截面产生剪切变形。剪切力的方向沿结构轴线可以是正或负,取决于受力情况。

弯曲矩是作用在结构横截面上的力对结构轴线形成的弯曲力矩,它可以导致结构发生弯曲变形。弯曲矩的方向也可以是正或负,取决于受力情况。

剪切力和弯曲矩经常一起考虑,因为它们相互关联,共同影响结构的强度和稳定性。

在结构分析中,剪切力和弯曲表形式呈现,其坐标轴表示结构的位置,而纵轴则表示对应的剪切力和弯曲矩值。这样的图表可用来显示结构不同位置的受力情况,并帮助工程师评估结构的性能和设计合适的结构材料和尺寸。

⛄ 部分代码

%% Shear Force & Bending Moment Examples%     This program calculates the shear force and bending moment profiles, %     draws the free body, shear force and bending moment diagrams of the %     problem.% %     Under the free body diagram, the equations of each section is clearly %     written with Latex% %% How to call the function%     To use this program, you need to call the solve function on the instance %     of the SFBMProb object that has the complete problem description.%     You first create the SFBMProb Object and then add the loads in no%     partcular order. % %% How to create the SFBMProb object%     create an instance of SFBMProb by calling "SFBMProb" with three%     arguments. The first is the name of the problem. For instance, %     "Example 1", the second argument is Length of the beam, and the third%     is locations of the supports. %%     prob = SFBMProb(name, length, supports)%%-   Cantilever%       If the problem is a cantilever problem, then you have only one clamped %       support, at the beginning or end of the beam. In such a case, the number is%       second argument contains 2 elements instead of three. %%       For instance, for a cantilever of length 20m, supported at the beginning, %       prob = SFBMProb("Cantilever", 20, 0)%       and if supported at the end, %       prob = SFBMProb("Cantilever", 20, 20)%%-   Beam on the floor%       Its possible to have a problem in which the body is lying on the floor %       without any point support. In such scenario, %       prob = SFBMProb("BeamOnFloor", 20, [])%%% Set Units%     We have just two primary physical quantities here: Force and Legnth.%     ForceUnit default is KN%     LengthUnit default is m%     but to set a preferred unit, use%%     prob.ForceUnit = "lb";%     prob.LengthUnit = "inch";%% Load Description%     Loads can be Force: such point or distributed load, or Torque the we%     call Moment here. In general Load would have value and location.%     The sign of the value can indicate whether it is pointing upwards, or%     downwards in the case of force, or clockwise/anticlockwise in case of%     moment. While moment and point load have scalars for value and%     location, distributed load have vector of value and location. %% How to add loads to the object.%%%-   Moment(Torque)%         To add a clockwise moment of magnitude 3KN-m applied at point 5m%         prob.AddMomentLoad(-3, 5);%         For an anticlockwise moment of magnitude 7KN-m applied at point 8m%         prob.AddMomentLoad(7, 8);%%%-   Concentrated Load(Force)%         To add a downward point load of magnitude 0.8KN applied at point 3m%         prob.AddPointLoad(-0.8, 3);%         For an upward point load of magnitude 5KN-m applied at point 7m%         prob.AddMomentLoad(5, 7);%%%-   Distributed Force%         To add uniform upward distributed load of magnitude 2KN/m applied from point 3 to 5m %         prob.AddDistLoad([2, 2], [3, 5]);%         For linearly increasing distributed load 2KN/m  to 5KN/m applied from point 3 to 5m %         prob.AddDistLoad([2, 5], [3, 5]);%%     Example(1)%Problem NameName = 'Example 1';%Length and SupportsLength = 10; Supports = [2, 10]; % length  = 10, supports at 2 and 10;prob = SFBMProb(Name, Length, Supports);%Set Unitprob.ForceUnit = 'lb';prob.LengthUnit = 'inch';%Concetrated Loadsprob.AddPointLoad(-5, 0); % 5N downward at point 0prob.AddPointLoad(-10, 8); % 10N downward at point 8%Torquesprob.AddMoment(10, 3);  % ACW 10Nm at point 3prob.AddMoment(-10, 7); % CW 10Nm at point 7%Solve the problemprob.Solve()%%     Example(2)%Problem NameName = 'Example 2';%Length and SupportsLength = 20; Supports = 0; % length  = 20m, Cantilever supported at 0 m;prob = SFBMProb(Name, Length, Supports);%Concentrated Loadsprob.AddPointLoad(-5, 6);   % 5N downward at point 6prob.AddPointLoad(-10, 13); % 10N downward at point 13%Distributed Loadsprob.AddDistLoad([5,5],[1,3]);    % Constant 5N/m upwards from 1m to 3 m prob.AddDistLoad([-4,-4],[14,17]); % Constant 4N/m downwards from 14m to 17 m%Solve the problemprob.Solve()%%     Example(3)%Problem NameName = 'Example 3';% Length and SupportsLength = 30; Supports = [0,20]; % length  = 30m, supports at 0m and 20m;prob = SFBMProb(Name, Length, Supports);% Concentrated Loadsprob.AddPointLoad(-20, 6);   % 20N downward at point 6prob.AddPointLoad(-10, 13);  % 10N downward at point 13prob.AddPointLoad(5, 27);    % 5N upward at point 27% Torquesprob.AddMoment(50, 8);  % ACW 50Nm at point 8prob.AddMoment(-45, 25); % CW 45Nm at point 25% Distributed Loadsprob.AddDistLoad([7, 7], [1,3]);    % Constant 7N/m upwards from 1m to 3m prob.AddDistLoad([-5,-5], [12,18]); % Constant 5N/m downwards from 12m to 18m% Solve the problemprob.Solve()%%     Example(4)%Problem NameName = 'Example 4';% Length and SupportsLength = 20; Supports = [5,20]; % length  = 20m, supports at 5m and 20m;prob = SFBMProb(Name, Length, Supports);% Concentrated Loadsprob.AddPointLoad(-2, 0);   % 2N downward at point 0% Torquesprob.AddMoment(50, 8);  % ACW 50Nm at point 8prob.AddMoment(-45, 15); % CW 45Nm at point 15% Distributed Loadsprob.AddDistLoad([5, 5], [1,3]);    % Constant 7N/m upwards from 1m to 3m prob.AddDistLoad([-4, -4], [14, 17]); % Constant 5N/m downwards from 12m to 18m% Solve the problemprob.Solve()%%     Example(4)%Problem NameName = 'Example 4';% Length and SupportsLength = 20; Supports = [6,20]; % length  = 20m, supports at 5m and 20m;prob = SFBMProb(Name, Length, Supports);% Concetrated Loadsprob.AddPointLoad(-2,0);  % 2N downward at point 0% Torquesprob.AddMoment(10,8);   % ACW 10Nm at point 8prob.AddMoment(-15,12); % CW 10Nm at point 12% Distributed Loadsprob.AddDistLoad([5, 2, 5], [1, 3, 5]);    % Quadratic profile distributed upwards force from 1m to 5m and prob.AddDistLoad([-4, -2, -4],[14, 16, 18]); % Quadratic profile distributed downwards force from 14m to 18m% Solve the problemprob.Solve()%%     Example(5)%Problem NameName = 'Example 5';% Length and SupportsLength = 20; Supports = [6,20]; % length  = 20m, supports at 5m and 20m;prob = SFBMProb(Name, Length, Supports);% Concetrated Loadsprob.AddPointLoad(-2,0);  % 2N downward at point 0% Torquesprob.AddMoment(10,8);   % ACW 10Nm at point 8prob.AddMoment(-15,12); % CW 10Nm at point 12% Distributed Loadsprob.AddDistLoad([5, 2], [1, 3]);    % Linear profile upwards from 1m to 3m and prob.AddDistLoad([2, 5], [3, 5]);    % Linear profile upwards from 3m to 5m and prob.AddDistLoad([-4, -2],[14, 16]); % Linear profile downwards from 14m to 16mprob.AddDistLoad([-2, -4],[16, 18]); % Linear profile downwards from 16m to 18m% Solve the problemprob.Solve()%%     Example(6)%Problem NameName = 'Wikipedia';Length = 50; Supports = 50;prob = SFBMProb(Name, Length, Supports);prob.Source = "https://en.wikipedia.org/wiki/Shear_and_moment_diagram#Calculating_shear_force_and_bending_moment";%Set Unitsprob.ForceUnit = 'k';prob.LengthUnit = 'ft';% Concetrated Loadsprob.AddPointLoad(-10,0); prob.AddPointLoad(25.3,10); prob.AddPointLoad(-3.5,25); % Torquesprob.AddMoment(-50,37.5); % Distributed Loadsprob.AddDistLoad([-1,-1], [10,25]);  % Solve the problemprob.Solve()

⛄ 运行结果

⛄ 参考文献

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料

🍅 仿真咨询

1.卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断
2.图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知
3.旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划
4.无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配
5.传感器部署优化、通信协议优化、路由优化、目标定位
6.信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号
7.生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化
8.微电网优化、无功优化、配电网重构、储能配置
9.元胞自动机交通流 人群疏散 病毒扩散 晶体生长

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
材料力学剪力弯矩绘制程序-untitled.fig 说明: 输入变量 分段数组x 分段点一般在集中力,集中力偶作用出和分布载荷的起末端。 载荷数组MPQ 若梁上的外载荷总数为PN,则用PN行四列的数组MPQ储存载荷,数组MPQ第一列代表载荷的类型:1为集中力偶,2为集中力,3为分布载荷,第二列代表载荷的大小,第三列代表集中力,集中力偶或者分布载荷左端与简支梁左端的距离,第四列代表均匀载荷右端与简支梁左端的距离,当载荷为集中力或者集中力偶时,第四列为0. 符号规定 集中力和均匀载荷向下为正,向上为负,集中力偶顺时针为正,逆时针为负。 输出变量 内力数组XQM 如果梁被分为NN-1段,则内力数组XQM为NN行,三列的数组,第一列代表梁的横截面的位置,第二列代表剪力,第三列代表弯矩。 剪力极值及位置QDX QDX是一个二行二列的数组,第一列代表极值所在的位置,第二列代表极值 弯矩极值及位置MDX MDX是一个二行二列的数组,第一列代表极值所在的位置,第二列代表极值 子程序 集中力偶对弯矩贡献的子函数QMM 集中力对剪力和弯矩贡献的子函数QMP 分布载荷对剪力和弯矩贡献的子函数QMQ 求剪力和弯矩极值的子函数MAX_MIN 绘制剪力弯矩的子函数TU_QM 计算分析程序 简支梁QMDJ 左端固定悬臂梁QMDXZ 右端固定悬臂梁QMDXY 左端外伸梁QMDWZ 右端外伸梁QMDWY 两端外伸梁QMDWL 所含文件: Figure82.jpg 材料力学剪力弯矩绘制程序 运行结果: Figure83.jpg 材料力学剪力弯矩绘制程序
MATLAB中,可以使用GUI工具箱来绘制。下面是一个基于MATLAB GUI绘制的简单示例: 1. 创建一个新的MATLAB GUI应用程序或打开一个现有的应用程序。 2. 在GUI窗口上添加一个Axes(坐标轴)组件,用于显示地。 3. 在GUI设计界面上添加一个按钮或菜单项,用于触发绘制的操作。 4. 在按钮或菜单项的回调函数中编写代码来加载地数据,并在Axes组件上绘制。 下面是一个示例代码,用于在MATLAB GUI上绘制: ```matlab function mapGUI % 创建GUI窗口 fig = uifigure('Name', 'Map GUI', 'Position', [100 100 600 400]); % 添加Axes组件 ax = uiaxes(fig, 'Position', [0.1 0.2 0.8 0.7]); % 添加按钮 btn = uibutton(fig, 'Position', [270 50 100 30], 'Text', '绘制', 'ButtonPushedFcn', @(btn,event) drawMap(ax)); end function drawMap(ax) % 加载地数据(例如,经纬度数据) % 这里使用示例数据,你需要根据实际情况替换为你的地数据 lat = [39.9 39.9 40.2 40.2]; lon = [116.3 116.6 116.6 116.3]; % 在Axes组件上绘制 geoplot(ax, lat, lon, 'b-'); geolimits(ax, [39.8 40.3], [116.2 116.7]); end ``` 在这个示例中,我们创建了一个简单的GUI窗口,在窗口中添加了一个Axes组件和一个按钮。当点击按钮时,回调函数`drawMap`将被触发,加载地数据并在Axes组件上绘制。注意,在实际应用中,你需要替换示例中的地数据为你自己的数据。 希望这个示例能帮助到你!如果你有任何其他问题,请随时提问。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值