Attachment 'force_z_1x1_mag.m'

Download

   1 % COMSOL Multiphysics Model M-file
   2 % Generated by COMSOL 3.5a (COMSOL 3.5.0.603, $Date: 2008/12/03 17:02:19 $)
   3 
   4 flclear fem
   5 
   6 % COMSOL version
   7 clear vrsn
   8 vrsn.name = 'COMSOL 3.5';
   9 vrsn.ext = 'a';
  10 vrsn.major = 0;
  11 vrsn.build = 603;
  12 vrsn.rcs = '$Name:  $';
  13 vrsn.date = '$Date: 2008/12/03 17:02:19 $';
  14 fem.version = vrsn;
  15 
  16 Inv=1/40;
  17 num=20;
  18 Detz=Inv/num;
  19 z_i=-0.025;
  20 z_sus_vec=(z_i-(Inv/2):Detz:z_i+(Inv/2));
  21 
  22 for i=1:num
  23     
  24 flclear fem
  25 
  26 z_sus_vec_new(i)=z_sus_vec(i);
  27 
  28 
  29 g1=cylinder3('0.0381','0.0127','pos',{'0','0','-0.00635'},'axis',{'0','0','1'},'rot','0');
  30 g2=cylinder3('0.01905','0.00635','pos',{'0','0',z_sus_vec(i)},'axis',{'0','0','1'},'rot','0');
  31 g3=block3('0.15','0.15','0.15','base','center','pos',{'0','0','0'},'axis',{'0','0','1'},'rot','0');
  32 
  33 % Analyzed geometry
  34 clear s
  35 s.objs={g1,g2,g3};
  36 s.name={'CYL1','CYL2','BLK1'};
  37 s.tags={'g1','g2','g3'};
  38 
  39 fem.draw=struct('s',s);
  40 fem.geom=geomcsg(fem);
  41 
  42 % Initialize mesh
  43 fem.mesh=meshinit(fem, ...
  44                   'hauto',4, ...
  45                   'hmaxsub',[2,0.005,3,0.005]);
  46 
  47 % (Default values are not included)
  48 
  49 % Application mode 1
  50 clear appl
  51 appl.mode.class = 'MagnetostaticsNoCurrents';
  52 appl.module = 'ACDC';
  53 appl.sshape = 2;
  54 appl.assignsuffix = '_emnc';
  55 clear bnd
  56 bnd.type = {'nB0','cont'};
  57 bnd.ind = [1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,1];
  58 appl.bnd = bnd;
  59 clear equ
  60 equ.magconstrel = {'mur','Br','Br'};
  61 equ.mur = {1,1.05,1.05};
  62 equ.maxwell = {{},{},'sus'};
  63 equ.Br = {{0;0;0},{0;0;1},{0;0;1}};
  64 equ.ind = [1,2,3];
  65 appl.equ = equ;
  66 fem.appl{1} = appl;
  67 fem.frame = {'ref'};
  68 fem.border = 1;
  69 clear units;
  70 units.basesystem = 'SI';
  71 fem.units = units;
  72 
  73 % ODE Settings
  74 clear ode
  75 clear units;
  76 units.basesystem = 'SI';
  77 ode.units = units;
  78 fem.ode=ode;
  79 
  80 % Multiphysics
  81 fem=multiphysics(fem);
  82 
  83 % Extend mesh
  84 fem.xmesh=meshextend(fem);
  85 
  86 % Solve problem
  87 fem.sol=femstatic(fem, ...
  88                   'solcomp',{'Vm'}, ...
  89                   'outcomp',{'Vm'}, ...
  90                   'blocksize','auto', ...
  91                   'linsolver','cg', ...
  92                   'prefun','amg');
  93 
  94 data=postglobaleval(fem,{'sus_forcez_emnc'});
  95 z_force_vec(i)=data.y;
  96 end
  97 plot(z_sus_vec_new,z_force_vec);

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-13 17:34:15, 1.4 KB) [[attachment:fig_Br_value.JPG]]
  • [get | view] (2009-10-12 21:50:23, 1.5 KB) [[attachment:fig_cons_relation.JPG]]
  • [get | view] (2009-10-13 17:33:12, 1.5 KB) [[attachment:fig_cons_relation_new.JPG]]
  • [get | view] (2009-10-12 21:53:28, 23.6 KB) [[attachment:fig_mag_force_numerical.JPG]]
  • [get | view] (2009-10-12 21:51:08, 1.2 KB) [[attachment:fig_mag_norm_boundary_cond.JPG]]
  • [get | view] (2009-10-12 21:51:29, 2.4 KB) [[attachment:fig_magnization_1.JPG]]
  • [get | view] (2009-10-12 21:50:42, 2.5 KB) [[attachment:fig_magnization_2.JPG]]
  • [get | view] (2009-10-13 17:33:06, 1.1 KB) [[attachment:fig_mur.JPG]]
  • [get | view] (2009-10-12 21:52:00, 27.4 KB) [[attachment:fig_z_field.jpg]]
  • [get | view] (2009-10-12 21:52:03, 17.6 KB) [[attachment:fig_z_field_modified.JPG]]
  • [get | view] (2009-10-13 07:21:56, 2.1 KB) [[attachment:force_z_1x1_mag.m]]
  • [get | view] (2009-10-13 07:17:46, 54.0 KB) [[attachment:mesh_1x1_mag.jpg]]
  • [get | view] (2009-10-13 07:20:13, 2759.1 KB) [[attachment:model_1x1_mag_force.mph]]
  • [get | view] (2009-10-12 21:52:46, 2.2 KB) [[attachment:model_2_mag_finer_mesh.m]]
  • [get | view] (2009-10-13 07:17:50, 24.9 KB) [[attachment:potential_1x1_mag.jpg]]
  • [get | view] (2009-10-13 07:18:00, 19.9 KB) [[attachment:sketch_1x1_mag.jpg]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.