哈巴焊是什么,工作原理又是什么?

哈巴焊又叫脉冲热压焊接,行业内也叫哈巴机(HotBar焊),但业界大部分人则直译叫它为:哈巴(HotBar),HotBar的原理是先把锡膏印刷于电路板(PCB)的焊垫上,经回流焊炉后将锡膏融化并预先焊于电路板上,随后将待焊物(一般为FPC)放置于已经印有锡膏的电路板上,然后再利用热压头的热将焊锡融化并连接导通两个需要连接的电子零组件。因为使用长条形的热压头将扁平的待焊物(一般为FPC)焊接于电路板上,因此称之为HotBar。  

       HotBar通常是将软板(FPC)焊接于PCB上,如此可以达到轻、薄、短、小目的。另外还可以有效的降低成本,因为可以少用1~2个软板连接器。一般的HotBar热压机,哈巴机原理都是利用脉冲电流(pulse)流过钼、钛等具有高电阻特性材料时所产生的巨大焦耳热来加热热压头(thermodes/heater tip),再藉由热压头加热熔化PCB上已经有的锡膏以达到互相焊接的目的。既然是用pulse加热,pulse的能量及时间控制就相当重要,其控制方法是利用热压头前端的电热偶(thermocouple)线路,即时反馈热压头的温度回电源控制中心,藉以控制pulse的讯号来保证热压头上温度的正确性。

