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.You are not allowed to attach a file to this page.
