Hello everyone,
I'm simulating a mold where there is heat flux on different circles (cf picture).
I would like to have an homogenous temperature on the surface of the mold. That is to say, minimize the difference of temperatures between the left side and the right side. For this optimization, my parameters are the position of the circles (named e1, e2, e3... e7).
I have decided to use the function 'fminsearch' this way :
. Function which allows me to have the difference of temperatures
function Temp=opt_chauffe(e1,e2,e3,e4,e5,e6,e7)
model=model2
Temp=Temp1-Temp2;
end function
. function fminsearch :
fminsearch(opti_chauffe,[0.05, 0.12, 0.16, 0.22, 0.24, 0.26, 0.27]);
1) First of all, my function 'opt_chauffe' doesn't work
Indeed, I have this error :
??? Undefined function or variable 'e1'.
Error in ==> model2 at 71
model.geom('geom1').feature('c2').set('pos', [e1 0]);
Error in ==> opt_chauffe at 3
model=model2
-> So I think that my model doesn't recognize the matlab variable of my function. How can I solve it?
2)I don't know if the function 'fminseach' is a good way to solve this problem. Can you help me?
Thank you
Best regards
Yoan
I'm simulating a mold where there is heat flux on different circles (cf picture).
I would like to have an homogenous temperature on the surface of the mold. That is to say, minimize the difference of temperatures between the left side and the right side. For this optimization, my parameters are the position of the circles (named e1, e2, e3... e7).
I have decided to use the function 'fminsearch' this way :
. Function which allows me to have the difference of temperatures
function Temp=opt_chauffe(e1,e2,e3,e4,e5,e6,e7)
model=model2
Temp=Temp1-Temp2;
end function
. function fminsearch :
fminsearch(opti_chauffe,[0.05, 0.12, 0.16, 0.22, 0.24, 0.26, 0.27]);
1) First of all, my function 'opt_chauffe' doesn't work
Indeed, I have this error :
??? Undefined function or variable 'e1'.
Error in ==> model2 at 71
model.geom('geom1').feature('c2').set('pos', [e1 0]);
Error in ==> opt_chauffe at 3
model=model2
-> So I think that my model doesn't recognize the matlab variable of my function. How can I solve it?
2)I don't know if the function 'fminseach' is a good way to solve this problem. Can you help me?
Thank you
Best regards
Yoan