python代码 阻力系数计算

本文介绍了如何根据飞行速度(马赫数)计算飞机在不同速度范围(亚音速、跨音速和超音速)下的阻力系数,强调了高速情况下阻力系数对设计的重要性。
摘要由CSDN通过智能技术生成
# calculation for drag coefficient
v = 600
c = 343  # Standard atmospheric pressure
Mach = v / c
print(Mach)

if Mach < 0.5:
    print("Cd = 0.384")  # subsonic
elif Mach < 1.4:
    Cd = 0.6396 + 0.5974 * (Mach - 1) - 0.1618 * (Mach - 1) ** 2 - 0.7212 * (Mach - 1) ** 3  # transonic
    print("Cd =", Cd)
else:
    Cd = 0.7624 + 0.2398 * ((Mach ** -1) - 1 / 2.75) - 0.475 * ((Mach ** -1) - 1 / 2.75) ** 2  # supersonic
    print("Cd =", Cd)

低速冲击研究通常使用恒定的阻力系数。但在较高速度下,阻力系数高度依赖于马赫数,尤其是在跨音速区域。

要实现Python中小球的阻力落体运动,可以使用以下代码进行模拟: ```python import pgzrun y = 100 t = 3 g = 0.1 # 重力加速度 f = 0.01 # 阻力系数 def draw(): screen.fill('black') screen.draw.filled_circle((400, y), 30, 'red') def update(): global y, t t += g - f * t # 增加重力并减少阻力 y += t if y >= 570: t = -t # 反弹 if y <= 30: t = -t # 反弹 pgzrun.go() ``` 这段代码使用了Pygame Zero库来绘制和更新画面。在每次更新时,小球的位置y会根据重力加速度g和阻力系数f进行计算。小球在下落时速度会逐渐增加,而在反弹时速度会减小。当小球触底或触顶时,速度会反向。通过不断更新小球的位置和速度,就可以实现小球的阻力落体运动效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [python实现自由落体功能效果实现](https://download.csdn.net/download/weixin_40876684/87341328)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [【pygame】之小球基础](https://blog.csdn.net/m0_67388084/article/details/127325998)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值