# Discussion Forum

Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

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

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,

48 Replies Last Post May 23, 2015, 8:50 AM EDT
Posted: 7 years ago
Hi

Sorry I cant help much, I havent really used the Spice interface so far, but there are probably others out here that can help ;)

On the other side, you know you can upload and download examples also in the Model Exchange (= the "users" Model Library), It's not that much used unfortunately, but I have notice a recent Spice example there too, have a look

--
Good luck
Ivar

Posted: 7 years ago
The SPICE model from the model exchange section of the website was not any help either.
www.comsol.com/community/exchange/146/

There is no supplementing documentation that explains how things are done. Furthermore, there is not even any geometry defined in this model so it wouldn't have been able to teach me how to place a 3-D model into the SPICE circuit anyway. I don't even know why this simulation is even able to run - when I try to run a SPICE circuit simulation with no geometry defined I get an error "There is no geometry to mesh". I get around this by defining some arbitrary cube that is completely irrelevant to the SPICE circuit, and then I am able to simulate with no errors.

I am still unable to include my 3-D models into the SPICE circuit simulation.

Posted: 7 years ago
Hi

I havent tried, but a plain guess:

If, in V4.1, you add a CIRC and a EC physics, then you add a Terminal BC in the EC physics you can select Terminal type: Voltage, Charge or Circuit.

With Circuit, I believe (pls check) that the port name should correspond to the circuit node name

That is the only way I can understand that it works (again I'm guessing, pls check, and pls report back, we are always interesting to learn something new, out here ;)

--
Good luck
Ivar

Posted: 6 years ago
I have basically the same problem. If you're thinking about a solution how to connect the circut to geometric model then let me know also.

Heigo.

Posted: 6 years ago
The comsol interface for spice is lacking. I had sent a request into comsol support for program improvements/help a couple days ago. I myself have a 3D project that will require mating up to a circuit. Their documentation is pretty thin. They have that BJT amplifier version but that is pretty limited in help. I am going to post what I sent in to support. I asked them for any new versions of the program could they include K statements in the spice interface for linking inductors. I also asked about mixing 3D simulations with spice. Here is their reply:

"You can certainly request both K statements and a 3D example model with
SPICE import. Although not previously on our internal wish list (I will put
it there as soon as I have sent you this email), my colleague who is
implemeting our SPICE import confirms that it is a reasonable request, and
that it shouldn't be too hard to implement.

Concerning example models, I am afraid that we do not have much beyond
what it is already out on the web. I agree that it would be nice to have at
least one in the Model Library. I will submit this too as an enhancement
request. In the meantime, if you are unsure of any settings in your own
modeling project, feel free to send us the mph-file along with any specific
questions you have."

When you import a spice model in, it has to be in a .cir extension. If not and you have a .txt or .lib, looks like you have to change the extension. Whenever I had used the import spice in comsol, the default file format is .cir. In you are on support, I would suggest that you email them and request more spice/3D model support. Squeaky wheel = grease.

Posted: 6 years ago
Hello,

This is quite easy to do but it is somewhat different than in version 3.5a. First you can just save your netlist as a text file (ascii) but with the extension ".cir" e.g. mynetlist.cir.

* Then in COMSOL, create your 3D model using the Electric Currents physics interface (under AC/DC), add also the Electrical Circuits interface (AC/DC).
* Create a block.
* Add a suitable material to the block.
* In the Electric Currents Interface, add a Terminal Feature and set its Terminal type to Circuit and select one face.
* Add Ground feature and select the opposite face.
* Right-click the Electrical Circuits node and select Import Spice Netlist, browse to your .cir file and import.
* Now, you will get the desired feature set under the Electrical Circuits node. There will be two External I-Terminals but as one of them is for the ground end of the finite element model (and circuit) , it will not be needed so disable that one.
* For the remaining External I-Terminal, set the Electric potential to Terminal voltage (ec/term1), i.e. connect it to the Electric currents Terminal.
* Solve the model!

Best regards,
Magnus Olsson
COMSOL

Posted: 6 years ago
For those interested, I have taken Magnus's above example with text and pics and put them in a pdf. This way everyone can download one file for all of the info.

Posted: 6 years ago
Thank you !

Ok, but is worng wiht my model, could say me ? See the attachment.

Posted: 6 years ago
Hi,

1) The circuit model is too simple to make a good segregated step use "fully coupled" and a direct solver.
2) Do not use a sine (=time dependent) voltage source in a stationary model.
3) Delete the second terminal - you have connected the Terminal boundary both to nodes 0(ground) and 1.

