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
Jul 5, 2010, 1:25 a.m. EDT
Hi
I suppose you should understand this as "any field in COMSOl can be used for an eqution/ a function so if you define your force as F(x,y) (instead of a constant like juts 10[N]) via a mapping function you should have a Force field ready
But try to make it sufficiently smooth so that the solver manages to follow
Good luck
Ivar
Hi
I suppose you should understand this as "any field in COMSOl can be used for an eqution/ a function so if you define your force as F(x,y) (instead of a constant like juts 10[N]) via a mapping function you should have a Force field ready
But try to make it sufficiently smooth so that the solver manages to follow
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Jul 5, 2010, 4:04 a.m. EDT
Hi Ivar,
Thanks for your reply. What I have calculated using MATLAB is a force filed induced by focusing an ultrasound beam. I guess one way would be to do what you suggested but I would need to think about how to put it into equations.
But since I have it simulated in MATLAB, do you know how to save that matrix as a txt file and import into Comsol as the applied force?
Many thanks
Brian
Hi Ivar,
Thanks for your reply. What I have calculated using MATLAB is a force filed induced by focusing an ultrasound beam. I guess one way would be to do what you suggested but I would need to think about how to put it into equations.
But since I have it simulated in MATLAB, do you know how to save that matrix as a txt file and import into Comsol as the applied force?
Many thanks
Brian
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 12, 2010, 12:01 a.m. EST
Hi Brian,
Did you ever figure this out? I am trying to do a very similar thing.
Thanks,
Hi Brian,
Did you ever figure this out? I am trying to do a very similar thing.
Thanks,
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 12, 2010, 12:55 a.m. EST
a working way to do this is defines a GLOBAL matlab function F(x,y) and call it where you need in your model .
it it is very simple.
Just be CAREFUL in reading comsol guidelines about matlab function to be used by Comsol....EVERY word matters there and if these guidelines are not followed the call will not work properly ....
if you have a tabulated set of precalculated value matlab provides you with interp.... functions that are already vectorized...
so your functions should just call matlab interpolation funciton to work on your data file and return a calculated value fe each x,y
This work [ in 4.0a ].. I use it.[ almost] everyday..
but again be careful about coding of F it need to be a vectorized function as explained in the guidelines aforementionned
jf
a working way to do this is defines a GLOBAL matlab function F(x,y) and call it where you need in your model .
it it is very simple.
Just be CAREFUL in reading comsol guidelines about matlab function to be used by Comsol....EVERY word matters there and if these guidelines are not followed the call will not work properly ....
if you have a tabulated set of precalculated value matlab provides you with interp.... functions that are already vectorized...
so your functions should just call matlab interpolation funciton to work on your data file and return a calculated value fe each x,y
This work [ in 4.0a ].. I use it.[ almost] everyday..
but again be careful about coding of F it need to be a vectorized function as explained in the guidelines aforementionned
jf
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 19, 2012, 1:30 a.m. EST
Mr. Leon,
Are you saying that you can use MATLAB to find interpolated function for the force matrix? Then use that function in COMSOL? Thanks.
--
Austin Roth
Mr. Leon,
Are you saying that you can use MATLAB to find interpolated function for the force matrix? Then use that function in COMSOL? Thanks.
--
Austin Roth