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.
Comsol with Matlab? How to write functions from COMSOL model m files?(Diffusion)
Posted 2009年10月20日 GMT-4 01:40 1 Reply
Please login with a confirmed email address before reporting spam
I have a Comsol model m file and I want to convert it to a function m file. I am using diffusion application mode and my diffusion coefficient is a function of concentration.
D=D1*exp(-B*(1-c/10))
In my model m file ;
eq.D='D1*exp(-B*(1-c/10))'
In the function m file I would like to input 'D1 and B1' as inputs. However since it is a string defined in eq.D the function input parameters are not recognised.
My question is that :
How can I convert the model m file to a function m file such that my parameters in the diffusion coefficient will be recognised as inputs in the function?
Thanks a lot
Mecit
D=D1*exp(-B*(1-c/10))
In my model m file ;
eq.D='D1*exp(-B*(1-c/10))'
In the function m file I would like to input 'D1 and B1' as inputs. However since it is a string defined in eq.D the function input parameters are not recognised.
My question is that :
How can I convert the model m file to a function m file such that my parameters in the diffusion coefficient will be recognised as inputs in the function?
Thanks a lot
Mecit
1 Reply Last Post 2009年10月20日 GMT-4 12:18