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.

Unit syntax error, not sure why

Please login with a confirmed email address before reporting spam

This is likely something very obvious but I can't figure it out. I'm trying to define a variable:

omega0 = e_const*hbar_const*sqrt(fermienergy/W)

fermienergy has units joules and W has units of (micro)metres. W is the thing which varies in a parametric sweep. Any ideas why it gets oranged out and says "unit syntax error"?

I'm using the radio frequency module

1 Reply Last Post 14 mar 2017, 14:55 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 mar 2017, 14:55 GMT-4
Hello Joshua,
Mathematical functions like sqrt take scalar arguments. Hence the "oranging out", which means a warning, rather than an error.
If you know what you are doing, you can ignore it. Alternatively you can modify your expression to something like sqrt(const1*fermienergy/W) where const1 is the constant that has unit of (micro)meters per Joule and is currently implied rather than stated explicitly.
Best,
Jeff
Hello Joshua, Mathematical functions like sqrt take scalar arguments. Hence the "oranging out", which means a warning, rather than an error. If you know what you are doing, you can ignore it. Alternatively you can modify your expression to something like sqrt(const1*fermienergy/W) where const1 is the constant that has unit of (micro)meters per Joule and is currently implied rather than stated explicitly. Best, Jeff

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.