I attach a fixed version.

Best regards,

Magnus

Posted: 6 years ago
Does this technique also work with coupled coils, where for instance an External-I terminal (first coil) would be connected to an AC voltage source and another External-I (second coil) would be connected to a resistor? I think some electric circuit equations are missing in that case. Any thoughts or ideas on how to solve the coupled inductors' case?

Best regards,
Mathieu

Posted: 6 years ago
Hello everyone,

I'm trying to model transformer with external circuit for a long long time. For my case time dependent solver is needed. In 2D there are some possibilities to provide such simulation. But searching tips for doing the same things in 3D doesn't give me any positive results.
I wish we had something like Multi-Turn Coil Domain for 3D and possibility to use it with external circuit and transient solver (like in 2D Magnetic Fields module).
In other thread I will describe my other problem with coils and external circuit and sine voltage excitation.

Best Regards,
Przemek

Posted: 6 years ago
I think the solution might be in using an external U vs I for the secondary winding and an external I vs U for the primary winding. I am going to check this solution and see if I can get it to work.

Best regards,
Mathieu

Posted: 6 years ago
Have anyone used a PNP or a switch in your circuits?
the PNP in my spice netlist gets imported as an NPN
As for a switch I was not able to import it

Posted: 6 years ago
I do not seem to be able to place a terminal in my AC/DC module. The attached example model says that the plasma model is missing. Is this required to integrate Spice listings into a static simulation?

Posted: 6 years ago
Thanks guys, this was very helpful.

Posted: 6 years ago
Dear Dr. Kjelberg,
I am trying to attach a LR circuit to a PZT. I followed advises posted here and added cir and ec physics, but there is no terminal feature in my EC physics. I cannot connect the circuit to the material. This BC option is just not present. The closest thing I could find was lumped port in Electromagnetic Waves physics. Is my COMSOL 4.1.0.88 missing some module? Could you please advise a workaround?

Victor

Posted: 6 years ago
Dear Mr. Olsson,

I followed the steps of your example, but there is no Terminal feature in my EC interface. I am using comsol 4.1.0.88. Could you please look at the screenshot and advise me what is wrong. Is my version of comsol missing something?
Is there a workaround? I would appreciate your help very much.

Victor

Posted: 6 years ago
Hi

that is strange, which "physics in ACDC ? the "EC" ?
By the way it is absolutely worth to upgrade your version, v4.2 is far more stable than the earlier V4 versions (still v4.1 was quite good)

--
Good luck
Ivar

Posted: 5 years ago
Hi!
I intend to buy COMSOLfor my research and I liked to try the trial version. Now I wanted to test a simple case to understand whether COMSOL may solve my problems.

I wanted to dump a charged (say V_C=2 kV) capacitor (say 3 uF) on a copper wire (say 48 SWG, length say 40 mm) while capacitor and allied circuit consists of an inductance L (say 50 nH) , and circuit resistance R (say 50 mOhm). The initial di/dt may be V_C/L. Now I used Electrical circuit (ec) in which I defined L, C and R with values. In Electric Current, I may define one end of the wire to ground while the other to the terminal. How can I connect to wire to close the circuit in EC? In EC there are two items UvsI and IvsU, -- I am not clear how they can be used. Also do I need to use ODE for current in LCR series to solve current? Can anyone help me to understand?

Posted: 5 years ago

I think the solution might be in using an external U vs I for the secondary winding and an external I vs U for the primary winding. I am going to check this solution and see if I can get it to work.

Best regards,
Mathieu

Were you able to model a transformer what you said? I've been trying the same thing but have failed. I would appreciate it if you could provide some insight.

Posted: 5 years ago

Hello,

* Then in COMSOL, create your 3D model using the Electric Currents physics interface (under AC/DC), add also the Electrical Circuits interface (AC/DC).

Hello Magnus.

I already have a 3D Modell you wrote "see Qoute" create your 3D model using the Electric Currents physics interface (under AC/DC), ......as I said I already have a 3D Modell. Do I have to create the whole modell again using this Electric Currents physics interface (under AC/DC) or did I get you wrong ??

Other question to you mentioned steps does they work with COMSOL 4.3 too ??

Thanks and best regards from Germany
AH

Posted: 5 years ago
Hello,

