# 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.

## 3D waveguide, compute electromagnetic field

I want to view the electromagnetic field (in particular the norm of E) of 3D waveguide. I haven't experience in a 3D waveguide, I have simulate always a cross-section of waveguide. First of all I solved a cross-section in 2D model in COMSOL, after that I tried a 3D model, after drawing the waveguide I inserted two port (type of port is numeric, the excitation is On only one of this port).
In solver sequences created automatically by COMSOL 4 there is two study step, the first is Boundary mode analysis, the second is Frequency domain.

Problem:
The first study step compute rightly the field at boundary of waveguide, the eigenvalue is almost the same of that in 2D model, the second study step doesn't finish, there is an error. First appears a window:

"The following feature has encountered a problem:
Feature: Stationary 1 (sol1/s1)
Error: Undefined value found."

In the tab Error 1 there is:

"Undefined value found.
- Detail: Undefined value found in the equation residual vector.
There are 1 degrees of freedom giving NaN/Inf in the vector for the variable mod1.emw.S1x
at coordinates: (0,0,0), ...
There are 1 degrees of freedom giving NaN/Inf in the vector for the variable mod1.emw.S2x
at coordinates: (0,0,0), ..."

Where is the problem? Is there another method to solve my (I think and hope) simple problem (view the electromagnetic field in the entire 3D structure)?

And sorry for my bad English.

13 Replies Last Post Oct 7, 2013, 6:29 AM EDT
Posted: 7 years ago
The problem is that I have to add two boundary mode analysis, one for each port. Then there are three study in the solver sequence node (two for boundary mode analysis and one for Frequency domain).

The boundary mode analysis is necessary (I think) for simulating the field in the waveguide, each port is a numeric type port then I have to add boundary mode analysis to know the field at boundary of the waveguide.

I hope that this information are useful for other users.

Posted: 7 years ago

The problem is that I have to add two boundary mode analysis, one for each port. Then there are three study in the solver sequence node (two for boundary mode analysis and one for Frequency domain).

The boundary mode analysis is necessary (I think) for simulating the field in the waveguide, each port is a numeric type port then I have to add boundary mode analysis to know the field at boundary of the waveguide.

I hope that this information are useful for other users.

Hello Ciccio,
I having some trouble in putting a 3D model of a simple step-index fiber working... I tried adding the study 'Boundary Mode Analysis' and 'Frequency Domain', but I can't get it working. The only thing that appears after simulation is the following error:

" Undefined value found.
- Detail: Undefined value found in the equation residual vector.
There are 1 degrees of freedom giving NaN/Inf in the vector for the variable mod1.emw.S1x
at coordinates: (0,0,0), ... "

I really don't understand this error code... I was hoping you could help out with this problem. I would appreciate it.

Best Regards,
Steven R. Carneiro

Posted: 7 years ago
Hi Steven,

Assuming that fields are not blowing up inside, you apparently missed to set something up. It would be easier for people if you share your model file as well.

If you can, I would recommend you to have a look at "waveguide adapter" tutorial in model library. It is basically the same thing, launching an eigen mode in the waveguide.

All the best

Posted: 6 years ago
I am having a similar issue with the Microstrip_on_pcb example. I have brought it forward from Comsol 3.5, and am trying to mak it work in 4.0. Of course, all the documented steps from 3.5 have to be (almost) total reinterpreted, but I think i have it. I perform the boundary mode analysis correctly in the first study and store the solution. I then put the frequency domain in a second study and use the store solution as the initial condition. (Note, I could not put these in the same study, as the stationary solver re-evaluates and changes the mode index computed by the boundary mode.) I get a failed to evaluate expression error (sol3/s1). The full text of the error follows. Boundary 10 is the lumped port. Any ideas?

Failed to evaluate variable.
- Variable: mod1.emw.tEmodez
- Geometry: 1
- Boundary: 10
Failed to evaluate variable.
- Variable: mod1.emw.Jsportz
- Defined as: ((mod1.tEz-(2*mod1.emw.tEmodez))/mod1.emw.etaRef)
Failed to evaluate expression.
- Expression: d((mod1.emw.iomega*mu0_const*(-mod1.emw.Jsportx*test(mod1.tEx)-mod1.emw.Jsporty*test(mod1.tEy)-mod1.emw.Jsportz*test(mod1.tEz)))*(dvol),{test@2})

Posted: 6 years ago
Here is the file. It's 4.0a.

Posted: 6 years ago
Hi,

I am having a similar problem in boundary mode analysis and frequency domain analysis in a 3D RF waveguide. Does any one know on how to resolve the following issues I am facing at the moment in Comsol 4.1-

1. When you add boundary mode analysis for two ports, they ask for desired number of modes and search for modes around. Well I know from 2D modal analysis, you can include any number of modes but how to include the search for mode around field as I am just looking for the fundamental mode (I know that you can include the mode index parameter where you are interested as in 2D mode solver but it gives an error in 3 D analysis).

2. Is it possible to solve for TM/TE fundamental mode via boundary mode analysis and then launch the mode at the input port.

Thanks

Roney

Posted: 6 years ago
Hi,
I’ve the same problem. Does anyone get the solutions? I’ve tried to look at "waveguide adapter" tutorial in model library , but it’s not help. There’re still errors. The errors are
" Undefined value found.
- Detail: Undefined value found in the equation residual vector.
There are 1 degrees of freedom giving NaN/Inf in the vector for the variable mod1.emw.S1x
at coordinates: (0,0,0), ... "
It would be a very helpful if anyone can help or get the solutions for these errors

Posted: 6 years ago
You have to add in the electromagnetic brach two port, set in type of port numeric, you have to set "Wave excitation in the port" to On only to one of the two port.

In the branc study, you have to add two boundary mode analysis, and set correctly the field Port name.

To choose one particular mode in multimodal waveguide, you have to create two stuy, in one add two boundary mode analysis, in the second stydy add only a frequency domain. Create default solver in the second study and set in the dependent varibales the right parameter to choose the solution that you found out in the first stydy.

Posted: 6 years ago
Hi Ciccio,

I have the same problem while I have done what you have said.
Could you please share your structure, which has solved? or send it to my email (ahaje092@uottawa.ca)

Akram

Posted: 6 years ago
Hi Steven,

I have the same problem.
Could you please send your structure to me if you have solved it?

my email:
ahaje092@uottawa.ca

Akram

Posted: 5 years ago

Hi Ciccio,

I have the same problem while I have done what you have said.
Could you please share your structure, which has solved? or send it to my email (ahaje092@uottawa.ca)

Akram

Did you get the required file? I am really stuck into this problem.