% function out = model % % coxial.m % % Model exported on Nov 25 2015, 02:44 by COMSOL 5.1.0.234. clear all clc import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('C:\Users\mzs1401\Desktop\danielsent'); model.comments(['Untitled\n\n']); model.modelNode.create('comp1'); model.geom.create('geom1', 2); model.mesh.create('mesh1', 'geom1'); model.physics.create('es', 'Electrostatics', 'geom1'); model.study.create('std1'); model.study('std1').create('stat', 'Stationary'); model.study('std1').feature('stat').activate('es', true); model.param.set('R1', '1'); model.param.set('R2', '0.3'); model.param.set('V1', '0'); model.param.set('V2', '1'); model.geom('geom1').create('c1', 'Circle'); model.geom('geom1').feature('c1').set('r', 'R1'); model.geom('geom1').run('c1'); model.geom('geom1').create('c2', 'Circle'); model.geom('geom1').feature('c2').set('r', 'R2'); model.geom('geom1').run('c2'); model.geom('geom1').create('dif1', 'Difference'); model.geom('geom1').feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('dif1').selection('input2').set({'c2'}); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.study('std1').feature('stat').set('notlistsolnum', 1); model.study('std1').feature('stat').set('notsolnum', '1'); model.study('std1').feature('stat').set('listsolnum', 1); model.study('std1').feature('stat').set('solnum', '1'); model.sol('sol1').create('st1', 'StudyStep'); model.sol('sol1').feature('st1').set('study', 'std1'); model.sol('sol1').feature('st1').set('studystep', 'stat'); model.sol('sol1').create('v1', 'Variables'); model.sol('sol1').feature('v1').set('control', 'stat'); model.sol('sol1').create('s1', 'Stationary'); model.sol('sol1').feature('s1').create('fc1', 'FullyCoupled'); model.sol('sol1').feature('s1').feature('fc1').set('linsolver', 'dDef'); model.sol('sol1').feature('s1').feature.remove('fcDef'); model.sol('sol1').attach('std1'); model.result.create('pg1', 'PlotGroup2D'); model.result('pg1').label('Electric Potential (es)'); model.result('pg1').set('oldanalysistype', 'noneavailable'); model.result('pg1').set('frametype', 'spatial'); model.result('pg1').set('data', 'dset1'); model.result('pg1').feature.create('surf1', 'Surface'); model.result('pg1').feature('surf1').set('oldanalysistype', 'noneavailable'); model.result('pg1').feature('surf1').set('data', 'parent'); model.result.remove('pg1'); model.geom('geom1').runPre('fin'); model.material.create('mat1', 'Common', 'comp1'); model.material('mat1').propertyGroup('def').set('relpermittivity', {'1'}); model.physics('es').feature.create('term1', 'Terminal', 1); model.physics('es').feature.create('term2', 'Terminal', 1); model.physics('es').feature('term2').set('TerminalType', 'Voltage'); model.physics('es').feature('term2').set('V0', 'V2'); model.physics('es').feature('term2').selection.set([3 4 6 7]); model.physics('es').feature('term1').set('TerminalType', 'Voltage'); model.physics('es').feature('term1').set('V0', 'V1'); model.physics('es').feature('term1').selection.set([1 2 5 8]); model.sol('sol1').study('std1'); model.study('std1').feature('stat').set('notlistsolnum', 1); model.study('std1').feature('stat').set('notsolnum', '1'); model.study('std1').feature('stat').set('listsolnum', 1); model.study('std1').feature('stat').set('solnum', '1'); model.sol('sol1').feature.remove('s1'); model.sol('sol1').feature.remove('v1'); model.sol('sol1').feature.remove('st1'); model.sol('sol1').create('st1', 'StudyStep'); model.sol('sol1').feature('st1').set('study', 'std1'); model.sol('sol1').feature('st1').set('studystep', 'stat'); model.sol('sol1').create('v1', 'Variables'); model.sol('sol1').feature('v1').set('control', 'stat'); model.sol('sol1').create('s1', 'Stationary'); model.sol('sol1').feature('s1').create('fc1', 'FullyCoupled'); model.sol('sol1').feature('s1').feature('fc1').set('linsolver', 'dDef'); model.sol('sol1').feature('s1').feature.remove('fcDef'); model.sol('sol1').attach('std1'); model.result.create('pg1', 'PlotGroup2D'); model.result('pg1').label('Electric Potential (es)'); model.result('pg1').set('oldanalysistype', 'noneavailable'); model.result('pg1').set('solvertype', 'none'); model.result('pg1').set('showlooplevel', {'off' 'off' 'off'}); model.result('pg1').set('frametype', 'spatial'); model.result('pg1').set('data', 'dset1'); model.result('pg1').feature.create('surf1', 'Surface'); model.result('pg1').feature('surf1').set('oldanalysistype', 'noneavailable'); model.result('pg1').feature('surf1').set('solvertype', 'none'); model.result('pg1').feature('surf1').set('data', 'parent'); model.sol('sol1').runAll; model.result('pg1').run; model.probe.create('dom1', 'Domain'); model.probe('dom1').model('comp1'); model.probe('dom1').set('type', 'maximum'); model.probe('dom1').set('descr', 'Electric potential Electric field norm'); model.probe('dom1').set('expr', 'es.normE'); model.sol('sol1').study('std1'); model.study('std1').feature('stat').set('notlistsolnum', 1); model.study('std1').feature('stat').set('notsolnum', '1'); model.study('std1').feature('stat').set('listsolnum', 1); model.study('std1').feature('stat').set('solnum', '1'); model.sol('sol1').feature.remove('s1'); model.sol('sol1').feature.remove('v1'); model.sol('sol1').feature.remove('st1'); model.sol('sol1').create('st1', 'StudyStep'); model.sol('sol1').feature('st1').set('study', 'std1'); model.sol('sol1').feature('st1').set('studystep', 'stat'); model.sol('sol1').create('v1', 'Variables'); model.sol('sol1').feature('v1').set('control', 'stat'); model.sol('sol1').create('s1', 'Stationary'); model.sol('sol1').feature('s1').create('fc1', 'FullyCoupled'); model.sol('sol1').feature('s1').feature('fc1').set('linsolver', 'dDef'); model.sol('sol1').feature('s1').feature.remove('fcDef'); model.sol('sol1').attach('std1'); model.probe('dom1').genResult('none'); model.sol('sol1').runAll; model.result('pg1').run; Emax= model.result.numerical('max1').getReal(); % out = model;