No, you may just add electric currents physics to your existing model. This can be done in the model tree on the left side of the screen. Right click, chose "add physics". This will also add another solution to your model, so, when you solve, use the solution that includes all physics that you need to include.

Sincerely,

Victor Klymko

Posted: 5 years ago
Dear Victor Klymko

Well I know now how to implement a ".cir" SPICE netlist to a Comsol Modell. But my problem is that it just dosent work. first of all I will explain for all how to add it with COMSOL 4.3

Model-->Add Physics-->AC-DC -->Electrical circuit-->"right click"-->Import SPICE Netlist

Then you have to import your ".cir" Netlist.

If you are lucky and it works you will have to wait a few seconds then you will be able to see the componentes of your .cir under electrical circuit.

---------
So I try to attach this netlist

v1 n005 0 sine(0 327m 44meg) ac 327m
r1 n002 0 225
c1 n002 0 1p
cc n002 n001 330n
ri n006 n005 50
rsh n001 0 68
r2 n004 0 100
r3 n008 n009 16.6666666666667
r4 n003 n008 16.6666666666667
r5 n008 n007 16.6666666666667
c2 n011 n010 70p
c3 n012 0 70p
l1 n010 n009 176n
l2 n006 n007 100n
l3 n003 n004 100n
l4 n011 n012 FEM_sim_3
l5 n004 n001 100n
SUBCKT FEM_sim_3 COMSOL: *
ENDS
*<file name>|<physics_interface_name>|*
.ac lin 10001 10meg 100meg
.end

Whats wrong with it ??

My Comsoll Modell is

l4 n011 n012 FEM_sim_3
SUBCKT FEM_sim_3 COMSOL: *
ENDS

I followed the inductor in circuit example

as a deifnition for the subcircuit i used this deifnition

*<file name>|<physics_interface_name>|*

In the inductor in circuit example they wrote _coil and v_coil as physics_interface_name>...its a global variable as they said but I colndt find it

Can any one please tell me whats wrong with my Netlist ??

Thanks and best regardes from Germany
Ahmed Hegab

Posted: 5 years ago
Hello community...

well I discovered why it dosent work to import a ".cir" netlist from SPICE to Comsoll. Me and I think everyone who wants to import a circuit tryed to read and apply the "inductor in a Circuit" example from comsoll. Its really very thin and poor described. First of all SPICE e.g LTSPICE is not case senstive ! Comsol wrote in the example you have to import your ".cir" netlist to be able to intergrate it to an exisiting comsoll modell. No one mentioned that Comsoll dosent accept small letters.

e.g you circuit consits of a resitanse lets call it r5..LTSPICE exports it to a .cir like "r5 n001 0 50"

COMSOLL accept it only like this

"R5 1 0 50" so only capital letters !

Gosh I wasted like 7 days of my time cause of such thin and bad documentation !!

I hope I could help the others who had the same problem.

Greetings from Germany
Ahmed Hegab !

Posted: 5 years ago

Posted: 5 years ago
Hi

I agree they could have given an example in the help, I cannot find any.
But you have examples of CIR files in the "Models" and they seem to accept more than just one letter (but all first letters are capital, and the net-list is without "n001" just "1")

======= amplifier.cir ===============
* BJT Amplifier circuit
.OPTIONS TNOM=27
.TEMP 27
Vin 1 0 sin(0 1 10kHz)
Vcc 4 0 15
Rg 1 2 100
...
=========================

So who is the "master" of SPICE format, is there a norm, really ?
I wonder if someone have ever written that, and if somebody is really following it I do not know of any, just the habits of each provider ;)

--
Good luck
Ivar

Posted: 5 years ago
Dear Ivar

"So who is the "master" of SPICE format, is there a norm, really ?
I wonder if someone have ever written that, and if somebody is really following it I do not know of any, just the habits of each provider ;)"

well I think the master SPICE format is how spice exports the .cir netlist. My LTSPICE exported the netlist in small letters..Comsoll accept capital one so they should have mention it.

By the way every engineer I know works with LTSPICE cause it is a free tool compared with PSPICE ... any way now we know how it works :) so small letters

By the way I posted another Topic it deals also with importing SPICE it would be nice if you could help or reply it cause I still dont know the answer yet ...
Thanks
Ahmed Hegab

Posted: 5 years ago
Hi

