Download LiveLink for MATLAB User's Guide

Transcript
mphinputmatrix
Note: The system matrices are not stored in the model when it is saved as a
MPH-file or loaded into the COMSOL Desktop.
Example
Load the model model_tutorial_llmatlab.mph:
model = mphload('model_tutorial_llmatlab.mph');
Add a stationary study step and a solver configuration:
std1 = model.study.create('std1');
std1.feature.create('stat','Stationary');
sol1 = model.sol.create('sol1');
sol1.study('std1');
Extract the linear stationary matrix system in MATLAB:
str = mphmatrix(model,'sol1','out',{'K','L','M','N',},...
'initmethod','sol','initsol','zero');
Change the linear system by scaling the stiffness matrix:
str.K = str.K*0,1;
Set-up the solver configuration for a stationary problem:
st1 = sol1.feature.create('st1','StudyStep');
st1.set('studystep','stat');
sol1.feature.create('s1','Stationary');
Insert the system matrix back to the model:
mphinputmatrix(model,str,'sol1','s1');
Run the solver configuration:
model.sol('sol1').runAll;
See also
218 |
mphmatrix, mphxmeshinfo
CHAPTER 6: COMMAND REFERENCE