CST - 2008

2026/1/14 19:39:20

' *Construct / Discrete Ports / Compute SelfInductance of Dis.Ports ' !!! Do not change the line above !! '

' fhi: 05-03-2009 added links to Caps for differential/nondifferential Links

' fhi: 10-09-2007 Caps on/off, mesh symmetry-planes considered , mesh-search based on min/max mesh-step

' fhi: 20-08-2007 adapted to DE2008 ' fhi: 11-02-2006 Initial version

' fhi: 03-04-2006 Compute -L for arbitrarily orientated ports and adds them into DesignStudio ' fhi: 05-04-2006 De2006: SP5 corrections: PR Tracker 2593, 2608 - 2610, 2614

' fhi: 07-04-2006 Differential_ports and Blocks implemented, Dialog added, autom. deletion of existing ports/blocks

' fhi: 30-10-2006 Correction of z_lower=Mesh.getzpos(Z_istop) in subroutine \

' fhi: 31-10-2006 Added equivalent capacitance of ports (port-wires rep. by two long cylinders)

Option Explicit

Public ListPortArray() As String Public PortArrayLength As Integer

Public Discrete_Port_List() As String, Total_Nr_of_Discrete_Ports As Integer, N_max_searches As Integer

Sub Main

Dim long_ref_dir As Long, long_ref_index As Long, port_nr As Integer, delta As Double

Dim x As Double, y As Double, z As Double, plength As Double, X_start_index As Long, X_istop As Long

Dim x_upper As Double, x_lower As Double, wire_radius As Double

Dim Y_start_index As Long, Y_istop As Long, y_upper As Double, y_lower As Double, L_i As Double

Dim L_a As Double, glength As Double, iii As Integer, port_name As String, index_p As Long Dim port_index As Long, z_upper As Double, z_lower As Double, output_string As String Dim long_ref_index2 As Long, source_start_point As Double, source_end_point As Double Dim source_length As Double, port_onearmlength As Double, C_port As Double 'DS

Dim mws_block_port_position_x As Long, mws_block_port_position_y As Long

Dim mws_block_center_position_x As Long, mws_block_center_position_y As Long, make_abs As String

Dim x_offset As Integer, y_offset As Integer, size_offset As Integer

Dim blockname_variable As String, rel_x_pos As Double, rel_y_pos As Double, rot_angle As Double

Dim differential_flag As Boolean, orientation As String

1

Begin Dialog UserDialog 360,119,\ CheckBox 30,35,120,14,\ CheckBox 30,50,220,21,\ OKButton 30,98,100,21 CancelButton 140,98,90,21 CheckBox 30,75,140,14,\ CheckBox 30,15,140,14,\ End Dialog

Dim dlg As UserDialog

' set dialog defaults

dlg.Createlinks = 1 : dlg.diff_ports_blocks = 0 : dlg.report = 0 : dlg.add_caps = 1' 0 = no 1 = yes If (Dialog(dlg) = 0) Then Exit All 'do the dialog

If dlg.diff_ports_blocks = 1 Then differential_flag= True Else

differential_flag=False End If

size_offset = 200 'position offset for drawing the elements

Total_Nr_of_Discrete_Ports = 0

' search for all ports in the MWS section port_name = \

get_all_child_names port_name,ListPortArray(),PortArrayLength For index_p = 0 To PortArrayLength-1

port_index = Mid(ListPortArray(index_p),5,Len(ListPortArray(index_p))-4 )' If Port.getType(port_index) = \ 'find all discr. ports ReDim Preserve Discrete_Port_List(Total_Nr_of_Discrete_Ports) Discrete_Port_List(Total_Nr_of_Discrete_Ports) = CStr(port_index) Total_Nr_of_Discrete_Ports=Total_Nr_of_Discrete_Ports+1 Else 'wg port

ReDim Preserve Discrete_Port_List(Total_Nr_of_Discrete_Ports)

Discrete_Port_List(Total_Nr_of_Discrete_Ports) = CStr(-port_index) 'wg-port: indicated as neg number! Total_Nr_of_Discrete_Ports=Total_Nr_of_Discrete_Ports+1 End If Next

'add text to a report-file

output_string = \

2

'Loop over all Ports --------------------------------------------------------------------------

For index_p = 0 To Total_Nr_of_Discrete_Ports-1

