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.

Wavelength sweeps in RF module

Please login with a confirmed email address before reporting spam

Dear all,

I am trying to use the RF module to model the interaction of 3D nanostructures with light. I have two questions which seem simple but to which I didn't find an answer in the documentation:

1. In my simulations I would like to sweep the wavelength of the incident field. If I start a parametric sweep with lambda0_rfw as the parameter I receive an error. How should I perform such a sweep?

2. I want to simulate the scattering of light or radiation from localized structures. I have therefore first drawn my structure, drawn a sphere to enclose my structure in vacuum and finally a larger sphere to define a PML at the outer boundary. Now, the two outer spheres overlap with my structure (and with each other) so that I would seem to have three overlapping objects. However, based on my tests this does not seem to be case but instead Comsol seems to decompose the objects into subdomains as I had intended when drawing them, i.e., I have a material structure surrounded by vacuum with a PML at the outer boundary. Is my approach and thinking correct here?

Thank you!

Klas

16 Replies Last Post 19 janv. 2012, 16:14 UTC−5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 déc. 2009, 07:36 UTC−5
Dear Klas,

Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names.

For your second question, you seem to calculate scattering field by the nanostructures. This example can be find in the model exchange place. Find it.

Cheers,

David
Dear Klas, Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names. For your second question, you seem to calculate scattering field by the nanostructures. This example can be find in the model exchange place. Find it. Cheers, David

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 déc. 2009, 13:52 UTC−5
Thank you for solving problem 1! The solution seems obviously simple now! Regarding the second question, I browsed through the "Model Exchange" section but couldn't find anything resembling what I am trying to do. Are you sure there is an example on this there?

Thank you for the helpful advice!

Klas
Thank you for solving problem 1! The solution seems obviously simple now! Regarding the second question, I browsed through the "Model Exchange" section but couldn't find anything resembling what I am trying to do. Are you sure there is an example on this there? Thank you for the helpful advice! Klas

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2009, 13:19 UTC−5
Hi!
I've got exactly the same problem - I'm trying to model nanostructures and also get the peak for lower wavelengths. I tried doing the calculation without anything in my box and get the same peaks...either we are doing something wrong or there is a bug in Comsol.
By the way, the model which was referred to has been taken off the model exchange a while ago. I was first looking for it 2 weeks ago, without success.
Regards,
Martina
Hi! I've got exactly the same problem - I'm trying to model nanostructures and also get the peak for lower wavelengths. I tried doing the calculation without anything in my box and get the same peaks...either we are doing something wrong or there is a bug in Comsol. By the way, the model which was referred to has been taken off the model exchange a while ago. I was first looking for it 2 weeks ago, without success. Regards, Martina

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 déc. 2009, 09:03 UTC−5

Hi!
I've got exactly the same problem - I'm trying to model nanostructures and also get the peak for lower wavelengths. I tried doing the calculation without anything in my box and get the same peaks...either we are doing something wrong or there is a bug in Comsol.
By the way, the model which was referred to has been taken off the model exchange a while ago. I was first looking for it 2 weeks ago, without success.
Regards,
Martina


Hi,
making geometry withouth nanoparticle/s that behaves properly I have found representing quite a chalenge. (What is meant by behaving properly is also a question, but let's say if you find scattering crosssection of some metallic sphere and if it is similar to what you expected, than might work for something else...) I must admit that I haven't spend too much time on trying to figure out what is the recipe fot making it right, but there are some hints that might help.
1) PML issue: You can play with few things regarding PML: Absorbing in r (x,y,z) direction parameter, which represents damping of scattered fields, then geometrical thickness of PML, then meshing inside PML, and at last, position of your PML regarding to scatterer.
After disscussing it with some friends, and comsol support, I cannot conclude anything consistent, but that they are not sure also how to optimize it, or they cannot explain it in easy words. You can find some people making their own PML profiles by changing this 'absorbing parameter' into some analytical formulae, comsol support says you should keep that parameter to be equal to lambda_rfw (why is that, I am not quite sure) and it sometimes works sometimes not. About meshing density and separation from the scatterer also I am not clear, sometimes if I increase meshnig it gives me no improvement (meaning that meshing density is fine), and moving PML further increase my models volume, and than again actuall tickness of PML affects ratio of performance/memory waste.
2) How are u defining your excitation?