Sorry I cannot help you much more, I'm no Spice specialist (although I have LTspice on my PC, very seldom used ;)
I'm more on the physics side, so I prefer Modelica based tools, such as MapleSim for complex linear modelling, and for my COMSOL model validations.
You all verify and validate your results no ? ;)

Talking about interfaces, CADprogrammers have manged to create a few normalised I/F formats such as STEP,
I notice that FEM programmes have nothing, (more than NASTRAN Neutral files, but those are giving at best the mesh netlis).

In EU there are discussions around "Functional Mock-up Interface" (FMI) see www.fmi-standard.org/

That could perhaps be adapted to FEM too

So Spice is not the only exchange format with little doc

--
Good luck
Ivar

Posted: 5 years ago
I don't think there is a such a thing as an official spice format. There are spice formats that are more common like orcad (or cadence these days) and tend to be the de facto standard. But if you were to use LTC, microwave office, ADS, ansoft, etc, they will all have their own quirks. Most will read orcad ok but I do use ansoft and there are times when parameters show up as unknown/unrecognized.

Just realize that with comsol you are not getting a spice tool. It is more than that but spice is just an addon of sorts. It is very limited in functionality and really the tool is meant for FEA. It does not surprise me that comsol has a funny way of not recognizing lower case/upper case letters. Most spice netlists I have seen in my day have always had a capital letter for each component. I don't know if this feature was intended or not. Anytime I have seen netlists from LTC they have always had uppercase letters for the components.

Posted: 4 years ago
Hello Community,

I am writing from Cal Poly San Luis Obispo in California, working on a thesis project entitled A Novel Dual Modeling Method for Characterizing Human Nerve Fiber Activation. In this thesis I have run into an issue with COMSOL accepting my netlist code.

I have imported code from both PSPICE and LTSPICE and thus am not having the capitalization issue but COMSOL is not accepting a specialized format of a voltage controlled voltage source declared in the netlist. Because of this special format that the code uses I am posting here.

Here is a snip-it of the netlist including the problem lines, EAM and EBM:
*Sodium current current pathway
*M variable
CM 2 0 0.26E-3 IC={MO}
RM 2 0 1E10

GAM 0 2 POLY(2) 2 0 5 0 0 0 1 0 -1
GBM 0 2 POLY(2) 2 0 6 0 0 0 0 0 -1

EAM 5 0 value={-0.1*(v(26)*1E3+35)/(exp(-0.1*(v(26)*1E3+35))-1)}
RAM 5 0 1E10

EBM 6 0 value={4*exp(-(v(26)*1E3+60)/18)}
RBM 6 0 1E10

This netlist code line, EAM, describes a voltage controlled voltage source but is not in the characteristic form for E statements in netlist code and instead uses the analog behavioral modeling of a value statement and a described expression including dependent voltage upon node 26.

Both PSPICE and LTSPICE fully run and support the netlist as is but COMSOL doesn't seem to accept the different statement form for a voltage controlled voltage source. Is there a way around this error or is there information that I am missing or do not fully understand?

Thank You,
Frank Sugden

Posted: 4 years ago
Frank

My first guess would be that comsol does not like the "value" part of the E component.

EAM 5 0 value={-0.1*(v(26)*1E3+35)/(exp(-0.1*(v(26)*1E3+35))-1)}

The documentation is kind of ambiguous at best. From page 262 of the ACDC module for release v4.3b:

"NODE CONNECTIONS
Specify four Node names: the first pair for the connection nodes for the voltage source and the second pair defining the input control voltage. The first node in a pair represents the positive reference terminal. If the ground node is involved, the convention is to use zero for this but it is allowed to have more than one ground node provided it has been given a unique node name.
DEVICE PARAMETERS
Enter the voltage Gain. The resulting voltage is this number multiplied by the control voltage."

For a test, replace your value statement with just a number per typical spice criteria. This value is for gain of the element so maybe something easy like 2. Then retry your model again. If it runs then you need to do something else instead of the value statement. Comsol has a "spice interface" but it is not full featured by any means.

Posted: 4 years ago
Dennis,

Thank you for the quick response. It worked, COMSOL accepted the basic form for the E expression. So now I know that COMSOL only accepts the basic formatting but my SPICE netlist doesn't function correctly without those characteristic equations.

I know its a shot in the dark but do you have any suggestions on how to incorporate those characteristic equations in the basic gain format?

I went to the Math department and was told the equations could not be re-written to my specifications of a voltage multiplied by a constant. Do you happen to have a solution I have not considered?

