mphmodellibrary %open the model library
model = mphload('Stationary_model.mph'); %載入名為Stationary_model.mph的模型
mphgeom(model , 'geom1') %顯示幾何模型
mphmesh(model , 'mesh') %顯示划分網格
mphplot(model , 'pg1') %顯示最終結果
model.physics('ht').feature('hf1').set('q0', 1, q0S(i)); %修改模型邊界條件q0
model.param.set('a', a); %修改模型變量a
model.sol('sol1').run; % 計算模型
%提取坐標為list上的溫度值,單位為攝氏度,list
T = mphinterp(model,{'T'},...
'coord',list,...
'unit',{'degC'});
ModelUtil.remove('model'); % 從服務器中移除模型
參考網址:
COMSOL中國 工程師(天樂樹的博客):http://blog.sina.com.cn/s/articlelist_1242205021_8_1.html http://blog.sina.com.cn/mxio
Comsol with Matlab Quick Started (1-2):http://blog.sina.com.cn/s/blog_4a0a8b5d0101lmsj.html http://blog.sina.com.cn/s/blog_4a0a8b5d0101ltu6.html
Comsol with Matlab 應用實例(1-4可從上下篇中找到):http://blog.sina.com.cn/s/blog_4a0a8b5d0101lnwf.html
COMSOL SERVER安裝:http://blog.sina.com.cn/s/blog_4a0a8b5d0102xdna.html