Can anyone help about PML issue? Any disscussion is welcome....
Thanks
Srdjan
[QUOTE] Hi! I've got exactly the same problem - I'm trying to model nanostructures and also get the peak for lower wavelengths. I tried doing the calculation without anything in my box and get the same peaks...either we are doing something wrong or there is a bug in Comsol. By the way, the model which was referred to has been taken off the model exchange a while ago. I was first looking for it 2 weeks ago, without success. Regards, Martina [/QUOTE] Hi, making geometry withouth nanoparticle/s that behaves properly I have found representing quite a chalenge. (What is meant by behaving properly is also a question, but let's say if you find scattering crosssection of some metallic sphere and if it is similar to what you expected, than might work for something else...) I must admit that I haven't spend too much time on trying to figure out what is the recipe fot making it right, but there are some hints that might help. 1) PML issue: You can play with few things regarding PML: Absorbing in r (x,y,z) direction parameter, which represents damping of scattered fields, then geometrical thickness of PML, then meshing inside PML, and at last, position of your PML regarding to scatterer. After disscussing it with some friends, and comsol support, I cannot conclude anything consistent, but that they are not sure also how to optimize it, or they cannot explain it in easy words. You can find some people making their own PML profiles by changing this 'absorbing parameter' into some analytical formulae, comsol support says you should keep that parameter to be equal to lambda_rfw (why is that, I am not quite sure) and it sometimes works sometimes not. About meshing density and separation from the scatterer also I am not clear, sometimes if I increase meshnig it gives me no improvement (meaning that meshing density is fine), and moving PML further increase my models volume, and than again actuall tickness of PML affects ratio of performance/memory waste. 2) How are u defining your excitation? Can anyone help about PML issue? Any disscussion is welcome.... Thanks Srdjan

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 déc. 2009, 04:48 UTC−5
Hi!
I have been playing around with the size of the PMLs as well as using well-defined ports instead of automatic plane wave excitation, and I always get the same initial peak for low wavelengths, with or without object in my "box" (see the attached Strangespectrum.jpg). For the attached model, plotting the near field spectrum at point (0,0) results in another peak at higher wavelengths, which is the one I would expect, I think. But I cannot think of any explanation as to the first peak....
Kind regards,
Martina
Hi! I have been playing around with the size of the PMLs as well as using well-defined ports instead of automatic plane wave excitation, and I always get the same initial peak for low wavelengths, with or without object in my "box" (see the attached Strangespectrum.jpg). For the attached model, plotting the near field spectrum at point (0,0) results in another peak at higher wavelengths, which is the one I would expect, I think. But I cannot think of any explanation as to the first peak.... Kind regards, Martina


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 déc. 2009, 09:11 UTC−5
Hi!
I am a new user of Comsol and find this topic very useful. I have a very similar problem - the interaction of plasmonic structures with light. Here you are talking about the pml boundary, but my question is - can we use the scattering boundary instead? It should work like the radiation boundary in other commercial products (will not mention them not to make the advertisement =) I know that radiation boundary is fine for such tasks.

The next question is - can we define the background material not a vacuum? Lets say, my structure is in dielectric environment and the plane wave propagates in this dielectric. The Maxwell equations will remain the same, only one constant is changing. I would like to put the scattering boundaries and the dielectric as a background material. Is it possible to define the problem this way in Comsol?

