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.

Using an Analytic function inside an "Explicit distribution"

Please login with a confirmed email address before reporting spam

I can put in parameters and arithmetic expressions into an "Explicit distribution" field of a Distribution mesh node, but for some reason when I put in a user-defined function name (tried its tag too), it says "Failed to evaluate expression". Why not? These functions are static and won't cause trouble if this use were allowed.

I guess it's just another annoyance that I now have to spend time on finding a workaround for.

                                                                                                                                                                                                         -- Evgeni.org

1 Reply Last Post 2014年2月17日 GMT-5 21:11

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年2月17日 GMT-5 21:11
Also, it would be useful if one could Reverse Direction for an Explicit Distribution. Should be very easy to implement.

Use case: I have an Explicit Distribution like this {range(0,0.36,min(2.3,a_d^(1/1.5)-0.36))}^1.5, a_d

(Note that the length of it depends on a parameter.)

Now I need to figure out how to write an expression which will reverse it. Checking a checkbox would have been easier.

EDIT: a solution was 0, a_d-({range(min(6,floor(2.7778*a_d^(1/1.5)-1)),-1,-0.1)}*0.36)^1.5 i.e. made the upper bound of the range(..) tight, and then reversed it. Still would prefer a checkbox.

                                                                                                                                                                                                         -- Evgeni.org


Also, it would be useful if one could Reverse Direction for an Explicit Distribution. Should be very easy to implement. Use case: I have an Explicit Distribution like this [b]{range(0,0.36,min(2.3,a_d^(1/1.5)-0.36))}^1.5, a_d[/b] (Note that the length of it depends on a parameter.) Now I need to figure out how to write an expression which will reverse it. Checking a checkbox would have been easier. EDIT: a solution was [b]0, a_d-({range(min(6,floor(2.7778*a_d^(1/1.5)-1)),-1,-0.1)}*0.36)^1.5[/b] i.e. made the upper bound of the range(..) tight, and then reversed it. Still would prefer a checkbox.                                                                                                                                                                                                          -- http://Evgeni.org

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.