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.
point evaluation by Matlab
Posted 14 févr. 2011, 07:43 UTC−5 Low-Frequency Electromagnetics Version 4.2, Version 4.3a, Version 4.3b 4 Replies
Please login with a confirmed email address before reporting spam
Hello comsol users,
I am working on a model of electromagnetic actuator and now I am about to use the matlab livelink for further calcualtions and have issues with evaluating data. User guide offers some info about some commands e.g. mpheval, mphglobal.
First I tried to evaluate the electromagnetic force on an object by a variable (var_force_comsol=mf.Forcez_objekt).
I defined this variable in my comsol model and saved it as m-file. By the way it is always a got idea to clear the model history before saving it as m-file. Otherwise you get a matlab script of the model history and not of the model itself and you might get several sites of unrelevant confusing data. Cost me several hours to find the simple solution for that :)
Back to evaluation of data:
After several trial and erros of a global evaluation I finally had success using the mphglobal command as follows:
var_force_matlab = mphglobal(model,'var_force_comsol');
If somebody thinks that was not that difficult, then maybe he/she can help me with the point evaluation? please?
In this case I first added in my axisymmetric comsol model a cutpoint2D standardly named (tag name) 'cpt1' (Model->Results->Datasets) and defined the coordinates of it. Then I added a point evaluation standardly named (tag name) 'pev1' (Model->Results->Derived values) and defined the expression to evaluate (in my case radial flux density 'mf.Br'). Then clearing history and saving model as m-file.
Now the user guide offers the mpheval command for the purpose to evaluate expressions of so called datasets e.g. points, line,etc. but with followig command mpheval(model, 'mf.Br','Dataset','cpt1') I get an error message that the Dataset is not valid. Not using a Dataset results in getting evaluated data of many points (so called node points due to user guide) but not from the one i want to. The mpheval isn´t working with the comsol created point evaluation 'pev1' either. So I am perplexed.
I am trying to find a solution myself for a couples of days and still trying... drives me crazy. Please help!
Sincerely
Oliver
I am working on a model of electromagnetic actuator and now I am about to use the matlab livelink for further calcualtions and have issues with evaluating data. User guide offers some info about some commands e.g. mpheval, mphglobal.
First I tried to evaluate the electromagnetic force on an object by a variable (var_force_comsol=mf.Forcez_objekt).
I defined this variable in my comsol model and saved it as m-file. By the way it is always a got idea to clear the model history before saving it as m-file. Otherwise you get a matlab script of the model history and not of the model itself and you might get several sites of unrelevant confusing data. Cost me several hours to find the simple solution for that :)
Back to evaluation of data:
After several trial and erros of a global evaluation I finally had success using the mphglobal command as follows:
var_force_matlab = mphglobal(model,'var_force_comsol');
If somebody thinks that was not that difficult, then maybe he/she can help me with the point evaluation? please?
In this case I first added in my axisymmetric comsol model a cutpoint2D standardly named (tag name) 'cpt1' (Model->Results->Datasets) and defined the coordinates of it. Then I added a point evaluation standardly named (tag name) 'pev1' (Model->Results->Derived values) and defined the expression to evaluate (in my case radial flux density 'mf.Br'). Then clearing history and saving model as m-file.
Now the user guide offers the mpheval command for the purpose to evaluate expressions of so called datasets e.g. points, line,etc. but with followig command mpheval(model, 'mf.Br','Dataset','cpt1') I get an error message that the Dataset is not valid. Not using a Dataset results in getting evaluated data of many points (so called node points due to user guide) but not from the one i want to. The mpheval isn´t working with the comsol created point evaluation 'pev1' either. So I am perplexed.
I am trying to find a solution myself for a couples of days and still trying... drives me crazy. Please help!
Sincerely
Oliver
4 Replies Last Post 7 mai 2012, 23:03 UTC−4