Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

how type solver and plot?

Please login with a confirmed email address before reporting spam

Hi,
I'm a beginner...I have generated my model in Comsol 3.5 and I have obtained my plot about electric field. Now I want to replicate all in Matlab. I have written the following script and now I have to define the solver and then I want to obtain my plot (Electric field component z) but I don't know the commands and the text to write...Could someone help me?

flclear fem

% Geometry
g1=cylinder3('2.5e-8','5.35e-8','pos',{'0','0','1.5e-8'},'axis',{'0','0','1'},'rot','0');
g2=cylinder3('2.5e-9','5.35e-8','pos',{'0','0','1.5e-9'},'axis',{'0','0','1'},'rot','0');
g3=cylinder3('2.5e-9','5.35e-8','pos',{'0','0','-1.5e-9'},'axis',{'0','0','1'},'rot','0');
g4=cylinder3('2.5E-9','5.35E-8','pos',{'0','0','1.5E-9'},'axis',{'0','0','1'},'rot','0');
g5=cylinder3('2.5E-9','5.35E-8','pos',{'0','0','-5.5e-8'},'axis',{'0','0','1'},'rot','0');
g6=block3('3e-7','3e-7','3e-7','base','corner','pos',{'0','0','0'},'axis',{'0','0','1'},'rot','0');
g7=block3('3e-7','3e-7','3e-7','base','corner','pos',{'0','0','-1.5e-7'},'axis',{'0','0','1'},'rot','0');
g8=block3('3e-7','3e-7','3e-7','base','corner','pos',{'0','1.5e-7','-1.5e-7'},'axis',{'0','0','1'},'rot','0');
g9=block3('3e-7','3e-7','3e-7','base','corner','pos',{'0','0','-1.5e-7'},'axis',{'0','0','1'},'rot','0');
g10=block3('3e-7','3e-7','3e-7','base','corner','pos',{'0','-1.5e-7','-1.5e-7'},'axis',{'0','0','1'},'rot','0');
g11=block3('3e-7','3e-7','3e-7','base','corner','pos',{'-1.5e-7','-1.5e-7','-1.5e-7'},'axis',{'0','0','1'},'rot','0');

% Analyzed geometry
clear s
s.objs={g4,g5,g11};
s.name={'CYL1','CYL2','BLK1'};
s.tags={'g4','g5','g11'};

fem.draw=struct('s',s);
fem.geom=geomcsg(fem);
figure,geomplot(draw);

% Initialize mesh
fem.mesh=meshinit(fem, ...
'hauto',5);
meshplot(fem);
% (Default values are not included)

% Application mode 1
clear appl
appl.mode.class = 'ElectromagneticWaves';
appl.module = 'RF';
appl.gporder = 4;
appl.cporder = 2;
appl.sshape = 2;
appl.border = 'on';
appl.assignsuffix = '_rfw';
clear bnd
bnd.kdir = {{'-nx_rfw';'-ny_rfw';'-nz_rfw'},{'-nx_rfw';'-ny_rfw';'-nz_rfw'}, ...
{'-nx_rfw';0;0},{'-nx_rfw';'-ny_rfw';'-nz_rfw'},{'-nx_rfw';'-ny_rfw'; ...
'-nz_rfw'}};
bnd.type = {'E0','cont','SC','H0','SC'};
bnd.E0 = {{0;0;0},{0;0;0},{0;0;1},{0;0;0},{0; ...
0;0}};
bnd.scsource = {'E','E','E','E','I'};
bnd.ind = [3,1,4,4,1,2,2,2,2,2,2,2,2,2,2,2,2,5];
appl.bnd = bnd;
clear equ
equ.sigma = {0,0.9987,-0.9987};
equ.epsilonr = {1,-29.9563,-29.9563};
equ.ind = [1,2,3];
appl.equ = equ;
fem.appl{1} = appl;
fem.frame = {'ref'};
fem.border = 1;
clear units;
units.basesystem = 'SI';
fem.units = units;

% ODE Settings
clear ode
clear units;
units.basesystem = 'SI';
ode.units = units;
fem.ode=ode;

% Multiphysics
fem=multiphysics(fem);


0 Replies Last Post Mar 31, 2011, 5:59 a.m. EDT
COMSOL Moderator

Hello Stefano Rizzo

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.