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.

parameter problem

Please login with a confirmed email address before reporting spam

Hi,

I have a problem with the parametric solver. The two parameters which I defined under "solver parameters..." --> "parameter name" are not recognized by Comsol.
If I enter the parameter(s) e.g. in a force in the boundary mode, the field highlights an unexpected unit. (But the parameter shouldn't have any units, should it?!)
Well, and if I ignore this message and solve the model, than I do not get a solution, i.e. there is no deformation, because no force was applied.

If there is somebody having an idea what could be wrong, please tell me. Thanks.

3 Replies Last Post 12 mar 2010, 15:43 GMT-5
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 12 mar 2010, 02:17 GMT-5
Hi

If you define a parameter in the solver window of name "param" it should not have units, I agree.

When you define a force in the BC window such as Fx=MyFx*param you should define MyFx as the amplitude with units in i.e. the constants, and then "param" without units is OK

But you can also write Fx = (1000[N])*param or even Fx=param[N]
(pls check the last one I d not have access to COMSOL just now from here)

But Fx=param would give an unit error if param has no units, but this is normally just a warning, the results should still be OK if your param values are truely expressing the value you want in oyur units

I use "param" mostly from "0 to 1" and have amplitude values defined as constants, as that is the cleanest for later understanding of the model

Hope this helps
Good luck
Ivar
Hi If you define a parameter in the solver window of name "param" it should not have units, I agree. When you define a force in the BC window such as Fx=MyFx*param you should define MyFx as the amplitude with units in i.e. the constants, and then "param" without units is OK But you can also write Fx = (1000[N])*param or even Fx=param[N] (pls check the last one I d not have access to COMSOL just now from here) But Fx=param would give an unit error if param has no units, but this is normally just a warning, the results should still be OK if your param values are truely expressing the value you want in oyur units I use "param" mostly from "0 to 1" and have amplitude values defined as constants, as that is the cleanest for later understanding of the model Hope this helps Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12 mar 2010, 06:25 GMT-5
Hi,

thanks for the answer. I tried your suggestion: Fx = (1000[N])*param and also: Fx=param[N])
but I am still having the same problem. The error meassage didn't disappear. Is there any possibility to check as which unit my parameters are handled?

Yes, I also thought that even when the units don't agree, the solution should be all right.
But yesterday I solved first with the parameter solver (for only one parameter set) and after inserted the values directly in the equations and solved again. However I didn't get any deformation in the first case, only in the second one.

Apart from that, what I am wondering about:
Does the solver evaluate each parameter set from the initial geometry or is (from the second parameters set on) the geometry used from the former parameters set?

regards, Sabine

Hi, thanks for the answer. I tried your suggestion: Fx = (1000[N])*param and also: Fx=param[N]) but I am still having the same problem. The error meassage didn't disappear. Is there any possibility to check as which unit my parameters are handled? Yes, I also thought that even when the units don't agree, the solution should be all right. But yesterday I solved first with the parameter solver (for only one parameter set) and after inserted the values directly in the equations and solved again. However I didn't get any deformation in the first case, only in the second one. Apart from that, what I am wondering about: Does the solver evaluate each parameter set from the initial geometry or is (from the second parameters set on) the geometry used from the former parameters set? regards, Sabine

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 12 mar 2010, 15:43 GMT-5
Hi Sabine

Well for me there is something else wrong, you might have picked a variable already defined in COMSOL ? which then might have "units" associated.

My way to check this, as it happens often, is to define a simple model (square) in the given application mode, run a "get initial value" to populate the matrices and go into the postpro session and plot/evaluate the value of the variable name, if COSMOL recognises it, it will even show you the associated units.

Or you dump the model as a "m" file and you do a txt search for your variable name.

It's true that I seldom use two parameters, but I have never had difficulties with the first one, it's unitless for me ;)
at least when I call it "param or param_1" and that I have not defined it as such anywhere else.

Short note/trick: when i switch between stationary an parameric solving, I often define a Constant as param = 0 or what ever else I need. As the Constants are evaluated once at programme start the, value will be overwritten later if I use it, and take a "default" value handy for me if not used later. This avoids the need to re-write all equations when you switch between the different applications modes.

If I remeber right (my COMSOL licence is fully booked by a colleague, connot try just now ;) the order of the parameters when you use several is 1.1 1.2 2.1 2.2 3.1 3.2 alternatively. Try a simple check by using it as an x & y forced displacement of a simple canteliever, or something else simple enough to rapidly test it out.

Good luck
Ivar
Hi Sabine Well for me there is something else wrong, you might have picked a variable already defined in COMSOL ? which then might have "units" associated. My way to check this, as it happens often, is to define a simple model (square) in the given application mode, run a "get initial value" to populate the matrices and go into the postpro session and plot/evaluate the value of the variable name, if COSMOL recognises it, it will even show you the associated units. Or you dump the model as a "m" file and you do a txt search for your variable name. It's true that I seldom use two parameters, but I have never had difficulties with the first one, it's unitless for me ;) at least when I call it "param or param_1" and that I have not defined it as such anywhere else. Short note/trick: when i switch between stationary an parameric solving, I often define a Constant as param = 0 or what ever else I need. As the Constants are evaluated once at programme start the, value will be overwritten later if I use it, and take a "default" value handy for me if not used later. This avoids the need to re-write all equations when you switch between the different applications modes. If I remeber right (my COMSOL licence is fully booked by a colleague, connot try just now ;) the order of the parameters when you use several is 1.1 1.2 2.1 2.2 3.1 3.2 alternatively. Try a simple check by using it as an x & y forced displacement of a simple canteliever, or something else simple enough to rapidly test it out. 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.