comsol model to matlab function

조회 수: 42 (최근 30일)
george veropoulos
george veropoulos 2016년 7월 11일
답변: Suresh Palani 2019년 8월 7일
I have a comsol model with various inpute parameters and output the variable Te, Tl it is possible to make a matlab function based in comsol model... ? thank you George

답변 (2개)

Suresh Palani
Suresh Palani 2019년 8월 7일
Hi,
I am not sure if you have figured out the solution to your query. In case if you haven't.
If your output is "alpha" and the function with the comsol model is "Objfun".
If your input variables are x,y,z......
Then in your main script
model = mphload('File name');
mphlaunch(model);
x='value';y='value';z='value' (Note x,y,z can be a vector too)
alpha = Objfun(x,y,z,...,model);
Then in your function script
function alpha = Objfun(x,y,z,...,model)
...........
model.param.set('parameter name', x);
model.param.set('parameter name', y);
model.param.set('parameter name', z);
...........
end

argo yang
argo yang 2018년 8월 29일
you can use the following command to load a comsol model into matlab in Comsol with matlab model = mphload('test_rec.mph')

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by