Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
28.08.2019, 08:06 GMT-4
Hi,
you may need to use the nojac() operator in your equations.
Cheers
Edgar
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi,
you may need to use the nojac() operator in your equations.
Cheers
Edgar
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
28.08.2019, 08:45 GMT-4
Hi, Edgar:
Thank you for your reply. I am actually not familar with this operator. Will it influence the accuracy too much?
Thanks
-------------------
Yu Zhang
Hi, Edgar:
Thank you for your reply. I am actually not familar with this operator. Will it influence the accuracy too much?
Thanks
Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
28.08.2019, 13:13 GMT-4
I guess that depends on your equations.
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
I guess that depends on your equations.
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
28.08.2019, 19:39 GMT-4
Updated:
5 years ago
28.08.2019, 19:41 GMT-4
Hi Yu,
As Edgar said you can put inside nojac() the terms you do not want to contribute to the Jacobian matrix.
Theoretically it is possible that the use of nojac() can lead to non-convergence if not including the Jacobian contributions from those terms ends up giving you a poor Newton update. In most cases you just get slower convergence as measured by number of iterations but each iteration will take less time to compute. It is a tradeoff between these.
If it converges, it convergence to the right solution since the nojac() does not exclude the terms from the residual. It just excludes them from the Jacobian. Search nojac in the COMSOL Multiphysics Reference Manual.
Another item to be careful about when using your own ODEs is the scaling. For the built-in physics interfaces the software has default scales that work fine in the majority of cases. But if you are adding your own equations the default scales picked can be poor and sometimes this can be the bottleneck. See here for more on that.
https://www.comsol.com/support/knowledgebase/1240/
Cheers,
T. M. Kindo
-------------------
We all have opinions. But the COMSOL support team has the truth. I don't know if my opinion is still the truth. Check with that team before you try this at home!
Hi Yu,
As Edgar said you can put inside nojac() the terms you do not want to contribute to the Jacobian matrix.
Theoretically it is possible that the use of nojac() can lead to non-convergence if not including the Jacobian contributions from those terms ends up giving you a poor Newton update. In most cases you just get slower convergence as measured by number of iterations but each iteration will take less time to compute. It is a tradeoff between these.
If it converges, it convergence to the right solution since the nojac() does not exclude the terms from the residual. It just excludes them from the Jacobian. Search nojac in the COMSOL Multiphysics Reference Manual.
Another item to be careful about when using your own ODEs is the scaling. For the built-in physics interfaces the software has default scales that work fine in the majority of cases. But if you are adding your own equations the default scales picked can be poor and sometimes this can be the bottleneck. See here for more on that.
https://www.comsol.com/support/knowledgebase/1240/
Cheers,
T. M. Kindo
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
29.08.2019, 21:36 GMT-4
Hi, Kindo,
Thanks a lot for the detailed reply and suggestions. I will try it!
-------------------
Yu Zhang
Hi, Kindo,
Thanks a lot for the detailed reply and suggestions. I will try it!
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
26.09.2019, 01:55 GMT-4
Updated:
5 years ago
26.09.2019, 01:56 GMT-4
Great Post