Create Diffraction order using Livelink for matlab

Please login with a confirmed email address before reporting spam

Hello, I want to create a diffraction order in using livelink in matlab. I could not find a command that describe how to create it. pasted bellow my lines of code in matlab:

%%%%% Assign Boundary Variables%%%%%% bL = 1; % left boundary -> inpot port bR = 12; % right boundary -> output port bB = 2; % bottom boundary -> periodic (Floquet) bT = 3; % top boundary -> periodic (Floquet)

%%%% Floquet periodic BC (y-direction) %%%%

pc1 = ewfd.create('pc1','PeriodicCondition',1); pc1.selection.set([bB, bT]); pc1.set('PeriodicType','Floquet'); pc1.set('kFloquet', {'k0cos(theta)', 'k0sin(theta)', '0'});

%%% input port (left) %%% port1 = ewfd.create('port1','Port',1); port1.selection.set(bL); port1.set('PortType','Periodic'); % port1.set('ModeType','PlaneWave'); port1.set('PortExcitation','on'); port1.set('E0', {'0','1','0'}); % Ey polarization doR1 = port2.create('doR1','DiffractionOrder',1); doR1.set('m',1); doR1.set('n', 0);

%%% output port (right) %%% port2 = ewfd.create('port2','Port',1); port2.selection.set(bR); port2.set('PortType','Periodic'); port2.set('ModeType','PlaneWave'); port2.set('PortExcitation','on'); doT1 = port2.create('doT1','DiffractionOrder',2); doT1.set('m', 1); doT1.set('n', 0);

Regards Hammam


0 Replies Last Post 2025年12月22日 GMT+8 17:32
COMSOL Moderator

Hello Hammam Al Bustami

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.

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.