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.
Variable problem
Posted Jul 19, 2012, 1:20 p.m. EDT Materials, Modeling Tools & Definitions, Parameters, Variables, & Functions Version 4.2 8 Replies
Please login with a confirmed email address before reporting spam
Anyone reply please.Thanks
Please login with a confirmed email address before reporting spam
I believe so, you need to use the definitions variables and define the entities where it applies then enter your equaition.
BUT call it something else as "nz" as "nz" is already the local COMSOl variable name for the z component of the vector normal to a boundary.
You can give it another combinatin such as "Nz" or "my_nz"
Note that COMSOL does not always flag an error if you redefine an internal variable as COMSOl allows the user to change its formulas, but COMSOl assumes the user know what he/she is doing, sometimes it's by mistake, and the results can become funny, or it might go undetected (worse)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I need to assign a 'z' ranging from 0 to 0.5 in 20 steps and 'Nz' will vary for this 20 values. How to assign the value of 'z'?
Please login with a confirmed email address before reporting spam
Is it this you want ?, I', using X in 2D X,Y but it could also be in Z in 3D. Note in solid x and X are different, use rather upper-case in Solids as this reefers to the actual geometrical position (material frame)
--
Good luck
Ivar
Attachments:
Please login with a confirmed email address before reporting spam
In my problem, 'Nz' should vary across the Z axis.
Please login with a confirmed email address before reporting spam
circular variable references is a know issue in numerical simulations, but often tricky to solve, it happens when variables depends on variables that depends ... and so on, and sudenly you loop around.
The trick is to cut the loop by adding a new dependent variable but it all depends on the model and the loop you have, far from trivial to say anything more
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
what should I do with it now?
Thanks in advance.
Attachments:
Please login with a confirmed email address before reporting spam
well first I do not see why you define NZ, you can use directly "z" no ?
then if it is for a periodic index variation, probably you should check your offsets and the formula should read something like ...sin(2*pi*(z-Z0)/0.5[um])) with a Z0 defined per domain, as I see that this material property is applied to many elements.
Finally in wave and optics you need a very fine mesh, which means that you need a lot of RAM (mesh density < 1/5 of the wavelength IN THE MATERIAL (do not forget "n" the index effect!)
One way is if your model is symmetric, you might be aple to use a 2D-axi, but sometimes with some types of polarized light the axisymmetry is not respected
Have you tried to see how the index varies, if it is correctly entered ? The easiest is to select the "dependent variables" sub node in the solver sub-tree and do a right click "compute to current/here" This will load in all initial conditions, you can then use the Results section to visualise the initial values, such as index variations, initial fields etc
--
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.
Suggested Content
- KNOWLEDGE BASE COMSOL Not Working on a Linux Cluster
- FORUM Undefined variable problem
- BLOG How to Use the Parameter Estimation Study Step for Inverse Modeling
- KNOWLEDGE BASE Duplicate parameter/variable name
- FORUM probe variable problem