Thank You,
Frank Sugden

Posted: 4 years ago
You may have thought of these so lets see what happens (listed from easy to harder for implementation):

1) See if you can evaluate that value statement on your own and plug those values straight into comsol through a parameter that defines the gain in the E block. This assumes that the nodal voltage is not affected by the comsol model.

2) Take the expression you have for that value statement and put that into comsol as a defined equation. You would call this function from the E block notation, something notated very simply. Then develop a table of values for the specific nodal voltage you seek. You will have to run several simulations outside of comsol to get this info. You can import text files into comsol to read as data files if you want to go this route. You would then call that equation name along with the parameter of nodal voltage and try it that way. If the data is linear enough you could do a parametric sweep with known start/stop value and you could select the in between step values.

3) If you have a situation where doing the simulation in comsol affects the nodal voltage in question, then you have to make a best guess. This would be a case of manually adjusting values for the model.

In any case, If those nodal voltage values turn out to be highly nonlinear then you may have to make due with a piecemeal approach where you insert the nodal voltage and simulate for each condition.

Posted: 4 years ago
Dennis,

This is incredibly helpful thank you. I have taken your second piece of advice and found a table of values that the equation is based on, i.e. it calls for the voltage at node 26 so I have all the values node 26 goes through in time. I also created plots of those values and a plot the voltage EAM goes through but could not pull values out of PSPICE because .print would not work on a floating node.

I now have the characteristic equation entered into COMSOL and a text file of values for dependency. I have tried importing my COMSOL 3.5a file that I have been working on into COMSOL 4.3a but it crashes and won't support the file. Therefore I cannot use "blocks" as that feature I couldn't find in 3.5. So my next question that I would bother you with is if you have any assistance to give in transferring from 3.5 to 4.3?

I cannot perform the same fix in 3.5 because it does not have an "E" block, only options to bring in more basic SPICE commands like "V" and "I". So if I am going to proceed and use COMSOL to create a portion of the netlist it has to be done in 4.3 no?

Thank you again, and sorry for not being able to complete it further without bothering you for assistance.

Frank Sugden

Posted: 4 years ago

I also created plots of those values and a plot the voltage EAM goes through but could not pull values out of PSPICE because .print would not work on a floating node.

For a floating node, maybe try dropping a large value resistor to ground, something like 100MEG. The node no longer floats and the resistor should not add significant influence.

I now have the characteristic equation entered into COMSOL and a text file of values for dependency. I have tried importing my COMSOL 3.5a file that I have been working on into COMSOL 4.3a but it crashes and won't support the file. Therefore I cannot use "blocks" as that feature I couldn't find in 3.5. So my next question that I would bother you with is if you have any assistance to give in transferring from 3.5 to 4.3?

I cannot perform the same fix in 3.5 because it does not have an "E" block, only options to bring in more basic SPICE commands like "V" and "I". So if I am going to proceed and use COMSOL to create a portion of the netlist it has to be done in 4.3 no?

Couple ways around this. There are known issues with comsol ver35a and trying to open those files in later versions. Your best bet would be to just use the latest version and build the model in there since it has what you need. You can try and open the 35a file in, its either ver 4.1 or v4.2 I don't recall, and then re-save it in that version and the re-open in the latest you have. Not exactly easy to do and you wouldn't know this unless you are using comsol a lot.

Thank you again, and sorry for not being able to complete it further without bothering you for assistance.

No big deal. Not a hard problem and plus you are doing the hard work : - )

Posted: 4 years ago

I have not responded quickly because since your last post I have been attempting to work through an error from COMSOL that doesn't have any literature I could find.

The past problem is done but now on to this. When I try to upload the full code and not just the specific lines that were troublesome COMSOL give me this error:
Error: 6173
Internal error during symbolic processing.

I have spent many days now trying to find documentation and also going through the entire code line by line attempting to discover an error somewhere but again PSPICE runs the code and COMSOL does not. I have discovered that COMSOL does not accept initial conditions on capacitors nor does it accept sources described by "poly" statements and so I have removed those. I have also attempted removing all parameter statements and ".OPTION" statements leaving a code with a great many comments and basic statements but the error message still pops up.

Do you have any experience here and/or any advice moving forward?

Frank Sugden

Posted: 4 years ago
Hi I had the same problem few monrths ago. Please check the following link. Its my COMSOL model with a voltage controlled voltage source.

