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.

Include function as a variable

Please login with a confirmed email address before reporting spam

Hello,

I have a problem to define a variable. This is how my variable look like: y^(n-1). y is my shear rate and can also be written as “spf.sr” and n is a variable I defined already. For the function I tipped different solution in the variable expression: spf.sre(n-1) or spf.sr*e(n-1) or exp(log(spf.sr)(n-1)

All this solutions doesn’t worked and there is written "unexpected unit of input". Has somebody an idea how I can solve this problem.

Best wishes Feli


1 Reply Last Post Sep 26, 2017, 3:32 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Sep 26, 2017, 3:32 a.m. EDT

Hi

The "unexpected unit of input" message is a warning that COMSOL cannot understand the units (or that they are missing while it expected some units. it could be your "n" that you have given units to and that you need to make unitless by a cast of the type "n[1/nunits]" or it's the log(spf.sr) as log(...) does not like units so you need to cast the spf.sr to a unitless value i.e. via a "spf.sr[s]"

Good luck

-------------------
Have fun COMSOLing,
Sincerely,
Ivar
Hi The "unexpected unit of input" message is a *warning* that COMSOL cannot understand the units (or that they are missing while it expected some units. it could be your "n" that you have given units to and that you need to make unitless by a cast of the type "*n[1/nunits]*" or it's the *log(spf.sr)* as *log(...)* does not like units so you need to cast the *spf.sr* to a unitless value i.e. via a "*spf.sr[s]*" Good luck

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.