You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MATLAB拖拽下落物体速度-时间绘图APP Y轴限1问题求助

问题原因与修复方案

核心问题是绘图按钮触发代码中缺失了终端速度的系数计算:

  • 启动函数里,速度公式包含了决定最终速度上限的终端速度系数 coefficeint = -sqrt((2*mass*g)/(density*Area*Cd))
  • 而按钮触发代码直接简化为 velocity = - (1-exponent)./(1+exponent);,这个表达式的取值范围始终在(0,1)之间(时间趋近无穷时结果趋近于1),所以无论输入什么参数,速度都不会超过1

修复后的按钮触发代码

Area = app.AreaEditField.Value;
Cd = app.DragCoefficientEditField.Value;
g = app.gEditField.Value;
density = app.MediumDensitryEditField.Value;
mass = app.MassSlider.Value;

app.MassSlider.Limits = [10^(-7), app.MaxMassEditField.Value];

time = linspace(0, 100, 1000);
exponent = exp(2*sqrt((g*Area*density*Cd)/(2*mass))*time);
% 补上缺失的终端速度系数计算
coefficeint = -sqrt((2*mass*g)/(density*Area*Cd));
velocity = coefficeint * (1-exponent)./(1+exponent);
plot(app.UIAxes, time, velocity);
ylim([0 8]);

补充说明:当前公式的负号设置会让下落速度显示为正值(符合向下为正的物理方向预期),如果需要调整方向可以根据需求修改符号。

内容的提问来源于stack exchange,提问作者Lucky Doug

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 17:37:22