% function out = model % % WeakForm_axisymmetric_kirchhoff_plate.m % % Model exported on Jan 22 2025, 19:28 by COMSOL 6.2.0.339. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('E:\Documents\Comsol'); model.label('WeakForm_axisymmetric_kirchhoff_plate.mph'); model.baseSystem('none'); model.param.set('a', '2'); model.param.set('q', '1'); model.param.set('D', '1000'); model.component.create('comp1', true); model.component('comp1').geom.create('geom1', 1); model.component('comp1').geom('geom1').axisymmetric(true); model.component('comp1').mesh.create('mesh1'); model.component('comp1').geom('geom1').create('i1', 'Interval'); model.component('comp1').geom('geom1').feature('i1').set('coord', {'0' 'a'}); model.component('comp1').geom('geom1').run; model.component('comp1').variable.create('var1'); model.component('comp1').variable('var1').set('d2w', 'wrr+wr/r'); model.component('comp1').physics.create('w', 'WeakFormPDE', 'geom1'); model.component('comp1').physics('w').field('dimensionless').field('w'); model.component('comp1').physics('w').field('dimensionless').component({'w'}); model.component('comp1').physics('w').create('dir1', 'DirichletBoundary', 0); model.component('comp1').physics('w').feature('dir1').selection.set([2]); model.component('comp1').physics('w').create('weak1', 'WeakContribution', 0); model.component('comp1').physics('w').feature('weak1').selection.set([1 2]); model.component('comp1').physics('w').feature('weak1').create('aux1', 'AuxiliaryField', 0); model.component('comp1').physics('w').feature('weak1').feature('aux1').set('fieldVariableName', 'lm'); model.component('comp1').physics('w').prop('ShapeProperty').set('shapeFunctionType', 'shherm'); model.component('comp1').physics('w').prop('EquationForm').set('form', 'Automatic'); model.component('comp1').physics('w').prop('Units').set('CustomSourceTermUnit', 1); model.component('comp1').physics('w').feature('wfeq1').set('weak', '(-test(d2w)*D*d2w+q*test(w))*2*pi*r'); model.component('comp1').physics('w').feature('weak1').set('weakExpression', '-test(lm)*wr-test(wr)*lm'); 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').feature.remove('fcDef'); model.result.dataset.create('rev1', 'Revolve1D'); model.result.create('pg1', 'PlotGroup1D'); model.result.create('pg2', 'PlotGroup2D'); model.result('pg1').create('lngr1', 'LineGraph'); model.result('pg1').feature('lngr1').set('xdata', 'expr'); model.result('pg1').feature('lngr1').selection.set([1]); model.result('pg2').create('surf1', 'Surface'); model.sol('sol1').attach('std1'); model.sol('sol1').feature('st1').label('Compile Equations: Stationary'); model.sol('sol1').feature('v1').label('Dependent Variables 1.1'); model.sol('sol1').feature('s1').label('Stationary Solver 1.1'); model.sol('sol1').feature('s1').feature('dDef').label('Direct 1'); model.sol('sol1').feature('s1').feature('aDef').label('Advanced 1'); model.sol('sol1').feature('s1').feature('fc1').label('Fully Coupled 1.1'); %% run the model % model.sol('sol1').runAll; %% post-process % model.result.dataset('rev1').set('startangle', -90); % model.result.dataset('rev1').set('revangle', 225); % model.result('pg1').label('Weak Form PDE'); % model.result('pg1').set('xlabel', 'r-coordinate'); % model.result('pg1').set('ylabel', 'Dependent variable w'); % model.result('pg1').set('xlabelactive', false); % model.result('pg1').set('ylabelactive', false); % model.result('pg1').feature('lngr1').set('xdataexpr', 'r'); % model.result('pg1').feature('lngr1').set('xdatadescr', 'r-coordinate'); % model.result('pg1').feature('lngr1').set('resolution', 'normal'); % model.result('pg2').label('Weak Form PDE 1'); % model.result('pg2').feature('surf1').set('resolution', 'normal'); % % out = model;