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.
Evaluate parameter value in MATLAB
Posted 2010/11/11 7:15 GMT-5 Interfacing Version 4.3a 8 Replies
Please login with a confirmed email address before reporting spam
If I have a parameter, e.g.:
>> model.param.set('outer_z', '((volume*formfactor^2)/(2*pi))^(1/3)');
How can I in the easiest way evaluate the value of this parameter (like the 'Value'-column in the GUI)?
I get an error message when trying to use:
>> mphglobal(model,'outer_z')
"com.comsol.util.exceptions.FlException: Unknown dataset feature"
Regards,
Johan
Hello Johan Gustafsson
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Johan
Please login with a confirmed email address before reporting spam
Hi,
If I have a parameter, e.g.:
>> model.param.set('outer_z', '((volume*formfactor^2)/(2*pi))^(1/3)');
How can I in the easiest way evaluate the value of this parameter (like the 'Value'-column in the GUI)?
I get an error message when trying to use:
>> mphglobal(model,'outer_z')
"com.comsol.util.exceptions.FlException: Unknown dataset feature"
Regards,
Johan
The function mphglobal(model,'parameter_name') works for me when calculating parameter values. Maybe there is a problem in your definition of ((volume*formfactor^2)/(2*pi))^(1/3), check that all the parameters are set.
Bye.
Please login with a confirmed email address before reporting spam
Sorry for bring back such an old discussion but I'm having the same problem (unknown data set). I think this problem somehow relates to having not initialized the model (but I'm not sure how). Since it cannot find a dataset to evaluate the string in. Anyone know what I'm missing? Consider the simple striped down MATLAB script below which returns the same error. Interestingly enough model.param.get('test_param_a') will return the original string.
Thanks in advance,
Andrew
import com.comsol.model.*
import com.comsol.model.util.*
model = ModelUtil.create('Model');
model.modelPath('F:\FAST\MATLAB');
model.modelNode.create('mod1');
model.geom.create('geom1', 2);
model.geom('geom1').axisymmetric(true);
model.mesh.create('mesh1', 'geom1');
model.param.set('test_param_a', '1[mm]');
temp = mphglobal(model,'test_param_a')
Please login with a confirmed email address before reporting spam
Hi,
If I have a parameter, e.g.:
>> model.param.set('outer_z', '((volume*formfactor^2)/(2*pi))^(1/3)');
How can I in the easiest way evaluate the value of this parameter (like the 'Value'-column in the GUI)?
I get an error message when trying to use:
>> mphglobal(model,'outer_z')
"com.comsol.util.exceptions.FlException: Unknown dataset feature"
Regards,
Johan
I'm also having the same problem, has anyone figured this out?
Thanks,
Mark
Please login with a confirmed email address before reporting spam
pellet_length = mphevalglobalmatrix(model,'pellet_length');
Not sure if this applies only to parameters, or if there is a better way of doing this, but it worked for me.
Please login with a confirmed email address before reporting spam
It has been a while since I worked with the LiveLink for Matlab. To get a parameter (pellet_length) from Comsol to Matlab I used the following commmand:
pellet_length = mphevalglobalmatrix(model,'pellet_length');
Not sure if this applies only to parameters, or if there is a better way of doing this, but it worked for me.
Andrew. Thanks a lot! It turns out that I was able to get
mphglobal(model,'outer_z')
to work too. So it appears I'm in good shape now.
Thanks!
Mark
Please login with a confirmed email address before reporting spam
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.
Suggested Content
- BLOG Maximum Evaluations on Parallel Sections
- BLOG Exploiting Periodicity in Models with High Péclet Numbers
- FORUM Matlab Link plot result with maximun parameter value
- KNOWLEDGE BASE Error: Failed to compute elastoplastic strain variables
- BLOG A Practical Implementation of Multiphysics Topology Optimization
