本文整理汇总了Python中Solver.solve_mesh_circuit方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.solve_mesh_circuit方法的具体用法?Python Solver.solve_mesh_circuit怎么用?Python Solver.solve_mesh_circuit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver
的用法示例。
在下文中一共展示了Solver.solve_mesh_circuit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enumerate
# 需要导入模块: import Solver [as 别名]
# 或者: from Solver import solve_mesh_circuit [as 别名]
#A=np.delete(A, (0), axis=0) #Bus incidence matrix
Bl,tree,co_tree=welsch(A)
branches=list()
branches.extend(tree)
branches.extend(co_tree)
new_Zb=np.zeros((17,17))
new_F=np.zeros((17,1))
for counter,each_branche in enumerate(branches):
new_Zb[counter,counter]=Zb[each_branche,each_branche]
new_F[counter]=F[each_branche]
flux_B=Solver.solve_mesh_circuit(B,Zb,F)
flux_B_2=Solver.solve_mesh_circuit(Bl.T,new_Zb,new_F)
new_Flux=np.zeros((17,1))
for counter,each_branche in enumerate(branches):
new_Flux[each_branche]=flux_B_2[counter]
counter=0
for each in flux_B:
print(str(new_Flux[counter])+" \t- " + str(each) +" \t- "+ str(flux_nodal[counter]))
counter+=1
#