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.

Divide in Comsol

Please login with a confirmed email address before reporting spam

The funniest thing that I have ever seen just happened to me while using Comsol.
With all due respect, Comsol gives me a wrong answer for a simple calculation (number from solution/constant number).

I spent hours and hours trying to figure out why I am getting that error, and at the end, I figured our that there is a problem with the software.
With the calculator, the answer is 8.06, and with Comsol, I get 8.368.
I have absolutely no idea why.
I can send anyone who wants the Comsol file to check this out.

2 Replies Last Post 2014年3月21日 GMT-4 15:46
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年3月21日 GMT-4 03:56

Send the numbers and keep in mind they might be complex.

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Send the numbers and keep in mind they might be complex. -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Eric Favre COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年3月21日 GMT-4 15:46
Hello Farhad,

you don't explain much about your statement, so it's difficult to give appropriate feedback, but I thought I would still give a few comments based on your post.

There might very well be differences between 2 different methods or softwares operating in different hardwares with different implementations, however there is always an explanation for that. If you use the calculator inside COMSOL (I mean the parameters) compared to a classic algebraic calculator outside, doing the exact same algebraic operation, well I presume you should face more or less the same problems related to numerical precision related to algebraic manipulations of large numbers compared to small ones. As far as I know no solution is perfect when it comes to finite precision numerics.

Related, rounding errors are connected to the famous "butterfly effect" from E. Lorenz. See www.comsol.com/model/rossler-attractor-10656 for instance. One of the concepts of chaos is that a deterministic equation with a limited number of degrees of freedom (at least 3, but not necessarily more) might be impossible to predict in time unless you have infinite precision of your initial conditions.

You indicate "number from solution/constant number" : if this is a comparison between COMSOL result from the solution of an ODE, PDE or other such problem, compared to an analytical result, it's important to check out that you are in the exact same conditions in both cases. It's generally not that easy to mimic analytical conditions with a closer to reality PDE-based conditions.
For instance, the magnetic field at a given distance of a current wire, considering the non-zero radius of the wire, leads to some difference that can be important close to the wire but are generally not far from it.
Another example of difficulty in representing reality comes from singularities : see this blog from a colleague : www.comsol.com/blogs/how-identify-resolve-singularities-model-meshing/

Best regards,
Eric Favre
COMSOL France

Hello Farhad, you don't explain much about your statement, so it's difficult to give appropriate feedback, but I thought I would still give a few comments based on your post. There might very well be differences between 2 different methods or softwares operating in different hardwares with different implementations, however there is always an explanation for that. If you use the calculator inside COMSOL (I mean the parameters) compared to a classic algebraic calculator outside, doing the exact same algebraic operation, well I presume you should face more or less the same problems related to numerical precision related to algebraic manipulations of large numbers compared to small ones. As far as I know no solution is perfect when it comes to finite precision numerics. Related, rounding errors are connected to the famous "butterfly effect" from E. Lorenz. See http://www.comsol.com/model/rossler-attractor-10656 for instance. One of the concepts of chaos is that a deterministic equation with a limited number of degrees of freedom (at least 3, but not necessarily more) might be impossible to predict in time unless you have infinite precision of your initial conditions. You indicate "number from solution/constant number" : if this is a comparison between COMSOL result from the solution of an ODE, PDE or other such problem, compared to an analytical result, it's important to check out that you are in the exact same conditions in both cases. It's generally not that easy to mimic analytical conditions with a closer to reality PDE-based conditions. For instance, the magnetic field at a given distance of a current wire, considering the non-zero radius of the wire, leads to some difference that can be important close to the wire but are generally not far from it. Another example of difficulty in representing reality comes from singularities : see this blog from a colleague : http://www.comsol.com/blogs/how-identify-resolve-singularities-model-meshing/ Best regards, Eric Favre COMSOL France

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.