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.

Derived Value Slower, Less Accurate than Plot

Please login with a confirmed email address before reporting spam

Hello,

I am trying to find the minimum value of a function evaluated only on a subset of a given surface, where that subset is specified by a constraint.

I've defined a minimum derived value, and given an expression of the form:
myfunction(params) + (mycondition==0)*largenumber

This way, unless mycondition is met, the expression won't come close to the minimum value, so I restrict attention to the aforementioned subset of interest.

Now, here's the rub- when I calculate the derived value, it takes a full minute, then returns a minimum value that is greater than largenumber. BUT, when I do an isosurface plot of my data set, colored with the expression above, it evaluates in 10 seconds and I can clearly see with my eye that the minimum is much less than largenumber (because there ARE regions where my condition is met) and what the derived minimum value was returning cannot be correct.

Why would plotting my expression on the surface of interest be so much faster than finding the minimum value on that surface? Why is the minimum value calculation way off?

Should I just make plots for all of my parameters of interest and use the minimum value on the color bar to get what I want? Seems like a silly way that shouldn't be more efficient and accurate than the derived value approach, but here I am.

0 Replies Last Post 2016年4月5日 GMT-4 10:56
COMSOL Moderator

Hello David Reens

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.