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.

extracting results from COMSOL using livelink for matlab

Please login with a confirmed email address before reporting spam

Hi everyone~
It is trying to do shape optimization involving stationary analysis. The code of optimization method was written by Matlab, and it needs to receive the simulation results from the COMSOL.
For example, in the case study of "Multistudy optimization of bracket", I want to extract the max stress value from the COMSOL using matlab, however I found the result was wrong. Does anyone know why?
Many thanks!


Matlab code :

model = mphload('multistudy_bracket_optimization');%load the model

x=[11.8 2.7 9.0 22.3 9.5 20];% parameters

model.param.set('rC', x(1,1), 'Radius of central hole');
model.param.set('zCo', x(1,2), 'Distance from bend to bottom of central hole');
model.param.set('rO', x(1,3), 'Radius of outer holes');
model.param.set('zOo', x(1,4), 'Distance from bend to bottom of outer hole');
model.param.set('yOo', x(1,5), 'Distance from edge to outer hole');
model.param.set('wInd', x(1,6), 'Width of indentation');
model.hist.disable;

model.sol('sol2').runAll;
Max_Stress = mphglobal(model,{'maxop1(solid.mises)'}); % get the max stress value


0 Replies Last Post 21 mar 2017, 03:23 GMT-4
COMSOL Moderator

Hello Jin Yi

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.

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.