matlab: examples update
This commit is contained in:
parent
1153b23c41
commit
5d9e3b0a9e
@ -8,9 +8,9 @@
|
|||||||
% Tested with
|
% Tested with
|
||||||
% - Matlab 2009b
|
% - Matlab 2009b
|
||||||
% - Octave 3.3.52
|
% - Octave 3.3.52
|
||||||
% - openEMS v0.0.17
|
% - openEMS v0.0.23
|
||||||
%
|
%
|
||||||
% (C) 2010 Thorsten Liebig <thorsten.liebig@uni-due.de>
|
% (C) 2010,2011 Thorsten Liebig <thorsten.liebig@uni-due.de>
|
||||||
|
|
||||||
close all
|
close all
|
||||||
clear
|
clear
|
||||||
@ -18,7 +18,7 @@ clc
|
|||||||
|
|
||||||
%% switches & options...
|
%% switches & options...
|
||||||
postprocessing_only = 0;
|
postprocessing_only = 0;
|
||||||
draw_3d_pattern = 1; % this may take a while...
|
draw_3d_pattern = 0; % this may take a while...
|
||||||
use_pml = 0; % use pml boundaries instead of mur
|
use_pml = 0; % use pml boundaries instead of mur
|
||||||
openEMS_opts = '';
|
openEMS_opts = '';
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ end
|
|||||||
max_timesteps = 30000;
|
max_timesteps = 30000;
|
||||||
min_decrement = 1e-5; % equivalent to -50 dB
|
min_decrement = 1e-5; % equivalent to -50 dB
|
||||||
f0 = 0e9; % center frequency
|
f0 = 0e9; % center frequency
|
||||||
fc = 3e9; % 10 dB corner frequency (in this case 0 Hz - 3e9 Hz)
|
fc = 3e9; % 20 dB corner frequency (in this case 0 Hz - 3e9 Hz)
|
||||||
FDTD = InitFDTD( max_timesteps, min_decrement );
|
FDTD = InitFDTD( max_timesteps, min_decrement );
|
||||||
FDTD = SetGaussExcite( FDTD, f0, fc );
|
FDTD = SetGaussExcite( FDTD, f0, fc );
|
||||||
BC = {'MUR' 'MUR' 'MUR' 'MUR' 'MUR' 'MUR'}; % boundary conditions
|
BC = {'MUR' 'MUR' 'MUR' 'MUR' 'MUR' 'MUR'}; % boundary conditions
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
% Tested with
|
% Tested with
|
||||||
% - Matlab 2009b
|
% - Matlab 2009b
|
||||||
% - Octave 3.3.52
|
% - Octave 3.3.52
|
||||||
% - openEMS v0.0.17
|
% - openEMS v0.0.23
|
||||||
%
|
%
|
||||||
% (C) 2010 Thorsten Liebig <thorsten.liebig@uni-due.de>
|
% (C) 2010 Thorsten Liebig <thorsten.liebig@uni-due.de>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ clc
|
|||||||
|
|
||||||
%% switches & options...
|
%% switches & options...
|
||||||
postprocessing_only = 0;
|
postprocessing_only = 0;
|
||||||
draw_3d_pattern = 1; % this may take a (very long) while...
|
draw_3d_pattern = 0; % this may take a (very long) while...
|
||||||
use_pml = 0; % use pml boundaries instead of mur
|
use_pml = 0; % use pml boundaries instead of mur
|
||||||
openEMS_opts = '';
|
openEMS_opts = '';
|
||||||
|
|
||||||
@ -131,9 +131,9 @@ for xn=1:array.xn
|
|||||||
CSX = AddBox(CSX,'patch',10,start,stop);
|
CSX = AddBox(CSX,'patch',10,start,stop);
|
||||||
|
|
||||||
% apply the excitation & resist as a current source
|
% apply the excitation & resist as a current source
|
||||||
start = [midX+feed.pos midY-feed.width/2 0];
|
start = [midX+feed.pos-feed.width/2 midY-feed.width/2 0];
|
||||||
stop = [midX+feed.pos midY+feed.width/2 substrate.thickness];
|
stop = [midX+feed.pos+feed.width/2 midY+feed.width/2 substrate.thickness];
|
||||||
[CSX port] = AddLumpedPort(CSX, 5, number,feed.R, start, stop,[0 0 1],['excite_' int2str(xn) '_' int2str(yn)]);
|
[CSX] = AddLumpedPort(CSX, 5, number,feed.R, start, stop,[0 0 1],['excite_' int2str(xn) '_' int2str(yn)]);
|
||||||
number=number+1;
|
number=number+1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -280,6 +280,8 @@ E_far_normalized = E_far / max(E_far(:)) * Dmax;
|
|||||||
x = E_far_normalized .* sin(theta) .* cos(phi);
|
x = E_far_normalized .* sin(theta) .* cos(phi);
|
||||||
y = E_far_normalized .* sin(theta) .* sin(phi);
|
y = E_far_normalized .* sin(theta) .* sin(phi);
|
||||||
z = E_far_normalized .* cos(theta);
|
z = E_far_normalized .* cos(theta);
|
||||||
|
|
||||||
|
%%
|
||||||
figure
|
figure
|
||||||
surf( x,y,z, E_far_normalized );
|
surf( x,y,z, E_far_normalized );
|
||||||
axis equal
|
axis equal
|
||||||
|
@ -109,8 +109,8 @@ mesh.z = mesh_h5.lines{3};
|
|||||||
X = X';
|
X = X';
|
||||||
Z = Z';
|
Z = Z';
|
||||||
|
|
||||||
for n=1:numel(field_FD.values)
|
for n=1:numel(field_FD.FD.values)
|
||||||
Ec{n} = squeeze(field_FD.values{n}/ef(n));
|
Ec{n} = squeeze(field_FD.FD.values{n}/ef(n));
|
||||||
end
|
end
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
Loading…
Reference in New Issue
Block a user