Page 1 of 1

Excitation error

Posted: Fri 24 Jul 2020, 13:51
by milenam
Hello,

I am new to OpenEMS and am trying to simulate how a plane wave is diffracted by a PDMS film with modulated surface on top of a thin glass slab. Unfortunately, I get the error
Excitation::buildExcitationSignal: Unknown error... excitation setup failed!!
As it doesn't say what the problem with the excitation is, I am kinda lost here. Could anybody help me? I would really appreciate any advice :)
Below is my code as well as the output I get:

addpath('M:\SLM\openEMS\matlab\tmp2');

close all
clear
clc

CSX=InitCSX();
FDTD=InitFDTD('NrTS', 5000, 'EndCriteria', 0);

x_pat=0.024e-3;
y_pat=0.024e-3;

x_size=0.03e-3;
y_size=0.03e-3;
z_size=60e-6;

%% FDTD Boundary Conditions

BC = {'PEC' 'PEC' 'PMC' 'PMC' 'PML_8' 'PML_8'};
FDTD = SetBoundaryCond(FDTD, BC);

%% materials
n_PDMS=1.41;
n_glass=1.50;
mu_PDMS=1;
mu_glass=1;
width_PDMS=50e-6;
width_glass=30e-6;

unit=1e-6;

CSX = AddMaterial( CSX, 'PDMS' );
CSX = SetMaterialProperty( CSX, 'PDMS', 'Epsilon', n_PDMS^2, 'Sigma', mu_PDMS );
CSX = ImportSTL(CSX, 'PDMS', 1, 'PDMS_Vogel_24small_50_0_025.stl', 'Transform',{'Scale',unit});


CSX = AddMaterial( CSX, 'glass' );
CSX = SetMaterialProperty( CSX, 'glass', 'Epsilon', n_glass^2, 'Sigma', mu_glass );
start = [1e-6 1e-6 0];
stop = [x_pat y_pat -width_glass];
CSX = AddBox( CSX, 'glass', 0, start, stop );


%% mesh

mesh.x=x_pat-x_size:x_size/188:x_size;
mesh.y=y_pat-y_size:y_size/188:y_size;
mesh.z=z_size:-z_size/1300:-z_size;

CSX=DefineRectGrid(CSX, 1e-9, mesh);

%% Excitation
f0=600e12;

FDTD = SetSinusExcite(FDTD,f0);
k_dir = [0 0 1]; % plane wave direction
E_dir = [1 1 0]; % plane wave polarization

CSX = AddPlaneWaveExcite(CSX, 'plane_wave', k_dir, E_dir);

start = [-x_size, -y_size, z_size];
stop = [2*x_size, 2*y_size, z_size-1e-6];
CSX = AddBox( CSX, 'plane_wave', 1, start, stop );

%% Dump

CSX = AddDump(CSX,'Et');
CSX = AddBox(CSX,'Et',0,[0 0 -z_size],[x_pat y_pat -z_size]);

%% write to xml-file

mkdir('tmp2');
WriteOpenEMS('tmp2/Vogel_Sim.xml',FDTD,CSX);

%% Viszualization of the Structure

CSXGeomPlot( 'tmp2/Vogel_Sim.xml' );

%% OpenEMS Simulation

RunOpenEMS('tmp2','Vogel_Sim.xml');
Output:
Create FDTD operator (compressed SSE + multi-threading)
Create a steady state detection using a period of 1.66667e-015 s
Operartor::CalcECOperator: Decreasing timestep by 100% to 1.66667e-015 (1e+200) to match periodic signal
Excitation::buildExcitationSignal: Unknown error... excitation setup failed!!