function out = model % % damp1.m % % Model exported on Oct 2 2012, 20:47 by COMSOL 4.3.0.151. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); % model.modelPath('C:\Users\ryan\Desktop\manu'); % % model.name('damp.mph'); model.modelNode.create('mod1'); model.modelNode('mod1').baseSystem('none'); model.variable.create('var1'); model.variable('var1').model('mod1'); model.variable('var1').set('r', 'u'); model.physics.create('ge', 'GlobalEquations'); model.variable('var1').name('Variables 1a'); model.physics('ge').feature('ge1').set('name', {'u'; 'w'}); model.physics('ge').feature('ge1').set('equation', {'ut-w'; 'wt+0.4*w+4.5*u'}); model.physics('ge').feature('ge1').set('initialValueU', {'1'; '0'}); model.physics('ge').feature('ge1').set('initialValueUt', {'0'; '0'}); model.physics('ge').feature('ge1').set('description', {''; ''}); model.study.create('std1'); model.study('std1').feature.create('time', 'Transient'); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.sol('sol1').attach('std1'); model.sol('sol1').feature.create('st1', 'StudyStep'); model.sol('sol1').feature.create('v1', 'Variables'); model.sol('sol1').feature.create('t1', 'Time'); model.sol('sol1').feature('t1').feature.create('fc1', 'FullyCoupled'); model.sol('sol1').feature('t1').feature.remove('fcDef'); model.result.numerical.create('gev1', 'EvalGlobal'); model.result.numerical('gev1').set('probetag', 'none'); model.result.numerical.create('gev2', 'EvalGlobal'); model.result.numerical('gev2').set('probetag', 'none'); model.result.numerical.create('gev3', 'EvalGlobal'); model.result.numerical('gev3').set('probetag', 'none'); model.result.numerical.create('gev4', 'EvalGlobal'); model.result.numerical('gev4').set('probetag', 'none'); model.result.create('pg1', 'PlotGroup1D'); model.result('pg1').set('probetag', 'none'); model.result('pg1').feature.create('glob1', 'Global'); model.study('std1').feature('time').set('tlist', 'range(0,0.1,10)'); model.sol('sol1').attach('std1'); model.sol('sol1').feature('st1').name('Compile Equations: Time Dependent'); model.sol('sol1').feature('st1').set('studystep', 'time'); model.sol('sol1').feature('v1').set('control', 'time'); model.sol('sol1').feature('t1').set('control', 'time'); model.sol('sol1').feature('t1').set('tlist', 'range(0,0.1,10)'); model.sol('sol1').runAll; model.result.numerical('gev1').name('State variable u'); model.result.numerical('gev2').name('State variable w'); model.result.numerical('gev2').set('expr', 'mod1.w'); model.result.numerical('gev2').set('descr', 'State variable w'); model.result.numerical('gev3').name('State variable u 1'); model.result.numerical('gev4').name('State variable w 1'); model.result.numerical('gev4').set('expr', 'mod1.w'); model.result.numerical('gev4').set('descr', 'State variable w'); model.result('pg1').set('xlabel', 'Time'); model.result('pg1').set('xlabelactive', false); model.result('pg1').feature('glob1').set('expr', {'mod1.r' 'mod1.u' 'mod1.w'}); model.result('pg1').feature('glob1').set('unit', {'' '' ''}); model.result('pg1').feature('glob1').set('descr', {'' 'State variable u' 'State variable w'}); out = model;