基于Python计算气弹簧选型
2018-09-10张立潇
张立潇



摘 要:本文以Python语言为手段,以第三方库为支撑,设计交互式程序窗口图形,采用三角形余弦定理,计算气弹簧选型,计算出了最小支撑力的优化目标,同时给出了气弹簧的安装距、行程以及在门上、门口框上的安装位置,不仅提高了设计人员的工作效率,也体现了设计人员计算过程的智能化。
关键词:Python;余弦定理;气弹簧
中图分类号:TH135 文献标识码:A 文章编号:1003-5168(2018)13-0061-03
Calculation of Gas Spring Based on Python
ZHANG Lixiao
(Henan Xinfei Special Purpose Vehicle Co., Ltd.,Xinxiang Henan 453000)
Abstract: In this paper, by means of the Python language, supported by a third-party library, designed an interactive program window graphics, used triangle cosine theorem, calculated gas spring selection, calculated the minimum support the optimization goal, the installation of the gas spring is given at the same time, travel, and on the door, the door frame on the installation position, not only improved the efficiency of the design personnel, also reflected the intelligent design calculation process.
Keywords: Python;cosine theorem;gas spring
气弹簧在专用汽车中的应用非常广泛。厢式车后部的上翻门、侧面采光窗,以及下部的行李舱都能见到气弹簧的设计应用。气弹簧的安装方式分为挺举式和翻转式两种,一般情况下均采用挺举式安装,即正装[1]。气弹簧的计算选型大都通过“两圆法”试算,得出一种可行解[2]。本文采用“最小举升力法”,通过Python语言程序设计方法,计算出气弹簧的选型,不仅计算出了举升力最小的优化解,而且求解过程由计算机完成,大大提高了设计人员的工作效率。
1 氣弹簧概述
气弹簧可分为自由式、自锁式、阻尼式等多种方式气弹簧,其中以自由式气弹簧应用最为广泛。自由式气弹簧主要起支撑作用,只有最短、最长两个位置,在行程中无法自行停止。为简化计算过程,通常认为气弹簧在行程中的支撑力为定值,即支撑力在行程的各个位置均为固定值。气弹簧最长的位置为安装尺寸。安装尺寸的计算公式为:
l=2×m+100 (1)
式(1)中:m为气弹簧行程。
2 Python简介
Python为开源的程序设计语言,拥有众多的第三方库的支撑。Tkinter为图形界面设计模块,可以设计出交互式的图形界面窗口。……