Thanks!
Dmitry
Hi! I am a new user of Comsol and find this topic very useful. I have a very similar problem - the interaction of plasmonic structures with light. Here you are talking about the pml boundary, but my question is - can we use the scattering boundary instead? It should work like the radiation boundary in other commercial products (will not mention them not to make the advertisement =) I know that radiation boundary is fine for such tasks. The next question is - can we define the background material not a vacuum? Lets say, my structure is in dielectric environment and the plane wave propagates in this dielectric. The Maxwell equations will remain the same, only one constant is changing. I would like to put the scattering boundaries and the dielectric as a background material. Is it possible to define the problem this way in Comsol? Thanks! Dmitry

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15 déc. 2009, 08:41 UTC−5
I think the background material is easy to implement (as long as you look up its dielectric function) once it works for the vacuum. Which it doesn't, at the moment, at least not for me....
Martina
I think the background material is easy to implement (as long as you look up its dielectric function) once it works for the vacuum. Which it doesn't, at the moment, at least not for me.... Martina

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15 déc. 2009, 09:00 UTC−5
Background material can be whatever dielectric you want, just change also PML ref. index to be the same as adjoining dielectric. Plus you should (in theory) increase meshing density, since wavelength is scaled by refractive index of material...
Background material can be whatever dielectric you want, just change also PML ref. index to be the same as adjoining dielectric. Plus you should (in theory) increase meshing density, since wavelength is scaled by refractive index of material...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 6 janv. 2010, 20:54 UTC−5
If you are using something other than air, you need to scale incident E field since in it's definition you have k0_rfw which is for vacuum.
If you will not do that you'll have a lot of reflections at PML boundaries.


Background material can be whatever dielectric you want, just change also PML ref. index to be the same as adjoining dielectric. Plus you should (in theory) increase meshing density, since wavelength is scaled by refractive index of material...


If you are using something other than air, you need to scale incident E field since in it's definition you have k0_rfw which is for vacuum. If you will not do that you'll have a lot of reflections at PML boundaries. [QUOTE] Background material can be whatever dielectric you want, just change also PML ref. index to be the same as adjoining dielectric. Plus you should (in theory) increase meshing density, since wavelength is scaled by refractive index of material... [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2010, 05:48 UTC−5

Dear Klas,

Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names.

For your second question, you seem to calculate scattering field by the nanostructures. This example can be find in the model exchange place. Find it.

Cheers,

David


Hello,
I've got the same problem, using Comsol 4.0a instead. I can get a simulation by frequency sweep (under study-->frequency domain I can set the frequency range sweep), but by a parametric sweep choosing lambda the tool doesn't get the sweeping values. So, maybe the tool doesn't understand the build-in wavelength variable, which is it in 4.0a version?

Thank you very much.
[QUOTE] Dear Klas, Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names. For your second question, you seem to calculate scattering field by the nanostructures. This example can be find in the model exchange place. Find it. Cheers, David [/QUOTE] Hello, I've got the same problem, using Comsol 4.0a instead. I can get a simulation by frequency sweep (under study-->frequency domain I can set the frequency range sweep), but by a parametric sweep choosing lambda the tool doesn't get the sweeping values. So, maybe the tool doesn't understand the build-in wavelength variable, which is it in 4.0a version? Thank you very much.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2010, 06:19 UTC−5
Hi

I'm no longer sure but I beleive that a fequency sweep runs over the variable "freq" while "lambda" is calculated from "freq", no ?
In v4.0 you still have the issue that you must manually adjust both apperance of the frequency sweep in the main solver node and the lower sub-node


--
Good luck
Ivar
Hi I'm no longer sure but I beleive that a fequency sweep runs over the variable "freq" while "lambda" is calculated from "freq", no ? In v4.0 you still have the issue that you must manually adjust both apperance of the frequency sweep in the main solver node and the lower sub-node -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2010, 06:47 UTC−5
Yeah, that's all right, in fact I could use frequency range values (defining variable "freq" in global parameters): in frequency domain node, under main solver node, the tool accepts frequency values only.
I used to work by wavelength values, so I was wondering if it is possible use directly wavelength values instead , because this is possible in 3.5 version, I know for sure.

I'll try to define parametric sweep using lambda, so as I can insert freq-lambda relationship in frequency domain node.

Thanks' again
Yeah, that's all right, in fact I could use frequency range values (defining variable "freq" in global parameters): in frequency domain node, under main solver node, the tool accepts frequency values only. I used to work by wavelength values, so I was wondering if it is possible use directly wavelength values instead , because this is possible in 3.5 version, I know for sure. I'll try to define parametric sweep using lambda, so as I can insert freq-lambda relationship in frequency domain node. Thanks' again

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2010, 11:26 UTC−5
Hi

But if I rememebre "lambda" is defined internally in COMSOL via "iomega" and "freq" so I would rather propose to leav as is and define a "my_Lambda" as parameter. And then state

my_Freq = c_const / my_Lambda

You know in v4.1 you can define a set as a parameter:

my_Set = {1 2 3 4 5 }

and use it in a filed asking for a set such as the parameter list

but I'm not sure ou can write

my_Set = c_const / { range(my_Lambda_start, my_Lambda_stept, my_Lambda_stop) }

I would have to check, but "my" COMSOL WS is blocked by a colleague ;)

