Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 428

extracting results from COMSOL using livelink for matlab

$
0
0
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


Viewing all articles
Browse latest Browse all 428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>