Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

[Basic Level] Function implementations

Please login with a confirmed email address before reporting spam

Hello,

I defined a function "fun" in the "Global Definitions"

"fun" is a piece-wise function with the argument of time t. So fun(t), and this function works correctly.

I used physics "Transport of Diluted species", and I have a "Flux condition".

I choose "Inward Flux" with "Species c", and type the function for the flux condition.
But when i type "fun" or "fun(t)", it displays red.

So what is the formula of the function type : f[t] or f(t) or f{t} ?

1 Reply Last Post 1 févr. 2012, 12:56 UTC−5
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: 1 decade ago 1 févr. 2012, 12:56 UTC−5
Hi

normally it's fun(any_name), your argument "t" used for the deifnition is a dummy name, you can chose x or w or ...

What might happen is that you need the full path to access it, depends on the branches and travel across the model tree. Then it's either something like root.fun() or root.mod1.fun() or something in between depoends on how you set up the model tree

Check alos the doc User manual p126 (42a) about variable naming and p 149 about global and local funcions
--
Good luck
Ivar
Hi normally it's fun(any_name), your argument "t" used for the deifnition is a dummy name, you can chose x or w or ... What might happen is that you need the full path to access it, depends on the branches and travel across the model tree. Then it's either something like root.fun() or root.mod1.fun() or something in between depoends on how you set up the model tree Check alos the doc User manual p126 (42a) about variable naming and p 149 about global and local funcions -- Good luck Ivar

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.