--
Good luck
Ivar
Hi But if I rememebre "lambda" is defined internally in COMSOL via "iomega" and "freq" so I would rather propose to leav as is and define a "my_Lambda" as parameter. And then state my_Freq = c_const / my_Lambda You know in v4.1 you can define a set as a parameter: my_Set = {1 2 3 4 5 } and use it in a filed asking for a set such as the parameter list but I'm not sure ou can write my_Set = c_const / { range(my_Lambda_start, my_Lambda_stept, my_Lambda_stop) } I would have to check, but "my" COMSOL WS is blocked by a colleague ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 déc. 2010, 15:13 UTC−5
Ok, thanks for the help, I' ve resolved as said before. I' ve defined "lam" variable and then I set it as parameter for the sweep. Then In the frequency domain module I set simply c/lam under frequency range




I'll try to define parametric sweep using lambda, so as I can insert freq-lambda relationship in frequency domain node.



Ok, thanks for the help, I' ve resolved as said before. I' ve defined "lam" variable and then I set it as parameter for the sweep. Then In the frequency domain module I set simply c/lam under frequency range [QUOTE] I'll try to define parametric sweep using lambda, so as I can insert freq-lambda relationship in frequency domain node. [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 3 janv. 2012, 04:16 UTC−5
Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names.

I did like this, however, an error pop out in my screen (singualr matrix), do you know the reason of this? (I am simulating photonic crystal fibre (PCF) structures in comsol 3.5a and want to calculate the solutions (effective index) by sweeping the operating wavelength.)
Your first question seems to be simple for me. If you would like to perform a parametric sweep, you should go to Physics > Scalar Variables, there will pop out an Application Scalar Variables window in which you can specify an expression beside the build-in variable, lambda0_rfw, like lambda0. Then you go to Solver Parameters > Parametric, where you can fill in the name you gave in the Scalar Variables in the Parameter names. I did like this, however, an error pop out in my screen (singualr matrix), do you know the reason of this? (I am simulating photonic crystal fibre (PCF) structures in comsol 3.5a and want to calculate the solutions (effective index) by sweeping the operating wavelength.)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 janv. 2012, 16:14 UTC−5
Another way to sweep over wavelength in COMSOL 4.x is the following: You can change the default frequency sweep to a wavelength sweep instead by going to the "Parametric 1" under "Stationary Solver 1" and choosing the "user defined" study step. Then, choose the predefined variable LAMBDA as the parameter and in the parameter values, type: range(lam1,(lam2-lam1)/(nlam-1),lam2). This will change the variable LAMBDA from lam1 to lam2 in nlam steps. Then in the variables define freq=c_const/LAMBDA. By doing this, you don't need an extra sweep.
Another way to sweep over wavelength in COMSOL 4.x is the following: You can change the default frequency sweep to a wavelength sweep instead by going to the "Parametric 1" under "Stationary Solver 1" and choosing the "user defined" study step. Then, choose the predefined variable LAMBDA as the parameter and in the parameter values, type: range(lam1,(lam2-lam1)/(nlam-1),lam2). This will change the variable LAMBDA from lam1 to lam2 in nlam steps. Then in the variables define freq=c_const/LAMBDA. By doing this, you don't need an extra sweep.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.