function out = model % % example.m % % Model exported on May 3 2012, 10:49 by COMSOL 4.2.1.166. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('D:\FGregoire\Desktop'); model.modelNode.create('mod1'); model.geom.create('geom1', 1); model.geom('geom1').feature.create('i1', 'Interval'); model.geom('geom1').run; model.material.create('mat1'); model.material('mat1').propertyGroup.create('Enu', 'Young''s modulus and Poisson''s ratio'); model.material('mat1').propertyGroup.create('Murnaghan', 'Murnaghan'); model.material('mat1').propertyGroup.create('Lame', ['Lam' native2unicode(hex2dec('00e9'), 'Cp1252') ' constants']); model.material('mat1').propertyGroup.create('NeoHookean', 'Neo-Hookean'); model.physics.create('ht', 'HeatTransfer', 'geom1'); model.physics('ht').feature.create('temp1', 'TemperatureBoundary', 0); model.physics('ht').feature('temp1').selection.set([1]); model.physics('ht').feature.create('temp2', 'TemperatureBoundary', 0); model.physics('ht').feature('temp2').selection.set([2]); model.mesh.create('mesh1', 'geom1'); model.mesh('mesh1').feature.create('edg1', 'Edge'); model.view('view1').axis.set('xmin', '-0.05000000074505806'); model.view('view1').axis.set('xmax', '1.0499999523162842'); model.material('mat1').name('Aluminum'); model.material('mat1').propertyGroup('def').set('relpermeability', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat1').propertyGroup('def').set('heatcapacity', '900[J/(kg*K)]'); model.material('mat1').propertyGroup('def').set('thermalconductivity', {'160[W/(m*K)]' '0' '0' '0' '160[W/(m*K)]' '0' '0' '0' '160[W/(m*K)]'}); model.material('mat1').propertyGroup('def').set('electricconductivity', {'3.774e7[S/m]' '0' '0' '0' '3.774e7[S/m]' '0' '0' '0' '3.774e7[S/m]'}); model.material('mat1').propertyGroup('def').set('relpermittivity', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat1').propertyGroup('def').set('thermalexpansioncoefficient', {'23e-6[1/K]' '0' '0' '0' '23e-6[1/K]' '0' '0' '0' '23e-6[1/K]'}); model.material('mat1').propertyGroup('def').set('density', '2700[kg/m^3]'); model.material('mat1').propertyGroup('Enu').set('youngsmodulus', '70e9[Pa]'); model.material('mat1').propertyGroup('Enu').set('poissonsratio', '0.33'); model.material('mat1').propertyGroup('Murnaghan').set('l', '-2.5e11[Pa]'); model.material('mat1').propertyGroup('Murnaghan').set('m', '-3.3e11[Pa]'); model.material('mat1').propertyGroup('Murnaghan').set('n', '-3.5e11[Pa]'); model.material('mat1').propertyGroup('Murnaghan').set('lambLame', '5.1e10[Pa]'); model.material('mat1').propertyGroup('Murnaghan').set('muLame', '2.6e10[Pa]'); model.material('mat1').propertyGroup('Lame').set('lambLame', '5.1e10[Pa]'); model.material('mat1').propertyGroup('Lame').set('muLame', '2.6e10[Pa]'); model.material('mat1').propertyGroup('NeoHookean').set('mu', '2.6e10[Pa]'); model.material('mat1').propertyGroup('NeoHookean').set('lambda', '5.1e10[Pa]'); model.physics('ht').feature('temp1').set('T0', '293.15[K]+t[K/s]'); model.mesh('mesh1').feature('size').set('hauto', 1); model.mesh('mesh1').run; 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.create('d1', 'Direct'); model.sol('sol1').feature('t1').feature.remove('fcDef'); model.result.create('pg1', 'PlotGroup1D'); model.result('pg1').set('probetag', 'none'); model.result('pg1').feature.create('lngr1', 'LineGraph'); model.result('pg1').feature('lngr1').selection.all; model.study('std1').feature('time').set('tlist', 'range(0,1,100)'); 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,1,100)'); model.sol('sol1').feature('t1').set('maxorder', '2'); model.sol('sol1').feature('t1').feature('fc1').set('maxiter', '5'); model.sol('sol1').feature('t1').feature('fc1').set('jtech', 'once'); model.sol('sol1').feature('t1').feature('d1').set('linsolver', 'pardiso'); model.result('pg1').name('Temperature (ht)'); model.result('pg1').set('xlabel', 'x-coordinate (m)'); model.result('pg1').set('ylabel', 'Temperature (K)'); model.result('pg1').set('xlabelactive', false); model.result('pg1').set('ylabelactive', false); model.result('pg1').feature('lngr1').set('xdata', 'expr'); model.result('pg1').feature('lngr1').set('xdataexpr', 'x'); model.result('pg1').feature('lngr1').set('xdataunit', 'm'); model.result('pg1').feature('lngr1').set('xdatadescr', 'x-coordinate'); out = model;