|
2 | 2 | #
|
3 | 3 | # Description: build the equivalent circuit of a DPT
|
4 | 4 | #
|
5 |
| -# Most examples can be described as a series of steps that comprise a workflow. |
6 |
| -# 1. Import packages and instantiate the application. |
7 |
| -# 2. Insert Circuit Components |
| 5 | +# In this example the steps to build up the circuit schematic are shown. |
| 6 | +# 1. Insert Circuit Components |
8 | 7 | # 3. Create the Wiring
|
9 | 8 | # 4. Insert simulation set up
|
10 | 9 | # 3. View the results.
|
|
37 | 36 | temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
|
38 | 37 |
|
39 | 38 | # ## Launch AEDT and Circuit
|
40 |
| -# |
41 | 39 |
|
42 | 40 | project_name = os.path.join(temp_folder.name, "my_project.aedt")
|
43 |
| - |
44 | 41 | circuit = ansys.aedt.core.Circuit(
|
45 | 42 | project=project_name,
|
46 | 43 | version=AEDT_VERSION,
|
|
49 | 46 | )
|
50 | 47 | circuit.modeler.schematic.schematic_units = "mil"
|
51 | 48 |
|
52 |
| -# ## Preprocess |
| 49 | +# ## Variable initialization to create a parametric design |
53 | 50 | #
|
54 |
| -# Initialize dictionaries that contain all the definitions for the design variables. |
| 51 | +# Initialize dictionary that contain all the definitions for the design variables. |
55 | 52 |
|
56 |
| -des_properties = { |
| 53 | +design_properties = { |
57 | 54 | "VoltageDCbus": "400V",
|
58 | 55 | "r_g1": "2.2",
|
59 | 56 | "r_g2": "2.2",
|
|
67 | 64 | }
|
68 | 65 |
|
69 | 66 | # Define design variables from the created dictionaries.
|
70 |
| -for k, v in des_properties.items(): |
| 67 | + |
| 68 | +for k, v in design_properties.items(): |
71 | 69 | circuit[k] = v
|
72 | 70 |
|
73 | 71 | # ## Insert Circuit Elements into the Schematic
|
74 | 72 | #
|
| 73 | +# Define starting position for component placement. |
| 74 | + |
75 | 75 | y_upper_pin = 5200
|
76 | 76 | y_lower_pin = 2000
|
| 77 | + |
| 78 | +# Define parametrically high and low voltage level for pwl voltage source. |
| 79 | + |
77 | 80 | time_list_pwl = [
|
78 | 81 | 0.0,
|
79 | 82 | 5.0e-6,
|
|
98 | 101 | ]
|
99 | 102 |
|
100 | 103 | # Add circuit components to the schematic.
|
| 104 | + |
101 | 105 | v_pwl = circuit.modeler.components.create_voltage_pwl(
|
102 | 106 | name="v_pwl",
|
103 | 107 | time_list=time_list_pwl,
|
|
150 | 154 | amm_bot.parameters["Name"] = "Ibottom"
|
151 | 155 |
|
152 | 156 |
|
153 |
| -# ## Add nmos components from Component Library. |
| 157 | +# ## Add nMOS components from Component Library. |
154 | 158 | #
|
155 |
| -# Please check that chosen component has the attribute .place |
| 159 | +# Please check that chosen component can access the method place() |
156 | 160 | # If you need to insert a component from a spice model, please use the method: circuit.modeler.components.create_component_from_spicemodel
|
157 | 161 |
|
158 | 162 | nmos_h = circuit.modeler.components.components_catalog[
|
159 | 163 | "Power Electronics Tools\\Power Semiconductors\\MOSFET\\STMicroelectronics:SCT040H65G3AG_V2"
|
160 | 164 | ].place(assignment="NMOS_HS", location=[1500, 4700], angle=0)
|
161 |
| - |
162 | 165 | nmos_l = circuit.modeler.components.components_catalog[
|
163 | 166 | "Power Electronics Tools\\Power Semiconductors\\MOSFET\\STMicroelectronics:SCT040H65G3AG_V2"
|
164 | 167 | ].place("NMOS_LS", location=[1500, 3100], angle=0)
|
165 | 168 |
|
166 | 169 | # ## Create wiring to complete the schematic.
|
167 |
| -# |
168 | 170 |
|
169 | 171 | circuit.modeler.schematic.connect_components_in_series(
|
170 | 172 | assignment=[l_load, r_load], use_wire=True
|
|
336 | 338 | r_g2.pins[1].connect_to_component(assignment=nmos_l.pins[1], use_wire=True)
|
337 | 339 |
|
338 | 340 | # ## Create a transient setup
|
339 |
| -# |
340 | 341 |
|
341 | 342 | setup_name = "MyTransient"
|
342 | 343 | setup1 = circuit.create_setup(
|
|
347 | 348 |
|
348 | 349 | # Solve transient setup
|
349 | 350 |
|
350 |
| -circuit.analyze_setup(setup_name) |
| 351 | +circuit.analyze(setup_name, cores=NUM_CORES) |
351 | 352 |
|
352 |
| -# ## Postprocess |
| 353 | +# ## Plot Double Pulse Test results |
353 | 354 | #
|
354 | 355 | # Create a report
|
355 | 356 |
|
|
364 | 365 | plot_name="Plot V,I",
|
365 | 366 | )
|
366 | 367 |
|
367 |
| - |
368 | 368 | # ## Release AEDT
|
369 | 369 |
|
370 | 370 | circuit.save_project()
|
|
0 commit comments