Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

Placing a finite element model into an electrical circuit in COMSOL 4.1

$
0
0
Hello,

I have recently made the switch from COMSOL 3.5a to COMSOL 4.1, and I am currently unable to do things that I used to be able to do very easily, namely placing my 3-D model (drawn and defined in COMSOL) into an electrical circuit simulation. I easily achieved this in COMSOL 3.5a using the “Conductive Media DC (emdc)” physics module which includes the SPICE Circuit Editor. In the circuit editor, I defined my circuit with the following code:

V1 0 1 9
R1 1 2 1000
C1 2 0 0.00000000003
X1 2 0 resistor
.SUBCKT resistor a b COMSOL: *
.ENDS

This corresponds to a voltage source (9V) across nodes 0 and 1, a 1k resistor between nodes 1 and 2, and the parallel connection of a 30 pF capacitor and my 3-D silicon nanowire model (X1) across nodes 2 and 0. Nodes 2 and 0 correspond with circuit terminals a and b, respectively, which are defined in the Boundary Settings of Conductive Media DC (emdc). This was very easy and convenient to set up.

I have been trying to do this same thing with COMSOL 4.1, trying to learn this from one of the models in the AC/DC Module Model Gallery on the website called “Inductor in an Amplifier Circuit”:
www.comsol.com/showroom/documentation/model/990/

This tutorial could not teach me how to place a 3-D model into the Electric Circuit (cir) module; the explanation in given in the PDF document is quite unclear to me. Their SPICE Netlist appears as follows:

* BJT Amplifier circuit
.OPTIONS TNOM=27
.TEMP 27
Vin 1 0 sin(0 1 10kHz)
Vcc 4 0 15
Rg 1 2 100
Cin 2 3 10u
R1 4 3 47k
R2 3 0 10k
X1 4 5 inductor
RE 7 0 1k
Cout 5 6 10u
Rl 6 0 10k
Q1 5 3 7 BJT
.MODEL BJT NPN(Is=15f Ise=15f Isc=0 Bf=260 Br=6.1
+ Ikf=.3 Xtb=1.5 Ne=1.3 Nc=2 Rc=1 Rb=10 Eg=1.11
+ Cjc=7.5p Mjc=.35 Vjc=.75 Fc=.5 Cje=20p Mje=0.4 Vje=0.75
+ Vaf=75 Xtf=3 Xti=3)
.SUBCKT inductor V_coil I_coil COMSOL: *
.ENDS
.END

First off, I don’t see any way to create/edit the SPICE netlist in this version of COMSOL, the only option is to import and it is asking for a file with a .cir extension. Can I write the SPICE netlist in a .txt document and import that? Or do I make a .txt file and then change file type to .cir and then import that?

Second, why are there two lines “.ENDS” and “.END” here and in version 3.5a I used only one line “.ENDS”? Is this because of the BJT model? If I only have basic parts and one 3-D model (V1, R1, C1, X1) do I use both lines .ENDS and .END? Or just .ENDS?

Third, the line of code which defines X1 as the 3-D model now has variable names "V_coil" and "I_coil" instead of terminal names "a" and "b". The PDF document states:

“The variable V_coil must give the voltage over the device, defined in the global scope. I_coil must be a global variable used in the model as a current through the device.”

However, there are not even any global variables defined in the simulation file provided, there are just global parameters, none of which are V_coil or I_coil. I could not find one instance of the text “V_coil” or “I_coil” anywhere in this simulation file. Also they say V_coil is defined in the global scope. What is the global scope? How can I view the global scope? They don’t mean the Global Definitions tab do they? Because there are no variables defined in this file’s Global Definitions.

Fourth, I cannot tell from the boundary conditions which boundaries are corresponding to the terminals of the device which will be connected to nodes in the circuit. It is not clear which edges/surfaces are corresponding to the two terminals of the device. For example, I have a 3-D rectangular prism and want to make two opposite faces be the two terminals of the resistor. What kind of boundary conditions do I use for these faces with the physics module “Joule heating”? Also, how would I define variable V_wire in the “global scope” and I_wire as a global variable for this simple resistor model?

Fifth, it seems that their 3-D model appears as a component “External I Vs. U1” in the Electrical Circuit (cir) section of the model builder, as its node names are 4 and 5. Is it possible to define a circuit including a 3-D model using just the model builder (i.e. no SPICE netlist) since all components seem to be available in the Electric Circuit (cir) model builder?


I used to implement my 3-D models in the SPICE circuit so easily in COMSOL 3.5a, but to do the same exact thing in COMSOL 4.1 has been extremely difficult for me and I cannot figure it out even after reading the tutorial and looking at the example simulation file. I would very much appreciate some help.

Thank you,
Adam

Viewing all articles
Browse latest Browse all 26527

Trending Articles