function out = model % % faster.m % % Model exported on Jul 14 2017, 14:47 by COMSOL 5.2.1.262. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('/Applications/COMSOL52a/Multiphysics/mli'); model.label('faster.mph'); model.comments(['untitled\n\n']); model.param.set('gap', '1 [mm]'); model.param.set('arm_w', '.3 [mm]'); model.param.set('arm_l', '18 [mm]'); model.param.set('base_w', '1 [mm]'); model.param.set('base_l', '24 [mm]'); model.param.set('thick', '.1 [mm]'); model.param.set('n_armt', '9'); model.param.set('n_armb', '10'); model.modelNode.create('comp1'); model.geom.create('geom1', 3); model.mesh.create('mesh1', 'geom1'); model.geom('geom1').lengthUnit('mm'); model.geom('geom1').create('blk1', 'Block'); model.geom('geom1').feature('blk1').label('Arm Bottom'); model.geom('geom1').feature('blk1').set('size', {'arm_w' 'thick' 'arm_l'}); model.geom('geom1').create('blk2', 'Block'); model.geom('geom1').feature('blk2').label('Arm Top'); model.geom('geom1').feature('blk2').set('pos', {'1.3' '0' '2.2'}); model.geom('geom1').feature('blk2').set('size', {'arm_w' 'thick' 'arm_l'}); model.geom('geom1').create('arr1', 'Array'); model.geom('geom1').feature('arr1').label('Bottom'); model.geom('geom1').feature('arr1').set('type', 'linear'); model.geom('geom1').feature('arr1').set('displ', {'2.6' '0' '0'}); model.geom('geom1').feature('arr1').set('size', 'n_armb'); model.geom('geom1').feature('arr1').selection('input').set({'blk1'}); model.geom('geom1').create('arr2', 'Array'); model.geom('geom1').feature('arr2').label('Top'); model.geom('geom1').feature('arr2').set('type', 'linear'); model.geom('geom1').feature('arr2').set('displ', {'2.6' '0' '0'}); model.geom('geom1').feature('arr2').set('size', 'n_armt'); model.geom('geom1').feature('arr2').selection('input').set({'blk2'}); model.geom('geom1').create('blk3', 'Block'); model.geom('geom1').feature('blk3').label('Base Top'); model.geom('geom1').feature('blk3').set('pos', {'0' '0' '-.5'}); model.geom('geom1').feature('blk3').set('size', {'base_l' 'thick' 'base_w'}); model.geom('geom1').create('blk4', 'Block'); model.geom('geom1').feature('blk4').label('Base Bottom'); model.geom('geom1').feature('blk4').set('pos', {'0' '0' '19.7'}); model.geom('geom1').feature('blk4').set('size', {'base_l' 'thick' 'base_w'}); model.geom('geom1').create('uni1', 'Union'); model.geom('geom1').feature('uni1').set('intbnd', false); model.geom('geom1').feature('uni1').selection('input').set({'arr1' 'blk3'}); model.geom('geom1').create('uni2', 'Union'); model.geom('geom1').feature('uni2').set('intbnd', false); model.geom('geom1').feature('uni2').selection('input').set({'arr2' 'blk4'}); model.geom('geom1').create('mov1', 'Move'); model.geom('geom1').feature('mov1').set('displx', ''); model.geom('geom1').feature('mov1').set('displz', '-10'); model.geom('geom1').feature('mov1').selection('input').set({'uni1' 'uni2'}); model.geom('geom1').create('cyl1', 'Cylinder'); model.geom('geom1').feature('cyl1').label('Sample'); model.geom('geom1').feature('cyl1').set('axis', {'0' '1' '0'}); model.geom('geom1').feature('cyl1').set('pos', {'37' '1' '0'}); model.geom('geom1').feature('cyl1').set('r', '75/2'); model.geom('geom1').create('blk5', 'Block'); model.geom('geom1').feature('blk5').label('Domain'); model.geom('geom1').feature('blk5').set('pos', {'-38' '-5' '-75'}); model.geom('geom1').feature('blk5').set('size', {'150' '20' '150'}); model.geom('geom1').create('blk6', 'Block'); model.geom('geom1').feature('blk6').set('pos', {'-.5' '-1' '-11.5'}); model.geom('geom1').feature('blk6').set('size', {'25' '4' '23'}); model.geom('geom1').create('rot1', 'Rotate'); model.geom('geom1').feature('rot1').set('axis', {'1' '0' '0'}); model.geom('geom1').feature('rot1').set('rot', '90'); model.geom('geom1').feature('rot1').selection('input').set({'blk5' 'blk6' 'cyl1' 'mov1'}); model.geom('geom1').create('mov2', 'Move'); model.geom('geom1').feature('mov2').set('displx', '-37.5'); model.geom('geom1').feature('mov2').selection('input').set({'rot1'}); model.geom('geom1').create('pard1', 'PartitionDomains'); model.geom('geom1').feature('pard1').set('partitionwith', 'objects'); model.geom('geom1').feature('pard1').selection('domain').set('mov2(3)', [1]); model.geom('geom1').feature('pard1').selection('object').set({'mov2(2)'}); model.geom('geom1').create('wp1', 'WorkPlane'); model.geom('geom1').feature('wp1').set('quickplane', 'yz'); model.geom('geom1').feature('wp1').set('unite', 'on'); model.geom('geom1').create('cmd1', 'CompositeDomains'); model.geom('geom1').feature('cmd1').selection('input').set('fin(1)', [1 2]); model.geom('geom1').create('pard2', 'PartitionDomains'); model.geom('geom1').feature('pard2').selection('domain').set('cmd1(1)', [1 5]); model.geom('geom1').run; model.view('view2').tag('view6'); model.view.create('view4', 2); model.view.create('view5', 2); model.material.create('mat1', 'Common', 'comp1'); model.material.create('mat2', 'Common', 'comp1'); model.material.create('mat3', 'Common', 'comp1'); model.material('mat1').selection.set([1 6]); model.material('mat1').propertyGroup('def').func.create('eta', 'Piecewise'); model.material('mat1').propertyGroup('def').func.create('Cp', 'Piecewise'); model.material('mat1').propertyGroup('def').func.create('rho', 'Analytic'); model.material('mat1').propertyGroup('def').func.create('k', 'Piecewise'); model.material('mat1').propertyGroup('def').func.create('cs', 'Analytic'); model.material('mat1').propertyGroup.create('RefractiveIndex', 'Refractive index'); model.material('mat2').selection.set([2 5 7]); model.material('mat2').propertyGroup.create('Enu', 'Young''s modulus and Poisson''s ratio'); model.material('mat2').propertyGroup.create('RefractiveIndex', 'Refractive index'); model.material('mat3').selection.set([3 4]); model.material('mat3').propertyGroup.create('linzRes', 'Linearized resistivity'); model.physics.create('es', 'Electrostatics', 'geom1'); model.physics('es').create('term1', 'DomainTerminal', 3); model.physics('es').feature('term1').selection.set([3]); model.physics('es').create('term2', 'DomainTerminal', 3); model.physics('es').feature('term2').selection.set([4]); model.mesh('mesh1').create('ftet2', 'FreeTet'); model.mesh('mesh1').create('ftet1', 'FreeTet'); model.mesh('mesh1').create('ftet3', 'FreeTet'); model.mesh('mesh1').feature('ftet2').selection.geom('geom1', 3); model.mesh('mesh1').feature('ftet2').selection.set([2 3 4]); model.mesh('mesh1').feature('ftet2').create('size1', 'Size'); model.mesh('mesh1').feature('ftet1').selection.geom('geom1', 3); model.mesh('mesh1').feature('ftet1').selection.set([5]); model.mesh('mesh1').feature('ftet1').create('size1', 'Size'); model.mesh('mesh1').feature('ftet3').create('size1', 'Size'); model.result.table.create('evl2', 'Table'); model.view('view1').set('locked', true); model.view('view1').set('transparency', 'on'); model.view('view4').axis.set('abstractviewrratio', '0.1457783579826355'); model.view('view4').axis.set('abstractviewlratio', '-0.0703166201710701'); model.view('view4').axis.set('abstractviewxscale', '0.05109642818570137'); model.view('view4').axis.set('abstractviewbratio', '-0.27655503153800964'); model.view('view4').axis.set('xmax', '91.13597106933594'); model.view('view4').axis.set('xmin', '-89.51692199707031'); model.view('view4').axis.set('abstractviewyscale', '0.05109643191099167'); model.view('view4').axis.set('ymax', '76.05733489990234'); model.view('view4').axis.set('ymin', '-69.75053405761719'); model.view('view4').axis.set('abstractviewtratio', '0.26078107953071594'); model.view('view5').axis.set('abstractviewrratio', '-0.4978283643722534'); model.view('view5').axis.set('abstractviewlratio', '0.16744641959667206'); model.view('view5').axis.set('abstractviewxscale', '0.07111725956201553'); model.view('view5').axis.set('abstractviewbratio', '0.36059027910232544'); model.view('view5').axis.set('xmax', '-0.17425537109375'); model.view('view5').axis.set('xmin', '-50.38303756713867'); model.view('view5').axis.set('abstractviewyscale', '0.07111725956201553'); model.view('view5').axis.set('ymax', '22.19962501525879'); model.view('view5').axis.set('ymin', '-23.058996200561523'); model.view('view5').axis.set('abstractviewtratio', '-0.3663194179534912'); model.view('view6').label('View 6'); model.material('mat1').label('Air'); model.material('mat1').set('family', 'air'); model.material('mat1').propertyGroup('def').func('eta').set('pieces', {'200.0' '1600.0' '-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4'}); model.material('mat1').propertyGroup('def').func('eta').set('arg', 'T'); model.material('mat1').propertyGroup('def').func('Cp').set('pieces', {'200.0' '1600.0' '1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4'}); model.material('mat1').propertyGroup('def').func('Cp').set('arg', 'T'); model.material('mat1').propertyGroup('def').func('rho').set('args', {'pA' 'T'}); model.material('mat1').propertyGroup('def').func('rho').set('expr', 'pA*0.02897/8.314/T'); model.material('mat1').propertyGroup('def').func('rho').set('dermethod', 'manual'); model.material('mat1').propertyGroup('def').func('rho').set('plotargs', {'pA' '0' '1'; 'T' '0' '1'}); model.material('mat1').propertyGroup('def').func('rho').set('argders', {'pA' 'd(pA*0.02897/8.314/T,pA)'; 'T' 'd(pA*0.02897/8.314/T,T)'}); model.material('mat1').propertyGroup('def').func('k').set('pieces', {'200.0' '1600.0' '-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4'}); model.material('mat1').propertyGroup('def').func('k').set('arg', 'T'); model.material('mat1').propertyGroup('def').func('cs').set('args', {'T'}); model.material('mat1').propertyGroup('def').func('cs').set('expr', 'sqrt(1.4*287*T)'); model.material('mat1').propertyGroup('def').func('cs').set('dermethod', 'manual'); model.material('mat1').propertyGroup('def').func('cs').set('plotargs', {'T' '0' '1'}); model.material('mat1').propertyGroup('def').func('cs').set('argders', {'T' 'd(sqrt(1.4*287*T),T)'}); model.material('mat1').propertyGroup('def').set('relpermeability', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat1').propertyGroup('def').set('relpermittivity', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat1').propertyGroup('def').set('dynamicviscosity', 'eta(T[1/K])[Pa*s]'); model.material('mat1').propertyGroup('def').set('ratioofspecificheat', '1.4'); model.material('mat1').propertyGroup('def').set('electricconductivity', {'0[S/m]' '0' '0' '0' '0[S/m]' '0' '0' '0' '0[S/m]'}); model.material('mat1').propertyGroup('def').set('heatcapacity', 'Cp(T[1/K])[J/(kg*K)]'); model.material('mat1').propertyGroup('def').set('density', 'rho(pA[1/Pa],T[1/K])[kg/m^3]'); model.material('mat1').propertyGroup('def').set('thermalconductivity', {'k(T[1/K])[W/(m*K)]' '0' '0' '0' 'k(T[1/K])[W/(m*K)]' '0' '0' '0' 'k(T[1/K])[W/(m*K)]'}); model.material('mat1').propertyGroup('def').set('soundspeed', 'cs(T[1/K])[m/s]'); model.material('mat1').propertyGroup('def').addInput('temperature'); model.material('mat1').propertyGroup('def').addInput('pressure'); model.material('mat1').propertyGroup('RefractiveIndex').set('n', ''); model.material('mat1').propertyGroup('RefractiveIndex').set('ki', ''); model.material('mat1').propertyGroup('RefractiveIndex').set('n', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat1').propertyGroup('RefractiveIndex').set('ki', {'0' '0' '0' '0' '0' '0' '0' '0' '0'}); model.material('mat2').label('Silica glass'); model.material('mat2').set('ambient', 'custom'); model.material('mat2').set('specular', 'custom'); model.material('mat2').set('fresnel', '0.99'); model.material('mat2').set('noise', 'on'); model.material('mat2').set('family', 'custom'); model.material('mat2').set('diffuse', 'custom'); model.material('mat2').set('noisefreq', '1'); model.material('mat2').set('lighting', 'cooktorrance'); model.material('mat2').set('roughness', '0.02'); model.material('mat2').set('fresnel', '0.99'); model.material('mat2').set('customambient', {'1' '1' '1'}); model.material('mat2').set('customspecular', {'1' '1' '1'}); model.material('mat2').set('customdiffuse', {'1' '1' '1'}); model.material('mat2').propertyGroup('def').set('relpermeability', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat2').propertyGroup('def').set('electricconductivity', {'1e-14[S/m]' '0' '0' '0' '1e-14[S/m]' '0' '0' '0' '1e-14[S/m]'}); model.material('mat2').propertyGroup('def').set('thermalexpansioncoefficient', {'0.55e-6[1/K]' '0' '0' '0' '0.55e-6[1/K]' '0' '0' '0' '0.55e-6[1/K]'}); model.material('mat2').propertyGroup('def').set('heatcapacity', '703[J/(kg*K)]'); model.material('mat2').propertyGroup('def').set('relpermittivity', {'2.09' '0' '0' '0' '2.09' '0' '0' '0' '2.09'}); model.material('mat2').propertyGroup('def').set('density', '2203[kg/m^3]'); model.material('mat2').propertyGroup('def').set('thermalconductivity', {'1.38[W/(m*K)]' '0' '0' '0' '1.38[W/(m*K)]' '0' '0' '0' '1.38[W/(m*K)]'}); model.material('mat2').propertyGroup('Enu').set('youngsmodulus', '73.1e9[Pa]'); model.material('mat2').propertyGroup('Enu').set('poissonsratio', '0.17'); model.material('mat2').propertyGroup('RefractiveIndex').set('n', ''); model.material('mat2').propertyGroup('RefractiveIndex').set('ki', ''); model.material('mat2').propertyGroup('RefractiveIndex').set('n', {'1.45' '0' '0' '0' '1.45' '0' '0' '0' '1.45'}); model.material('mat2').propertyGroup('RefractiveIndex').set('ki', {'0' '0' '0' '0' '0' '0' '0' '0' '0'}); model.material('mat3').label('Copper'); model.material('mat3').set('family', 'copper'); model.material('mat3').propertyGroup('def').set('relpermeability', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat3').propertyGroup('def').set('electricconductivity', {'5.998e7[S/m]' '0' '0' '0' '5.998e7[S/m]' '0' '0' '0' '5.998e7[S/m]'}); model.material('mat3').propertyGroup('def').set('heatcapacity', '385[J/(kg*K)]'); model.material('mat3').propertyGroup('def').set('relpermittivity', {'1' '0' '0' '0' '1' '0' '0' '0' '1'}); model.material('mat3').propertyGroup('def').set('emissivity', '0.5'); model.material('mat3').propertyGroup('def').set('density', '8700[kg/m^3]'); model.material('mat3').propertyGroup('def').set('thermalconductivity', {'400[W/(m*K)]' '0' '0' '0' '400[W/(m*K)]' '0' '0' '0' '400[W/(m*K)]'}); model.material('mat3').propertyGroup('linzRes').set('rho0', ''); model.material('mat3').propertyGroup('linzRes').set('alpha', ''); model.material('mat3').propertyGroup('linzRes').set('Tref', ''); model.material('mat3').propertyGroup('linzRes').set('rho0', '1.72e-8[ohm*m]'); model.material('mat3').propertyGroup('linzRes').set('alpha', '3.9e-3[1/K]'); model.material('mat3').propertyGroup('linzRes').set('Tref', '273.15[K]'); model.material('mat3').propertyGroup('linzRes').addInput('temperature'); model.physics('es').feature('term1').set('TerminalType', 'Voltage'); model.physics('es').feature('term1').set('V0', '0'); model.physics('es').feature('term2').set('TerminalType', 'Voltage'); model.physics('es').feature('term2').set('V0', '1000'); model.mesh('mesh1').feature('size').set('hauto', 1); model.mesh('mesh1').feature('ftet2').feature('size1').set('hauto', 1); model.mesh('mesh1').feature('ftet2').feature('size1').set('custom', 'on'); model.mesh('mesh1').feature('ftet2').feature('size1').set('hgradactive', true); model.mesh('mesh1').feature('ftet2').feature('size1').set('hnarrowactive', true); model.mesh('mesh1').feature('ftet2').feature('size1').set('hminactive', true); model.mesh('mesh1').feature('ftet2').feature('size1').set('hmaxactive', true); model.mesh('mesh1').feature('ftet2').feature('size1').set('hmin', '0.0005'); model.mesh('mesh1').feature('ftet2').feature('size1').set('hgrad', '1.2'); model.mesh('mesh1').feature('ftet2').feature('size1').set('hmax', '.15'); model.mesh('mesh1').feature('ftet1').feature('size1').set('custom', 'on'); model.mesh('mesh1').feature('ftet1').feature('size1').set('hminactive', true); model.mesh('mesh1').feature('ftet1').feature('size1').set('hmin', '1'); model.mesh('mesh1').run; model.result.table('evl2').label('Evaluation 2D'); model.result.table('evl2').comments('Interactive 2D values'); model.study.create('std1'); model.study('std1').create('stat', 'Stationary'); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.sol('sol1').attach('std1'); model.sol('sol1').create('st1', 'StudyStep'); model.sol('sol1').create('v1', 'Variables'); model.sol('sol1').create('s1', 'Stationary'); model.sol('sol1').feature('s1').create('fc1', 'FullyCoupled'); model.sol('sol1').feature('s1').create('i1', 'Iterative'); model.sol('sol1').feature('s1').feature('i1').create('mg1', 'Multigrid'); model.sol('sol1').feature('s1').feature.remove('fcDef'); model.result.dataset.create('cpl1', 'CutPlane'); model.result.dataset.create('cpl2', 'CutPlane'); model.result.create('pg1', 'PlotGroup3D'); model.result.create('pg2', 'PlotGroup3D'); model.result.create('pg3', 'PlotGroup2D'); model.result.create('pg4', 'PlotGroup2D'); model.result.create('pg5', 'PlotGroup2D'); model.result('pg1').create('mslc1', 'Multislice'); model.result('pg1').create('con1', 'Contour'); model.result('pg1').feature('con1').create('def1', 'Deform'); model.result('pg2').create('con1', 'Contour'); model.result('pg2').feature('con1').create('def1', 'Deform'); model.result('pg3').create('con2', 'Contour'); model.result('pg3').create('con3', 'Contour'); model.result('pg4').create('con1', 'Contour'); model.result('pg5').create('con1', 'Contour'); model.result('pg5').create('con2', 'Contour'); model.result.export.create('data1', 'Data'); model.result.export.create('data2', 'Data'); model.result.export.create('data3', 'Data'); model.sol('sol1').attach('std1'); model.sol('sol1').feature('s1').feature('i1').set('linsolver', 'cg'); model.sol('sol1').feature('s1').feature('i1').feature('mg1').set('prefun', 'amg'); model.sol('sol1').runAll; model.result.dataset('cpl1').set('quicky', '1.5'); model.result.dataset('cpl1').set('quickplane', 'xz'); model.result.dataset('cpl2').set('quickz', '1.5'); model.result.dataset('cpl2').set('quickplane', 'xy'); model.result('pg1').active(false); model.result('pg1').label('Electric Potential (es)'); model.result('pg1').set('frametype', 'spatial'); model.result('pg1').feature('mslc1').set('unit', 'V/m'); model.result('pg1').feature('mslc1').set('xnumber', '3'); model.result('pg1').feature('mslc1').set('expr', 'es.Ez'); model.result('pg1').feature('mslc1').set('descr', 'Electric field, z component'); model.result('pg1').feature('mslc1').set('ynumber', '3'); model.result('pg1').feature('mslc1').set('znumber', '3'); model.result('pg1').feature('mslc1').set('resolution', 'normal'); model.result('pg1').feature('con1').set('descr', '9.65e-12 [F/m]*( d(es.Ex^2, y) + d(es.Ey^2, y) + d(es.Ez^2, z) )'); model.result('pg1').feature('con1').set('unit', 'N/m^3'); model.result('pg1').feature('con1').set('includeoutside', false); model.result('pg1').feature('con1').set('contourtype', 'filled'); model.result('pg1').feature('con1').set('expr', '9.65e-12 [F/m]*( d(es.Ex^2, y) + d(es.Ey^2, y) + d(es.Ez^2, z) )'); model.result('pg1').feature('con1').set('resolution', 'normal'); model.result('pg1').feature('con1').feature('def1').set('scale', '7.360875118717719E-6'); model.result('pg1').feature('con1').feature('def1').set('expr', {'' '9.65e-12 [F/m]*( d(es.Ex^2, y) + d(es.Ey^2, y) + d(es.Ez^2, z) )' '9.65e-12 [F/m]*( d(es.Ex^2, y) + d(es.Ey^2, y) + d(es.Ez^2, z) )'}); model.result('pg1').feature('con1').feature('def1').set('scaleactive', false); model.result('pg2').active(false); model.result('pg2').feature('con1').set('descr', 'Polarization norm'); model.result('pg2').feature('con1').set('unit', 'C/m^2'); model.result('pg2').feature('con1').set('includeoutside', false); model.result('pg2').feature('con1').set('contourtype', 'filled'); model.result('pg2').feature('con1').set('expr', 'es.normP'); model.result('pg2').feature('con1').set('resolution', 'normal'); model.result('pg2').feature('con1').feature('def1').set('scale', '4074073.360355141'); model.result('pg2').feature('con1').feature('def1').set('expr', {'es.Px' 'es.Py' 'es.Pz'}); model.result('pg2').feature('con1').feature('def1').set('descr', 'Polarization'); model.result('pg2').feature('con1').feature('def1').set('scaleactive', false); model.result('pg3').label('Force'); model.result('pg3').set('data', 'cpl2'); model.result('pg3').set('ylabel', 'y'); model.result('pg3').set('ylabelactive', true); model.result('pg3').set('xlabel', 'x'); model.result('pg3').set('xlabelactive', true); model.result('pg3').feature('con2').label('Fy (E^2)'); model.result('pg3').feature('con2').set('data', 'cpl2'); model.result('pg3').feature('con2').set('descr', '-.5 * 9.65e-12 [F/m] * d(es.Ex^2 + es.Ey^2 + es.Ez^2, z)'); model.result('pg3').feature('con2').set('unit', 'N/m^3'); model.result('pg3').feature('con2').set('contourtype', 'filled'); model.result('pg3').feature('con2').set('number', '15'); model.result('pg3').feature('con2').set('includeoutside', false); model.result('pg3').feature('con2').set('expr', '-.5 * 9.65e-12 [F/m] * d(es.Ex^2 + es.Ey^2 + es.Ez^2, z)'); model.result('pg3').feature('con2').set('colortablerev', true); model.result('pg3').feature('con2').set('resolution', 'normal'); model.result('pg3').feature('con3').active(false); model.result('pg3').feature('con3').label('Fy (P.E)'); model.result('pg3').feature('con3').set('descr', 'es.Px * d(es.Ez, x) + es.Py * d(es.Ez, y) + es.Pz * d(es.Ez, z)'); model.result('pg3').feature('con3').set('unit', 'N/m^3'); model.result('pg3').feature('con3').set('contourtype', 'filled'); model.result('pg3').feature('con3').set('number', '15'); model.result('pg3').feature('con3').set('expr', 'es.Px * d(es.Ez, x) + es.Py * d(es.Ez, y) + es.Pz * d(es.Ez, z)'); model.result('pg3').feature('con3').set('resolution', 'normal'); model.result('pg4').label('Cross section'); model.result('pg4').set('data', 'cpl2'); model.result('pg4').feature('con1').set('data', 'cpl1'); model.result('pg4').feature('con1').set('descr', 'd((es.Ex^2 + es.Ey^2 + es.Ez^2), z)'); model.result('pg4').feature('con1').set('unit', 'kg^2*m/(s^6*A^2)'); model.result('pg4').feature('con1').set('contourtype', 'filled'); model.result('pg4').feature('con1').set('expr', 'd((es.Ex^2 + es.Ey^2 + es.Ez^2), z)'); model.result('pg4').feature('con1').set('resolution', 'normal'); model.result('pg5').active(false); model.result('pg5').label('Testing'); model.result('pg5').feature('con1').label('E'); model.result('pg5').feature('con1').set('descr', 'Electric field norm'); model.result('pg5').feature('con1').set('unit', 'V/m'); model.result('pg5').feature('con1').set('contourtype', 'filled'); model.result('pg5').feature('con1').set('number', '15'); model.result('pg5').feature('con1').set('expr', 'es.normE'); model.result('pg5').feature('con1').set('resolution', 'normal'); model.result('pg5').feature('con2').label('P'); model.result('pg5').feature('con2').set('descr', 'es.normP / 9.65e-12 [F/m]'); model.result('pg5').feature('con2').set('unit', 'V/m'); model.result('pg5').feature('con2').set('contourtype', 'filled'); model.result('pg5').feature('con2').set('number', '15'); model.result('pg5').feature('con2').set('expr', 'es.normP / 9.65e-12 [F/m]'); model.result('pg5').feature('con2').set('resolution', 'normal'); model.result.export('data1').label('Forcex'); model.result.export('data1').set('unit', {'N/m^3' '' ''}); model.result.export('data1').set('descr', {'x Force/unit volume' '' ''}); model.result.export('data1').set('expr', {'.5*9.65e-12 [F/m]*d(es.Ex^2+es.Ey^2+es.Ez^2,x)' '' ''}); model.result.export('data1').set('filename', '/Users/Zach/Desktop/LIGO/Forcex.txt'); model.result.export('data2').label('Forcey'); model.result.export('data2').set('location', 'regulargrid'); model.result.export('data2').set('unit', {'N/m^3'}); model.result.export('data2').set('descr', {'y Force/unit volume perp. to sample'}); model.result.export('data2').set('expr', {'.5*9.65e-12 [F/m]*d(es.Ex^2+es.Ey^2+es.Ez^2,y)'}); model.result.export('data2').set('gridstruct', 'grid'); model.result.export('data2').set('recover', 'pprint'); model.result.export('data2').set('regulargridx3', '150'); model.result.export('data2').set('filename', '/Users/Zach/Desktop/LIGO/Forcey.dat'); model.result.export('data2').set('regulargridy3', '150'); model.result.export('data2').set('regulargridz3', '21'); model.result.export('data3').label('Forcez'); model.result.export('data3').set('unit', {'N/m^3'}); model.result.export('data3').set('descr', {'z Force/unit volume'}); model.result.export('data3').set('expr', {'.5*9.65e-12 [F/m]*d(es.Ex^2+es.Ey^2+es.Ez^2,z)'}); model.result.export('data3').set('filename', '/Users/Zach/Desktop/LIGO/Forcez.csv'); model.result.export('data3').set('struct', 'sectionwise'); model.result.export('data3').set('level', 'volume'); out = model;