フィルターのクリア

Output Comsol result from Matlab

30 ビュー (過去 30 日間)
SAMUEL AYINDE
SAMUEL AYINDE 2017 年 5 月 30 日
編集済み: Shengjiang QUAN 2022 年 8 月 19 日
Please help: I have a model in Comsol. I want to output y displacement result at some points [73 74 113 114 151 154 191 194 229 234 269] in the model. But the code is outputing the displacement in the entire domain.
model.result.create('pg5', 'PlotGroup1D');
model.result('pg5').run;
model.result('pg5').create('ptgr1', 'PointGraph');
model.result('pg5').feature('ptgr1').selection.set([73 74 113 114 151 154 191 194 229 234 269]);
model.result('pg5').feature('ptgr1').set('expr', 'v');
model.result('pg5').feature('ptgr1').set('descr', 'Displacement field, Y component');
model.result('pg5').run;
model.result.export.create('data1', 'Data');
model.result.export('data1').set('expr', {'v'});
model.result.export('data1').set('descr', {'descr', 'Displacement field, Y component'});
model.result.export('data1').set('filename', 'xl_disp.txt');
model.result.export('data1').run;
pause(2)
load xl_disp.txt
save('xl_disp','xl_disp')
load('xl_disp','-mat','xl_disp')
Also, I tried this:
mpheval(model, 'expr', 'v', '[73 74 113 114 151 154 191 194 229 234 269]')
But it did not work.
Thank you.
  1 件のコメント
Shengjiang QUAN
Shengjiang QUAN 2022 年 8 月 19 日
編集済み: Shengjiang QUAN 2022 年 8 月 19 日
This is a 5-year late reply. Just record here for newcomers.
TL;DR
Use command `mphinterp`.
u=mphinterp(model,'u','dataset','cpt1');
Details
I encountered the same problem at the day of writing. In my case, I need the displacement components (u and v) at pre-defined 3D cut points with tag "cpt1". As shown in this figure.
Please pay attention to the first entry of `Properties`. This means that the results of `cpt1` dataset would be calculated based on `dset2`. And the results of `dset2` is calculated by keypoints generated by meshgrid. Please check this video to see more details.
And the method to calculate `cpt1` based on `dset2` is -- interpolation.
Thank you.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by