一、最少花费路线问题 为了解决这个问题,我们可以使用贪心算法,每次选择距离当前位置最近的未被访问过的景点,直到所有景点都被访问过。 首先,我们需要将所有景点的经纬度坐标存储在一个字典中,然后计算出每两个景点之间的距离。这可以使用经纬度计算公式(如haversine公式)来实现。 接着,我们可以使用一个列表来记录已经访问过的景点,以及一个字典来记录每个景点的费用。然后从起点开始,每次找到距离当前位置最近的未被访问过的景点,并将其加入到已访问列表中,并累加所需的费用。 最后,输出旅游路线和总费用即可。 代码示例: ```python import math # 景点经纬度坐标 locations = { '沙湖': (38.487099, 106.155481), '西夏王陵': (38.466320, 106.130647), '贺兰山岩画': (38.496648, 106.297815), '黄沙古渡旅游区': (38.222789, 105.928023), '北武当生态旅游区': (38.973315, 106.316145), '沙坡头': (37.508221, 105.181056), '寺口子': (37.492356, 105.155761), '青铜峡黄河大峡谷': (37.763865, 105.981294), '哈巴胡生态旅游区': (37.686578, 106.251312), '须弥山石窟': (36.031307, 106.201014), '六盘山': (35.550419, 105.694435), '老龙潭': (36.019286, 106.198785), '火石寨': (36.033351, 106.220259) } # 景点之间的距离 distances = {} for source, source_loc in locations.items(): for target, target_loc in locations.items(): if source != target and (target, source) not in distances: lat1, lon1 = source_loc lat2, lon2 = target_loc radius = 6371 # 地球半径,单位为公里 dlat = math.radians(lat2 - lat1) dlon = math.radians(lon2 - lon1) a = math.sin(dlat / 2) * math.sin(dlat / 2) + math.cos(math.radians(lat1)) \ * math.cos(math.radians(lat2)) * math.sin(dlon / 2) * math.sin(dlon / 2) c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a)) distance = radius * c distances[(source, target)] = distance distances[(target, source)] = distance # 景点费用 costs = { '沙湖': 100, '西夏王陵': 50, '贺兰山岩画': 80, '黄沙古渡旅游区': 60, '北武当生态旅游区': 120, '沙坡头': 40, '寺口子': 50, '青铜峡黄河大峡谷': 100, '哈巴胡生态旅游区': 80, '须弥山石窟': 30, '六盘山': 40, '老龙潭': 50, '火石寨': 30 } # 贪心算法求解 visited = ['银川'] total_cost = 0 while len(visited) < len(locations): best_dist = float('inf') best_place = None for place in locations: if place not in visited: dist = distances[(visited[-1], place)] if dist < best_dist: best_dist = dist best_place = place visited.append(best_place) total_cost += costs[best_place] # 输出结果 print('旅游路线:', ' -> '.join(visited)) print('总费用:', total_cost) ``` 二、最少时间路线问题 为了解决这个问题,我们可以使用动态规划算法。首先,我们需要将所有景点的经纬度坐标存储在一个字典中,然后计算出每两个景点之间的距离。 接着,我们可以使用一个二维的动态规划数组dp[i][j],其中i表示当前访问的景点数量(初始为1),j表示当前在哪个景点(初始为起点)。 动态规划的状态转移方程为:dp[i][j] = min(dp[i-1][k] + distances[(k, j)]),其中k表示上一个访问的景点,distances[(k, j)]表示从k到j的距离。 最终,我们只需要找到dp[10][j]中最小的值,即为最少时间路线所对应的起点。然后从该起点开始,依次按照dp[i][j]的值进行访问即可。 代码示例: ```python # 景点经纬度坐标 locations = { '沙湖': (38.487099, 106.155481), '西夏王陵': (38.466320, 106.130647), '贺兰山岩画': (38.496648, 106.297815), '黄沙古渡旅游区': (38.222789, 105.928023), '北武当生态旅游区': (38.973315, 106.316145), '沙坡头': (37.508221, 105.181056), '寺口子': (37.492356, 105.155761), '青铜峡黄河大峡谷': (37.763865, 105.981294), '哈巴胡生态旅游区': (37.686578, 106.251312), '须弥山石窟': (36.031307, 106.201014), '六盘山': (35.550419, 105.694435), '老龙潭': (36.019286, 106.198785), '火石寨': (36.033351, 106.220259) } # 景点之间的距离 distances = {} for source, source_loc in locations.items(): for target, target_loc in locations.items(): if source != target and (target, source) not in distances: lat1, lon1 = source_loc lat2, lon2 = target_loc radius = 6371 # 地球半径,单位为公里 dlat = math.radians(lat2 - lat1) dlon = math.radians(lon2 - lon1) a = math.sin(dlat / 2) * math.sin(dlat / 2) + math.cos(math.radians(lat1)) \ * math.cos(math.radians(lat2)) * math.sin(dlon / 2) * math.sin(dlon / 2) c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a)) distance = radius * c distances[(source, target)] = distance # 动态规划求解 dp = [[float('inf')] * len(locations) for _ in range(11)] for j in range(len(locations)): dp[1][j] = 0 for i in range(2, 11): for j in range(len(locations)): for k in range(len(locations)): if k != j: dp[i][j] = min(dp[i][j], dp[i-1][k] + distances[(k, j)]) # 找到最少时间路线的起点 best_start = None best_time = float('inf') for j in range(len(locations)): if dp[10][j] < best_time: best_time = dp[10][j] best_start = j # 输出结果 visited = [] cur_place = best_start for i in range(10, 0, -1): visited.append(cur_place) for j in range(len(locations)): if j != cur_place and dp[i-1][j] + distances[(j, cur_place)] == dp[i][cur_place]: cur_place = j break visited.append(cur_place) visited.reverse() print('旅游路线:', ' -> '.join([list(locations.keys())[i] for i in visited])) print('总时间:', best_time / 60, '小时') ``` 三、最少费用路线问题 为了解决这个问题,我们可以使用深度优先搜索算法。首先,我们需要将所有景点的经纬度坐标存储在一个字典中,然后计算出每两个景点之间的距离。 接着,我们可以使用一个列表来记录已经访问过的景点,以及一个字典来记录每个景点的费用。然后从起点开始,进行深度优先搜索,每次选择距离当前位置最近的未被访问过的景点,并将其加入到已访问列表中,并累加所需的费用。 每次搜索时,我们需要判断当前的费用是否已经超过了限制,如果超过了则回溯。如果所有的景点都被访问过,则更新最优路线和最小费用。 最后,输出最优路线和最小费用即可。 代码示例: ```python # 景点经纬度坐标 locations = { '沙湖': (38.487099, 106.155481), '西夏王陵': (38.466320, 106.130647), '贺兰山岩画': (38.496648, 106.297815), '黄沙古渡旅游区': (38.222789, 105.928023), '北武当生态旅游区': (38.973315, 106.316145), '沙坡头': (37.508221, 105.181056), '寺口子': (37.492356, 105.155761), '青铜峡黄河大峡谷': (37.763865, 105.981294), '哈巴胡生态旅游区': (37.686578, 106.251312), '须弥山石窟': (36.031307, 106.201014), '六盘山': (35.550419, 105.694435), '老龙潭': (36.019286, 106.198785), '火石寨': (36.033351, 106.220259) } # 景点之间的距离 distances = {} for source, source_loc in locations.items(): for target, target_loc in locations.items(): if source != target and (target, source) not in distances: lat1, lon1 = source_loc lat2, lon2 = target_loc radius = 6371 # 地球半径,单位为公里 dlat = math.radians(lat2 - lat1) dlon = math.radians(lon2 - lon1) a = math.sin(dlat / 2) * math.sin(dlat / 2) + math.cos(math.radians(lat1)) \ * math.cos(math.radians(lat2)) * math.sin(dlon / 2) * math.sin(dlon / 2) c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a)) distance = radius * c distances[(source, target)] = distance # 景点费用 costs = { '沙湖': 100, '西夏王陵': 50, '贺兰山岩画': 80, '黄沙古渡旅游区': 60, '北武当生态旅游区': 120, '沙坡头': 40, '寺口子': 50, '青铜峡黄河大峡谷': 100, '哈巴胡生态旅游区': 80, '须弥山石窟': 30, '六盘山': 40, '老龙潭': 50, '火石寨': 30 } # 深度优先搜索求解 best_route = None min_cost = float('inf') def dfs(cur_place, visited, cur_cost): global best_route, min_cost if len(visited) == len(locations): if cur_cost < min_cost: best_route = visited[:] min_cost = cur_cost return for place in locations: if place not in visited: dist = distances[(cur_place, place)] cost = costs[place] if cur_cost + cost > 2500: continue visited.append(place) dfs(place, visited, cur_cost + cost) visited.pop() dfs('银川', ['银川'], 0) # 输出结果 print('旅游路线:', ' -> '.join(best_route)) print('总费用:', min_cost) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值