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+Matlab

Please login with a confirmed email address before reporting spam

Hi Everyone.

I have some problem running the genetic algorithm in matlab.

I allready solved a model in comsol and I saved it as MPH file.then I run comsol with matlab.the thing I want to do is to use the genetic tool in matlab to change one of my parameters (Hight),then run my model(solve it) and find the maximum of 'total heat flux magnitude'.

so i wrote a .m file like this

function z = jet(h)
model = mphload('jet');
model.param.set('H',h);
model.study('std1').run;
q = mpheval(model,'ht.tefluxMag');
z = q;
end

then I load it in genetic tool in matlab as fitness function.but it always has some error

0 Replies Last Post 22 set 2014, 04:46 GMT-4
COMSOL Moderator

Hello Soheil Asadi

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.