www.dropbox.com/s/ty7mxe6f4x64vfo/Simulation.mph

Best regards from Germany
Ahmed Hegab

Posted: 4 years ago
The spice interface in comsol is basic. There is nothing in the documentation about having initial conditions for any components. This does not surprise me at all. I have sent in requests to just get K coupling statement between coils and nothing as of v43b. I doubt very much that it will evolve substantially more given that FEA is their main goal.

Best advice is to make the problem as simple as possible so that it will simulate. No fancy spice parameters or the such. See if you can run the spice model alone w/o the FEA model included to make sure that it takes the spice code. Also when running a full up simulation with both circuit and FEA model, see if setting the solver to fully coupled helps. There is at least one example on the comsol website showing this. I think it is the coax cable model w/ circuit.

And thanks to Ahmed for providing that link to a simulation. I don't think this helps with your problem but it does show that whatever you do in comsol for spice, it has to be linear and simple.

dennis

I have not responded quickly because since your last post I have been attempting to work through an error from COMSOL that doesn't have any literature I could find.

The past problem is done but now on to this. When I try to upload the full code and not just the specific lines that were troublesome COMSOL give me this error:
Error: 6173
Internal error during symbolic processing.

I have spent many days now trying to find documentation and also going through the entire code line by line attempting to discover an error somewhere but again PSPICE runs the code and COMSOL does not. I have discovered that COMSOL does not accept initial conditions on capacitors nor does it accept sources described by "poly" statements and so I have removed those. I have also attempted removing all parameter statements and ".OPTION" statements leaving a code with a great many comments and basic statements but the error message still pops up.

Do you have any experience here and/or any advice moving forward?

Frank Sugden

Posted: 4 years ago
Hello to all

Try to use the Comsol support. They helped me alot few months ago. If any one have any question related to my COMSOL SPICE model. Please dont hesitate to ask me

Posted: 4 years ago
Thank you!

Dennis and Ahmed for the guidance, COMSOL has just officially accepted my code!!! I'm thoroughly excited! The only negative is that it doesn't accept it on the first try. I have to keep pressing the okay button multiple times until it goes through but I have re-done it many times and it always eventually accepts it. Thank you for the guidance and I am counting this as a victory.

Frank Sugden

Posted: 4 years ago
Hi all
can yo please tell me the code to add resistor across the model.Can yo send me the link for the spice netlist software

Thanks
Venkatesh

Posted: 4 years ago
Hi
What is that file name and physics interface name.Can yo ppl pls help me?

Venkatesh

Posted: 4 years ago
Venkatesh,

So I think what you're asking is how to connect SPICE to COMSOL right? And what module does so? Well the AC/DC module does so and there is a pull down or right click menu to be used depending on your version.

As to your question about a SPICE analysis tool PSPICE is decent in my personal opinion but I believe that costs you. A good one in my opinion that is free is LTSPICE which can be found here:
www.linear.com/designtools/software/#LTspice

Hopefully that helps.

Frank Sugden

Posted: 4 years ago
Hi
Thanks for your reply.The physics that am using is Thermoelectric effect.But there is no option under that physics to interface with electric circuits.Can yo tel me how to proceed?

Posted: 3 years ago
Hi,

I hope it's not too late. You might want to couple as follows:
Electrical Circuit (cir) to Electric Currents (ec) to Thermoelectric effect.

I believe this is what you want. In the electrical circuit physics, you can import the SPICE stuff. With this you can connect to electric currents via External I-Terminal. This means that your physics is now present in the 3D model you are working in.

Hope this helps!

Posted: 3 years ago
Hi,

I attempted to apply your example in a more complicated setting, yet I am having this error:
Failed to find a solution.
Segregated group 1

System matrix is zero.
In segregated group 1:
Returned solution is not converged.

Any idea on what's causing it? Also note that for some reason COMSOL likes the current source, but I really want to use the voltage source.

Thank you very much!

Posted: 2 years ago

Have anyone used a PNP or a switch in your circuits?
the PNP in my spice netlist gets imported as an NPN
As for a switch I was not able to import it

Alejandro Covalin, Hi ;

Have u dont it ? I am really interested to know if it could be done in CIR.

Thanks

Posted: 2 years ago

Have anyone used a PNP or a switch in your circuits?
the PNP in my spice netlist gets imported as an NPN
As for a switch I was not able to import it

Have you found how to do it ?