Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
26 gen 2017, 10:00 GMT-5
Hello Liam,
This is a warning that you are not consistent with dimensions. For instance, as far as the software is concerned, you may be adding a quantity that has units of length to one that has units of time.
Think of it this way: with pen and paper you may write that a point that moves at a constant speed of 1m/s has the x coordinate x= x0+t . A computer program seeing an expression like that has no way of knowing whether you intentionally left out the velocity or whether you made a mistake, so COMSOL produces a warning in the form of the orange text. If you know what you're doing, you can ignore this warning. To be on the safe side though, it's a good idea to type x0+1[m/s]*t or x0+v0*t where v0 has units consistent with a speed - The offending expression will return to black when it's "fixed".
Best,
Jeff
Hello Liam,
This is a warning that you are not consistent with dimensions. For instance, as far as the software is concerned, you may be adding a quantity that has units of length to one that has units of time.
Think of it this way: with pen and paper you may write that a point that moves at a constant speed of 1m/s has the x coordinate x= x0+t . A computer program seeing an expression like that has no way of knowing whether you intentionally left out the velocity or whether you made a mistake, so COMSOL produces a warning in the form of the orange text. If you know what you're doing, you can ignore this warning. To be on the safe side though, it's a good idea to type x0+1[m/s]*t or x0+v0*t where v0 has units consistent with a speed - The offending expression will return to black when it's "fixed".
Best,
Jeff
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
26 gen 2017, 12:24 GMT-5
Hi Jeff,
Firstly, thank you so much for your speedy reply! You are completely correct, including the units does seem to fix the issue of the orange text and now COMSOL is much happier :)
I have just one more question (also about nesting). In my project I am using a mixture of :
- Analytical Functions (under Global Definitions) to calculate values using empirical formulas
- Variables (under comp1 - Definitions) to calculate rates
- PDEs (under mathematics) to calculate mole fractions, pressure changes etc.
These are all interlinked and so the functions within the PDEs will call on Analytical Functions, which in turn will call on Variables to spit out the answer. This answer is then dropped into the following PDE, and so forth. This has begun causing issues for one of my PDEs (the one which spits out pressure) as its output is used as an input to all three types of functions listed above. I have tried to fix this by setting initial values for all variables required but the software is still having issues. I was curious if you think my setup (functions within functions etc.) is acceptable for COMSOL or if you would suggest a different route?
Kind regards,
Liam
Hi Jeff,
Firstly, thank you so much for your speedy reply! You are completely correct, including the units does seem to fix the issue of the orange text and now COMSOL is much happier :)
I have just one more question (also about nesting). In my project I am using a mixture of :
- Analytical Functions (under Global Definitions) to calculate values using empirical formulas
- Variables (under comp1 - Definitions) to calculate rates
- PDEs (under mathematics) to calculate mole fractions, pressure changes etc.
These are all interlinked and so the functions within the PDEs will call on Analytical Functions, which in turn will call on Variables to spit out the answer. This answer is then dropped into the following PDE, and so forth. This has begun causing issues for one of my PDEs (the one which spits out pressure) as its output is used as an input to all three types of functions listed above. I have tried to fix this by setting initial values for all variables required but the software is still having issues. I was curious if you think my setup (functions within functions etc.) is acceptable for COMSOL or if you would suggest a different route?
Kind regards,
Liam
Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
26 gen 2017, 14:35 GMT-5
Nothing wrong with nesting functions, per se.
I am not sure I fully understand what specific problem you are facing, but I would check on scopes. With functions and variables calling each other, it's easy to unknowingly try to e.g. call a quantity where it is not properly defined.
Not sure if that helps. Feel free to contact support@comsol.com with more details if needed.
Best,
Jeff
Nothing wrong with nesting functions, per se.
I am not sure I fully understand what specific problem you are facing, but I would check on scopes. With functions and variables calling each other, it's easy to unknowingly try to e.g. call a quantity where it is not properly defined.
Not sure if that helps. Feel free to contact support@comsol.com with more details if needed.
Best,
Jeff
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
27 gen 2017, 03:25 GMT-5
Hi Jeff,
Thank you for clarifying that nesting functions is okay, this puts me at ease.
I will check the scopes now, let us see if that works out, otherwise I will pop you guys an email.
Kind regards,
Liam
Hi Jeff,
Thank you for clarifying that nesting functions is okay, this puts me at ease.
I will check the scopes now, let us see if that works out, otherwise I will pop you guys an email.
Kind regards,
Liam