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.

Mode analysis - changing refractive index

Please login with a confirmed email address before reporting spam

Hi,

I am currently doing a mode analysis and need to do a simulation with different refractive index. I want
the refractive index for one region in my geometric model to vary between '2 + eps' to '2 - eps'. How can I
do this the best way?

Is it possible to .. create a parameter 'nd' = 2, and then another parameter 'deps' = 0. Next step is creating a function called 'n_func(deps)', in which is equal to 'n_func = nd + deps'. Then I create a parametric sweep for variable called 'deps' between [2 + eps, 2 - eps] and placing n_func(deps) in the refractive index input for that material of the wanted region?

The problem is I dont get the same result (same refractive index and nodes) for when deps = 0, that is when nd = 2 = n_func(deps). As far as I can see I haven't changed the two files that much other than adding n_func to the one of the files.

Is there a way to save the resulting effective refractive index per n_func(deps) as vector text file or similar to be opened in matlab?

Many thanks for any assistance.


3 Replies Last Post May 13, 2011, 4:42 p.m. EDT
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 May 6, 2011, 7:57 a.m. EDT
Hi

first of all "eps" is already a COMSOL internal variable, use something else, my way would be:

Global Definitions Parameter deps = 0
Material property or "physics material property user defined" index value n = 2+deps
Solver: add Parametric sweep on parameter deps = 0.2*range(-1,0.1,1)

The latter you can do by either add a "Study Parametric Sweep" or at the sub node level: Stationary Solver 1, add Parametric

--
Good luck
Ivar
Hi first of all "eps" is already a COMSOL internal variable, use something else, my way would be: Global Definitions Parameter deps = 0 Material property or "physics material property user defined" index value n = 2+deps Solver: add Parametric sweep on parameter deps = 0.2*range(-1,0.1,1) The latter you can do by either add a "Study Parametric Sweep" or at the sub node level: Stationary Solver 1, add Parametric -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 13, 2011, 7:47 a.m. EDT

Hi

first of all "eps" is already a COMSOL internal variable, use something else, my way would be:

Global Definitions Parameter deps = 0
Material property or "physics material property user defined" index value n = 2+deps
Solver: add Parametric sweep on parameter deps = 0.2*range(-1,0.1,1)

The latter you can do by either add a "Study Parametric Sweep" or at the sub node level: Stationary Solver 1, add Parametric

--
Good luck
Ivar


Thank you!

One more question. How do you do parametric sweep twice but for different parameters? Is it possible?

Will it play out as like for two for-loops, i.e

for i = 1: 3
for j = 1: 5
-- text --
end
end
[QUOTE] Hi first of all "eps" is already a COMSOL internal variable, use something else, my way would be: Global Definitions Parameter deps = 0 Material property or "physics material property user defined" index value n = 2+deps Solver: add Parametric sweep on parameter deps = 0.2*range(-1,0.1,1) The latter you can do by either add a "Study Parametric Sweep" or at the sub node level: Stationary Solver 1, add Parametric -- Good luck Ivar [/QUOTE] Thank you! One more question. How do you do parametric sweep twice but for different parameters? Is it possible? Will it play out as like for two for-loops, i.e for i = 1: 3 for j = 1: 5 -- text -- end end

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 May 13, 2011, 4:42 p.m. EDT
Hi

in the parametric (or continuation) sweep, you add two or more parameter names, then the raneg netry must be sorted in pair, triplets (check the doc and the forum, there have already been many discussions and examples about this (use the "search" function)

--
Good luck
Ivar
Hi in the parametric (or continuation) sweep, you add two or more parameter names, then the raneg netry must be sorted in pair, triplets (check the doc and the forum, there have already been many discussions and examples about this (use the "search" function) -- Good luck Ivar

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.