首页/文章/ 详情

Inspire二次开发-执行运动分析并提取部件结果

1年前浏览656





from hwx import inspirefrom hwx.inspire import motionimport tempfile
model = inspire.openTutorialFile("Motion/M01_FourBar.stmod")analysis = motion.MbdAnalysis()analysis.analyze(end=1, dtout=1/5)
# Generate loads for part using the current MbdAnalysis# Loads are all the forces/torques on a specific partpart = model.getChild('Link Single Slot')loads = motion.MbdLoads(part, analysis)
# Filter loads to contain peak force in time steps between 1 and 10 secondspeaks = loads.timeSlice(1, 10).peaks(peaksPerComp=1, components="FM")print("Peak Force FM is at time = {}, at frame = {}".format(   peaks[0].time, peaks[0].frame))for key, vals in peaks[0].loads.items():   print("For '{}' -> Loads are: ".format(key))   print(vals)
# Generate load cases, write to csvprint("There will be generated {} load cases".format(loads.countLoadCases()))
# Create Forces, Torques, Accelerations at each time steploads.createLoadCases()
# write load cases in a csvfile = tempfile.gettempdir()+'/test.csv'loads.writeCsv(file)with open(file,encoding='utf-8') as f:   print(f.read())





Peak Force FM is at time = 1.0, at frame = 5For 'Link Single Slot' -> Loads are: [Load(  linearAcceleration     = -0.2023792226366914, -3.125612978363819e-05, 0.8081528180053795  rotationalVelocity     = 1.8172199015914924e-07, -0.4688311115117176, 1.4027577141087755e-07  rotationalAcceleration = 1.6930120711058507e-06, 16.11891395883833, -1.696288028974822e-07)]For 'Joint 2' -> Loads are: [Load(  location = -0.004944168946335398, 0.007501561277339952, 0.08845150046763726  force    = 3.880355409389196, 2.7114723567614756, 12.42045559659003  torque   = 0.017571009361289296, -5.112315092486105e-09, -0.12092527404230848)]For 'Joint 3' -> Loads are: [Load(  location = -0.0417130069650237, 0.00750155725673342, -0.025776575440115947  force    = -3.8956663106021105, -2.7114747208381194, -11.61739789597324  torque   = 0.29416265669019104, -1.3114914665100877e-09, 0.021266151038939606)]There will be generated 35 load casesTIME,Joint 2 FX,Joint 2 FY,Joint 2 FZ,Joint 2 FM,Joint 2 TX,Joint 2 TY,Joint 2 TZ,Joint 2 TM,Joint 3 FX,Joint 3 FY,Joint 3 FZ,Joint 3 FM,Joint 3 TX,Joint 3 TY,Joint 3 TZ,Joint 3 TM,Gravity X,Gravity Y,Gravity Z,Gravity M,Accel X,Accel Y,Accel Z,Accel M时间 (s),力 (N),力 (N),力 (N),力 (N),扭矩 (N*m),扭矩 (N*m),扭矩 (N*m),扭矩 (N*m),力 (N),力 (N),力 (N),力 (N),扭矩 (N*m),扭矩 (N*m),扭矩 (N*m),扭矩 (N*m),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2),加速度 (m/s2)0.2,-8.354299857388895,-2.3044164443915247,-9.996668037504067,13.230193993604388,-0.008290680666308446,-4.195569473341715e-09,0.13087719751179525,0.13113952956470518,8.318108285255136,2.3044170900605283,10.748901922239645,13.785505290127029,-0.2052759344556021,-8.995542556563919e-10,0.042566437273702344,0.20964281730790751,0.0,0.0,-9.80665,9.80665,-0.47837957610138737,8.530306339671625e-06,0.13636458361224374,0.497435743154278960.4,-4.320037910031098,-0.9346920838256246,-3.066424858143313,5.3795295562262115,-0.005512492519845915,-1.0074777151539929e-09,0.049609627583864516,0.04991495490122263,4.289318538960174,0.9346958388345257,3.714225284777943,5.750424271815586,-0.06236432559300596,-5.209075415276474e-10,0.038506116408915186,0.07329413419617825,0.0,0.0,-9.80665,9.80665,-0.4060481685164422,4.9627313861111144e-05,-1.2440350860031877,1.30862462640185170.6000000000000001,17.300534613142965,4.296856044119177,12.496973839547323,21.770296849394853,0.050281323059337135,-7.366744044235199e-09,-0.2508523433369497,0.255841962168516,-17.21462861580065,-4.296856911136387,-11.732932453075247,21.2712980714189,0.24762815788623366,-5.697717562810564e-09,-0.17155955995542163,0.3012513687773508,0.0,0.0,-9.80665,9.80665,1.1355040004719335,-1.1475138110716583e-05,0.29243592117491524,1.1725562260347540.8,15.98850058997506,6.418230278731058,22.418779539266907,28.2741490951842,0.08394151046435226,-2.0377037936396468e-08,-0.34523812799276415,0.3552964145597104,-15.94588570817738,-6.418235193368506,-21.58771607754515,27.59518978844594,0.5414907706610997,-1.5366165747805956e-08,-0.10721562047701515,0.552003119543199,0.0,0.0,-9.80665,9.80665,0.5632828134878344,-6.497371023610283e-05,1.1783326260646378,1.30604567678191821.0,3.880355409389196,2.7114723567614756,12.42045559659003,13.291988476955666,0.017571009361289296,-5.112315092486105e-09,-0.12092527404230848,0.12219518105138986,-3.8956663106021105,-2.7114747208381194,-11.61739789597324,12.549591429152898,0.29416265669019104,-1.3114914665100877e-09,0.021266151038939606,0.29493036088378927,0.0,0.0,-9.80665,9.80665,-0.2023792226366914,-3.125612978363819e-05,0.8081528180053795,0.833107632891461
来源:TodayCAEer
InspireSTEPS二次开发ADS
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2025-05-29
最近编辑:1年前
TodayCAEer
本科 签名征集中
获赞 87粉丝 197文章 781课程 2
点赞
收藏
作者推荐
未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习计划 福利任务
下载APP
联系我们
帮助与反馈