If CInt(Discrete_Port_List(index_p)) > 0 Then 'consider only discrete ports for -L computation output_string = output_string+ vbCrLf+ \ output_string = output_string+ \Impedance = \CStr(Port.GetLineImpedance (Discrete_Port_List(index_p),1) )+\ \ plength=DiscretePort.getlength (Discrete_Port_List(index_p)) glength= DiscretePort.getgridlength ( Discrete_Port_List(index_p)) output_string = output_string+ \\glength )+ \ PortLength= \ \\ DiscretePort.GetElementDirIndex (Discrete_Port_List(index_p),long_ref_dir, long_ref_index) x= Mesh.getxpos(long_ref_index) y= Mesh.getypos(long_ref_index) z= Mesh.getzpos(long_ref_index) output_string = output_string+ \ '************ search -density for gridpoints 'delta = plength/100 'search increment to find next mesh index, 100 = 1% of Port-length delta = Mesh.GetMinimumEdgeLength/2 'new method N_max_searches = CInt(2*Mesh.GetMaximumEdgeLength/Mesh.GetMinimumEdgeLength) '************ end of search-density

If long_ref_dir = 2 Then '(orientation in z) search_for_xlower_x_upper (delta, long_ref_index, x_upper, x_lower) search_for_ylower_y_upper (delta, long_ref_index, y_upper, y_lower) output_string = output_string+ \ Orientation = z\ output_string = output_string+ \X: \CStr(x_lower) + \center \CStr(Mesh.getxpos(long_ref_index)) + \ output_string = output_string+ \Y: \ CStr(y_lower) + \center \CStr(Mesh.getypos(long_ref_index)) + \ 'effective radius wire_radius = (Abs(x_upper-x_lower)+ Abs(y_upper-y_lower))/(4*Exp(1)^2) 'mean value radius output_string = output_string+ vbCrLf+\ 'Formel für L of a straight wire: ' inner L

3

L_i = Units.GetGeometryUnitToSI()*plength*4*pi*1e-7/(8*pi) L_a = Units.GetGeometryUnitToSI()*plength*2*1e-7*(Log(2*plength/wire_radius)-1) output_string = output_string+ \ L_i= \(L_i*1e9)+\ L_a = \(L_a*1e9)+ \nH\ '------ capacitance of discrete port z ------ If dlg.add_caps = 1 Then source_start_point= Mesh.getzpos(long_ref_index) DiscretePort.GetElement2ndIndex (Discrete_Port_List(index_p), long_ref_index2 ) source_end_point = Mesh.getzpos(long_ref_index2) source_length = Abs(source_end_point-source_start_point) port_onearmlength = (plength-source_length)/2 C_port = Units.GetGeometryUnitToSI()*(4*pi*8.856e-12*port_onearmlength)/(Log( (4*port_onearmlength^2*(4*source_length/2+port_onearmlength))/ _

((2*wire_radius)^2*(4*source_length/2+3*port_onearmlength)))) output_string = output_string+ \ \ End If '---------- end cap z ----------------------

End If ' orientation z.....

If long_ref_dir = 0 Then '(orientation in x) search_for_zlower_z_upper (delta, long_ref_index, z_upper, z_lower) search_for_ylower_y_upper (delta, long_ref_index, y_upper, y_lower) output_string = output_string+ \ Orientation = x\ output_string = output_string+ \Z: \+ \center \CStr(Mesh.getzpos(long_ref_index)) + \ output_string = output_string+ \Y: \+ \ center \CStr(Mesh.getypos(long_ref_index)) + \ 'effective radius wire_radius = (Abs(z_upper-z_lower)+ Abs(y_upper-y_lower))/(4*Exp(1)^2) 'mean value radius output_string = output_string+ vbCrLf+\ 'Formel für L of a straight wire: ' inner L L_i = Units.GetGeometryUnitToSI()*plength*4*pi*1e-7/(8*pi) L_a = Units.GetGeometryUnitToSI()*plength*2*1e-7*(Log(2*plength/wire_radius)-1) output_string = output_string+ \ L_i= \(L_i*1e9)+\ L_a = \(L_a*1e9)+ \

4


CST - 2008.doc 将本文的Word文档下载到电脑
搜索更多关于: CST - 2008 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219