Discussion Forum

parameter problem

Topics: no topics

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   3 Replies   Last post: March 12, 2010 8:43pm UTC
Sabine Kling

Sabine Kling

March 11, 2010 4:49pm UTC

parameter problem

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.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar K

Ivar K
Moderator

March 12, 2010 7:17am UTC in response to Sabine Kling

Re: parameter problem

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Sabine Kling

Sabine Kling

March 12, 2010 11:25am UTC in response to Ivar K

Re: parameter problem

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar K

Ivar K
Moderator

March 12, 2010 8:43pm UTC in response to Sabine Kling

Re: parameter problem

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines