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.
Define time dependent interpolation function.
Posted Mar 26, 2012, 3:13 p.m. EDT Version 4.2 1 Reply
Please login with a confirmed email address before reporting spam
Hi, guys
I am a COMSOL newbie and need some help on defining time dependent interpolation function.
I have a pretty simple model, a sphere. I need to define an volumetric force input F( t, r, z )as below, which varies both with time and space:
F( t, r, z ) = I * sin(t) * f( r , z ) %%% I is const, t is time, r & z are space coordinates with unit meter
Basically, F consists of two parts, one is time dependent : sin ( t ) and the other space dependent part is grid point values for defining interpolation function : f(r, z).
Since I was successful before with the static model (only f(r, z)). So, I just defined firstly a interpolation function f (r,z) and then the new time-variant force input as a analytic function with the following expression:
I * sin(t) * f (r[m^-1],z[m^-1]) %%%% arguments: t, r, z
COMSOL complains:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Undefined variable.
- Variable: r
- Function name: F
Error in multiphysics compilation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Aren't r & z implicitly defined already when I defined the interpolation function and checked "Use space coordinates as arguments"? Do I need to explicitly define them again somewhere else?
So I changed the expression:
I * sin(t) * f %%%%% argument: t
COMSOL complains again:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Undefined variable.
- Variable: f
- Function name: F
Error in multiphysics compilation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Now, this time COMSOL can not recognize the interpolation function f...
Thank you in advance!
Best,
Xiao
I am a COMSOL newbie and need some help on defining time dependent interpolation function.
I have a pretty simple model, a sphere. I need to define an volumetric force input F( t, r, z )as below, which varies both with time and space:
F( t, r, z ) = I * sin(t) * f( r , z ) %%% I is const, t is time, r & z are space coordinates with unit meter
Basically, F consists of two parts, one is time dependent : sin ( t ) and the other space dependent part is grid point values for defining interpolation function : f(r, z).
Since I was successful before with the static model (only f(r, z)). So, I just defined firstly a interpolation function f (r,z) and then the new time-variant force input as a analytic function with the following expression:
I * sin(t) * f (r[m^-1],z[m^-1]) %%%% arguments: t, r, z
COMSOL complains:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Undefined variable.
- Variable: r
- Function name: F
Error in multiphysics compilation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Aren't r & z implicitly defined already when I defined the interpolation function and checked "Use space coordinates as arguments"? Do I need to explicitly define them again somewhere else?
So I changed the expression:
I * sin(t) * f %%%%% argument: t
COMSOL complains again:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Undefined variable.
- Variable: f
- Function name: F
Error in multiphysics compilation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Now, this time COMSOL can not recognize the interpolation function f...
Thank you in advance!
Best,
Xiao
1 Reply Last Post Mar 26, 2012, 5:51 p.m. EDT