Materials
AddMetal
- AddMetal(CSX, name)
Full definition:
function CSX = AddMetal(CSX, name)
Add a metal property (PEC) to CSX with the given name. Remember to add at least one or more geometrical primitives to any property.
example:
CSX = AddMetal(CSX,'metal'); %create PEC with propName 'metal'
CSX = AddBox(CSX,'metal',10,[0 0 0],[100 100 200]); %assign box
See also AddMaterial, AddExcitation, AddProbe, AddDump, AddBox
author: Thorsten Liebig
AddConductingSheet
- AddConductingSheet(CSX, name, conductivity, thickness)
Full definition:
function CSX = AddConductingSheet(CSX, name, conductivity, thickness)
Add a conducting sheet property to CSX with the given name. Remember to add at least one or more 2D!! geometrical primitives to this property.
Hint: Set the thickness to 0 to fall back to a perfect metal (AddMetal)
example:
% create the conducting material peroperty, e.g. 40um thick copper
CSX = AddConductingSheet(CSX,'copper',56e6,40e-6);
% assign box the 2D box --> 40um thick sheet
CSX = AddBox(CSX,'copper',10,[0 -50 200],[1000 50 200]);
See also AddMaterial, AddMetal, AddExcitation, AddBox
author: Thorsten Liebig 2012
AddMaterial
- AddMaterial(CSX, name, varargin)
Full definition:
function CSX = AddMaterial(CSX, name, varargin)
Add a material property to CSX with the given name. Remember to add at least one or more geometrical primitives to any property.
Use SetMaterialProperty to define the material constants:
‘Epsilon’: relative electric permitivity
‘Mue’: relative magnetic permeability
‘Kappa’: electric conductivity
‘Sigma’: magnetc conductivity (non-physical property)
examples:
CSX = AddMaterial( CSX, 'RO3010' );
CSX = SetMaterialProperty( CSX, 'RO3010', 'Epsilon', 10.2, 'Mue', 1 );
CSX = AddBox( CSX, 'RO3010', 0, [0 0 0], [100 1000 1000] );
See also SetMaterialProperty, SetMaterialWeight, AddMetal, AddExcitation, AddProbe, AddDump, AddBox
author: Thorsten Liebig
SetMaterialProperty
- SetMaterialProperty(CSX, name, varargin)
Full definition:
function CSX = SetMaterialProperty(CSX, name, varargin)
Use this function to define the material constants:
‘Epsilon’: relative electric permittivity: [Epsilon] = 1
‘Mue’: relative magnetic permeability: [Mue} = 1
‘Kappa’: electric conductivity: [Kappa] = S/m
‘Sigma’: magnetic conductivity (non-physical property): [Sigma] = Ohm/m
‘Density’: material mass density: [Density] = kg/m^3, e.g. water: 1000 necessary for SAR calculations
examples:
CSX = AddMaterial( CSX, 'RO3010' );
CSX = SetMaterialProperty( CSX, 'RO3010', 'Epsilon', 10.2, 'Mue', 1 );
CSX = AddBox( CSX, 'RO3010', 0, [0 0 0], [100 1000 1000] );
% anisotropic material
CSX = AddMaterial( CSX, 'sheet','Isotropy',0);
CSX = SetMaterialProperty(CSX, 'sheet', 'Kappa', [0 0 kappa]);
CSX = AddBox( CSX, 'sheet', 0, [0 0 0], [10 1000 1000] );
See also AddMaterial, SetMaterialWeight
author: Thorsten Liebig
SetMaterialWeight
- SetMaterialWeight(CSX, name, varargin)
Full definition:
function CSX = SetMaterialWeight(CSX, name, varargin)
Define the material weighting function(s)
The functions can use the variables:
x,y,z
rho for the distance to z-axis
r for the distance to origin
a for alpha (as in cylindircal and spherical coord systems)
t for theta (as in the spherical coord system
all these variables are not weighted with the drawing unit defined by the grid
example:
%material distribution as a rect-function with 4 periods
start=[-500 -100 -500];
stop =[ 500 100 500];
CSX = AddMaterial(CSX, 'material');
CSX = SetMaterialProperty(CSX, 'material', 'Epsilon', 1);
CSX = SetMaterialWeight(CSX, 'material', 'Epsilon', ['(sin(4*z / 1000 *2*pi)>0)+1']);
CSX = AddBox(CSX, 'material' ,10 , start, stop);
See also AddMaterial, SetMaterialProperty, InitCSX, DefineRectGrid
author: Thorsten Liebig
SetBackgroundMaterial
- SetBackgroundMaterial(CSX, varargin))
Full definition:
function CSX = SetBackgroundMaterial(CSX, varargin))
Set the background material properties
variable arguments:
‘Epsilon’ : background rel. electric permittivity (default 1)
‘Kappa’ : background electric conductivity (default 0)
‘Mue’ : background rel. magnetic permeability (default 1)
example:
CSX = InitCSX();
CSX = SetBackgroundMaterial(CSX, 'Epsilon', 4)
See also InitCSX
author: Thorsten Liebig (c) 2013
AddLumpedElement
- AddLumpedElement(CSX, name, direction, varargin)
Full definition:
function CSX = AddLumpedElement(CSX, name, direction, varargin)
Add a lumped element property to CSX with the given name. Remember to add at least one or more box primitive to any property.
arguments:
direction: 0,1,2 or ‘x’,’y’,’z’ for the orientation of the lumped element
optional arguments:
‘R’, ‘C’, ‘L’: definition of the lumped element properties
‘Caps’: 0 or 1 to (de)activate lumped element caps (1=default) If Caps are enable, a small PEC plate is added to each end of the lumped element to ensure contact to e.g a microstrip line
‘LEtype’: 0 = parallel (default), 1 = series Parallel: R, C and L are all in parallel (standard lumped capacitor/resistor/LC tank). Series: R, L and C are in series (use this for a series inductor, e.g. to tune antenna length).
examples:
%lumped element capacitor in y-direction with 1pF
CSX = AddLumpedElement( CSX, 'Capacitor', 1, 'Caps', 1, 'C', 1e-12 );
CSX = AddBox( CSX, 'Capacitor', 0, [0 0 0], [10 10 10] );
%series inductor in x-direction with 10nH (e.g. to tune antenna length)
CSX = AddLumpedElement( CSX, 'Inductor', 0, 'Caps', 1, 'L', 10e-9, 'LEtype', 1 );
CSX = AddBox( CSX, 'Inductor', 0, [0 0 0], [10 10 10] );
See also AddMaterial, AddMetal, AddExcitation, AddProbe, AddDump, AddBox
author: Thorsten Liebig
AddDebyeMaterial
- AddDebyeMaterial(CSX, name, varargin)
Full definition:
function CSX = AddDebyeMaterial(CSX, name, varargin)
Add a Debye type dispersive material model.
The Debye type frequency dependent material:
eps_r(w) = eps_r + sum_p ( eps_r_delta,p / (1+jw*t_relex,p) ) - j*kappa/w
with
eps_r_delta,p: the delta electric relative permitivity
t_relex,p: the electric relaxation time
Use SetMaterialProperty to define the material constants:
‘EpsilonDelta_p’: p-th eps_r_delta,p
‘EpsilonRelaxTime_p’: p-th t_relex,p
example:
CSX = AddDebyeMaterial(CSX,'debye');
CSX = SetMaterialProperty(CSX,'debye','Epsilon',5,'EpsilonDelta_1',0.1,'EpsilonRelaxTime_1',1e-9);
[..]
CSX = AddBox(CSX,'debye', 10 ,start,stop);
See also AddBox, AddMaterial, SetMaterialProperty, AddLorentzMaterial
author: Thorsten Liebig (2013)
AddLorentzMaterial
- AddLorentzMaterial(CSX, name, varargin)
Full definition:
function CSX = AddLorentzMaterial(CSX, name, varargin)
Add a Drude/Lorentz type dispersive material model. Note: openEMS currently only supports a drude material type.
The drude type frequency dependent material:
eps_r(f) = eps_r* ( 1 - f_eps_plasma^2/(f*(f-j/t_eps_r)) )
mue_r(f) = mue_r* ( 1 - f_mue_plasma^2/(f*(f-j/t_mue_r)) )
with
f_eps_plasma: the respective electric angular plasma frequency
f_mue_plasma: the respective magnetic angular plasma frequency
t_eps_r: the respective electric relaxation time
t_mue_r: the respective magnetic relaxation time
Use SetMaterialProperty to define the material constants:
‘EpsilonPlasmaFrequency’: electric plasma frequency (f_eps_plasma)
‘MuePlasmaFrequency’: magnetic plasma frequency (f_mue_plasma)
‘EpsilonRelaxTime’: electric plasma relaxation time (losses)
‘MueRelaxTime’: magnetic plasma relaxation time (losses)
Note: all properties must be positive values
Higher order Drude type:
‘EpsilonPlasmaFrequency_
’: n-th order electric plasma frequency (f_eps_plasma) ‘MuePlasmaFrequency_
’: n-th order magnetic plasma frequency (f_mue_plasma) ‘EpsilonRelaxTime_
’: n-th order electric plasma relaxation time (losses) ‘MueRelaxTime_
’: n-th order magnetic plasma relaxation time (losses)
The Lorentz type frequency dependent material:
eps_r(f) = eps_r* ( 1 - f_eps_plasma^2/(f^2-f_eps_Lor_Pole^2-jf^2*/t_eps_r)) )
mue_r(f) = mue_r* ( 1 - f_mue_plasma^2/(f^2-f_mue_Lor_Pole^2-jf^2*/t_mue_r)) )
with the additional parameter (see above)
f_eps_Lor_Pole: the respective electric angular lorentz pole frequency
f_mue_Lor_Pole: the respective magnetic angular lorentz pole frequency
Use SetMaterialProperty to define the material constants:
‘EpsilonLorPoleFrequency’: electric lorentz pole frequency (f_eps_Lor_Pole)
‘MueLorPoleFrequency’: magnetic lorentz pole frequency (f_mue_Lor_Pole)
Note: all properties must be positive values
Higher order Drude type:
‘EpsilonLorPoleFrequency_
’: n-th order electric lorentz pole frequency (f_eps_plasma) ‘MueLorPoleFrequency_
’: n-th order magnetic lorentz pole frequency (f_mue_plasma)
example:
CSX = AddLorentzMaterial(CSX,'drude');
CSX = SetMaterialProperty(CSX,'drude','Epsilon',5,'EpsilonPlasmaFrequency',5e9,'EpsilonRelaxTime',1e-9);
CSX = SetMaterialProperty(CSX,'drude','Mue',5,'MuePlasmaFrequency',5e9,'MueRelaxTime',1e-9);
[..]
CSX = AddBox(CSX,'drude', 10 ,start,stop);
See also AddBox, AddMaterial, SetMaterialProperty
author: Thorsten Liebig
AddDjordjevicSarkarMaterial
- AddDjordjevicSarkarMaterial(CSX, matName, varargin)
Full definition:
function [CSX] = AddDjordjevicSarkarMaterial(CSX, matName, varargin)
Add a wideband dielectric material to a CSX struct using a multi-term Debye fit of the Djordjevic–Sarkar model.
Calculates Debye parameters from a single (eps_r, tanD) measurement via
calcDjordjevicSarkarApprox and adds the material to the CSX struct.
CSX : CSX struct to which the material will be added
matName : String name of the material
required name-value pairs:
‘fMeas’ : Measurement frequency [Hz]
‘epsRMeas’ : Relative permittivity ε_r at ‘fMeas’
‘tandMeas’ : Loss tangent tan(δ) at ‘fMeas’
‘f2’ : Upper corner frequency of the Djordjevic–Sarkar model [Hz]
optional name-value pairs:
‘lowFreqEvalType’: Low-frequency behavior: 0 = use ‘f1’ (default), typical Djordjevic–Sarkar 1 = use ‘epsRdc’
‘f1’ : Lower corner frequency [Hz] (used if
lowFreqEvalType= 0)‘epsRdc’ : Permittivity at DC (used if
lowFreqEvalType= 1)‘sigmaDC’ : DC conductivity [S/m]
‘nTermsPerDec’ : Number of Debye terms per frequency decade
‘plotEn’ : Enable/Disable plots of the model
output:
CSX : Updated CSX struct including the defined wideband dielectric material
note:
Internally uses
calcDjordjevicSarkarApproxto generate model parameters.See
calcDjordjevicSarkarApproxfor detailed description of the model fitting.
example:
CSX = AddDjordjevicSarkarMaterial(CSX, 'MyMaterial', ...
'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
'f1', 1e6, 'f2', 200e9);
See also: calcDjordjevicSarkarApprox, AddDebyeMaterial
Version History: v1.0 2025-06-30 Tobias Ammann Initial version
CalcDebyeMaterial
- CalcDebyeMaterial(f, eps_r, kappa, eps_Delta, t_relax)
Full definition:
eps_debye = CalcDebyeMaterial(f, eps_r, kappa, eps_Delta, t_relax)
Calculate the Debye type dispersive material constant
arguments:
f: frequeny range of interest
eps_r: eps_r infinity
kappa: conductivity (losses)
eps_Delta: (vector) delta of relative permitivity
t_relax: (vector) relaxation time (losses)
return:
eps_debye: the complex relative permitivity
See also: CalcLorentzMaterial
author: Thorsten Liebig (2013)
CalcDrudeMaterial
- CalcDrudeMaterial(f, eps_r, kappa, plasmaFreq, t_relax)
Full definition:
eps_drude = CalcDrudeMaterial(f, eps_r, kappa, plasmaFreq, t_relax)
Calculate the Drude type dispersive material constant
arguments:
f: frequeny range of interest
eps_r: eps_r infinity
kappa: conductivity (losses)
plasmaFreq: (vector) plasma frequencies
t_relax: (vector) relaxation time (losses)
return:
eps_drude: the complex relative permitivity
Example:
% silver (AG) at optical frequencies (Drude model) [1, p. 201]
f = linspace(300e12, 1100e12, 201);
eps_model = CalcDrudeMaterial(f, 3.942, 7.97e3, 7e15/2/pi, 0, 1/2.3e13);
figure
plot(f,real(eps_model))
hold on;
grid on;
plot(f,imag(eps_model),'r--')
See also: CalcDebyeMaterial, CalcLorentzMaterial
[1] Rennings, Andre: “Elektromagnetische Zeitbereichssimulationen innovativer Antennen auf Basis von Metamaterialien.” PhD Thesis, University of Duisburg-Essen, September 2008
author: Thorsten Liebig (2013)
CalcLorentzMaterial
- CalcLorentzMaterial(f, eps_r, kappa, plasmaFreq, LorPoleFreq, t_relax)
Full definition:
eps_lorentz = CalcLorentzMaterial(f, eps_r, kappa, plasmaFreq, LorPoleFreq, t_relax)
Calculate the Lorentz type dispersive material constant
arguments:
f: frequeny range of interest
eps_r: eps_r infinity
kappa: conductivity (losses)
plasmaFreq: (vector) plasma frequencies (Drude model)
LorPoleFreq: (vector) Lorentz pole frequencies (zero for pure Drude model)
t_relax: (vector) relaxation time (losses)
return:
eps_lorentz: the complex relative permitivity
Example:
% silver (AG) at optical frequencies (Drude model) [1, p. 201]
f = linspace(300e12, 1100e12, 201);
eps_model = CalcLorentzMaterial(f, 3.942, 7.97e3, 7e15/2/pi, 0, 1/2.3e13);
figure
plot(f,real(eps_model))
hold on;
grid on;
plot(f,imag(eps_model),'r--')
% silver (AG) at optical frequencies (Drude+Lorentz model) [1, p. 201]
f = linspace(300e12, 1100e12, 201);
eps_model = CalcLorentzMaterial(f, 1.138, 4.04e3, [13e15 9.61e15]/2/pi, [0 7.5e15]/2/pi,[1/2.59e13 1/3e14]);
figure
plot(f,real(eps_model))
hold on;
grid on;
plot(f,imag(eps_model),'r--')
See also: CalcDebyeMaterial
[1] Rennings, Andre: “Elektromagnetische Zeitbereichssimulationen innovativer Antennen auf Basis von Metamaterialien.” PhD Thesis, University of Duisburg-Essen, September 2008
author: Thorsten Liebig (2013)
CalcDjordjevicSarkarApprox
- CalcDjordjevicSarkarApprox(varargin)
Full definition:
function [paramDebye, paramSarkar] = CalcDjordjevicSarkarApprox(varargin)
Approximate Djordjevic–Sarkar model with multi-term Debye model
Fits a wideband dielectric model using a single permittivity and loss tangent measurement at one frequency. The Djordjevic–Sarkar [1] model is calculated from these values and approximated using multiple Debye terms. The poles are placed logarithmically between f1 and f2. One term per decade is used by default.
required name-value pairs:
‘fMeas’ : Frequency of the measurement [Hz]
‘epsRMeas’ : Relative permittivity ε_r at ‘fMeas’
‘tandMeas’ : Loss tangent tan(δ) at ‘fMeas’
‘f2’ : Upper corner frequency of the Djordjevic–Sarkar model [Hz]
optional name-value pairs:
‘lowFreqEvalType’: Low-frequency behavior: 0 = use ‘f1’ (default), typical Djordjevic–Sarkar 1 = use ‘epsRdc’
‘f1’ : Lower corner frequency [Hz] (required if
lowFreqEvalType= 0)‘epsRdc’ : DC permittivity (required if
lowFreqEvalType= 1)‘sigmaDC’ : DC conductivity [S/m], usually neglected, default: 0
‘nTermsPerDec’ : Debye poles per frequency decade, default: 1
‘plotEn’ : Enable plotting (0 = off, 1 = on), default: 0
output:
paramDebye : Struct with multi-term Debye model: .epsInf – Permittivity at infinite frequency .deltaEpsT – Array of Δε’_i values .wi – Array of angular pole frequencies ω_i .sigmaDC – DC conductivity [S/m]
paramSarkar : Struct with Djordjevic–Sarkar model parameters: .epsInf – High-frequency permittivity .deltaEpsT – Total permittivity change (ε_r,DC - ε_inf) .m1 – log10(lower angular frequency) .m2 – log10(upper angular frequency) .sigmaDC – DC conductivity [S/m]
example:
[pDebye, pSarkar] = calcDjordjevicSarkarApprox( ...
'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
'f1', 1e6, 'f2', 200e9, 'plotEn', 1);
notes:
Either
'f1'or'epsRdc'must be specified depending on'lowFreqEvalType'.Debye model is matched to the imaginary part of the DS model, sampled at logarithmically spaced frequencies.
See also: AddDebyeMaterial, AddLorentzMaterial
[1] Djordjevic, Antonije R., et al. “Wideband frequency-domain characterization of FR-4 and time-domain causality.” IEEE Transactions on Electromagnetic Compatibility 43.4 (2001): 662–667.
author: Tobias Ammann (2025)
Version: v1.0 2025-06-30 Tobias Ammann Initial release
AddDiscMaterial
- AddDiscMaterial(CSX, name, varargin)
Full definition:
function CSX = AddDiscMaterial(CSX, name, varargin)
Add a discretized material model property to CSX with the given name. Discretized model has to be stored in an hdf5 file. Use Transform option to perfom some transformation actions.
variable arguments (key/value)
‘File’ (mandatory): define the filename of the discrete material
‘Scale’: scale the discrete material e.g. to your drawing units: ‘Scale’, 1/unit
‘Transform’: Apply a transformation, see AddBox for more infos
‘UseDBBackground’: set to 0, to use the properties background material instead of the database material with index 0 (default)
examples:
%add human body model
CSX = AddDiscMaterial(CSX, 'Ella', 'Scale', 1/unit, ...
'Transform', {'Rotate_Z',pi/2,'Translate','300,300,500'}, ...
'File', 'model_file_name.h5' );
start = [mesh.x(1) mesh.y(1) mesh.z(1)];
stop = [mesh.x(end) mesh.y(end) mesh.z(end)];
CSX = AddBox(CSX,'Ella', 0 ,start,stop);
See also AddBox, AddMetal, AddExcitation, AddProbe, AddDump
author: Thorsten Liebig
CreateDiscMaterial
- CreateDiscMaterial(filename, data, mat_db, mesh)
Full definition:
function CreateDiscMaterial(filename, data, mat_db, mesh)
Create the discrete material hdf5 file (version 2) usable by AddDiscMaterial
Note: This function currently requires Matlab. Octave is missing the necessary hdf5 write functions.
arguments:
filename: hdf5 file to create (must not exist)
data: voxel based index data, index as used in mat_db-1
mat_db: material database
mesh: used voxel mesh. Note size is size(data)+[1 1 1]
example:
mat_db.epsR = [1 3 4]; %relative permittivity
mat_db.kappa = [0 0.2 0.4]; %electric conductivity (S/m)
mat_db.density = [0 1000 1010]; %material density (kg/m³)
mat_db.Name = {'Background','mat2','mat3'};
data = [0 1 0; 2 1 2; 0 1 0]; % 3x3x3 data
mesh.x = [0 0.1 0.2 0.3]; % 4 mesh lines in x-dir (3 cells)
mesh.y = [-0.1 0 0.1 0.2]; % 4 mesh lines in y-dir (3 cells)
mesh.z = [0 0.4 0.8 1.2]; % 4 mesh lines in z-dir (3 cells)
CreateDiscMaterial('test_mat.h5', data, mat_db, mesh);
See also AddDiscMaterial
author: Thorsten Liebig (2013)
Convert_VF_DiscMaterial
- Convert_VF_DiscMaterial(raw_filesuffix, mat_db_file, out_filename, varargin)
Full definition:
function Convert_VF_DiscMaterial(raw_filesuffix, mat_db_file, out_filename, varargin)
function to convert the virtual family raw voxel data to a disc material property required by CSXCAD/openEMS
Note: The conversion is (currently) done, converting the broad-band data into a relative permittivity and conductivity for a given frequency of interest. Thus the converted model is only valid within a small frequency range around the used conversion frequency.
required arguments:
raw_filesuffix: suffix for the virtual family body model files the files: <raw_filesuffix>.txt and <raw_filesuffix>.raw must be found! example: ‘/tmp/Ella_26y_V2_1mm’
mat_db_file: tissue database file (incl. full path if necessary) example: ‘/tmp/DB_h5_20120711_SEMCADv14.8.h5’
out_filename: outfile name, e.g. ‘Ella_298MHz.h5’
variable arguments (key/value):
‘Frequency’: specifiy the frequency of interest (required!)
‘Center’: 0/1 make the model centered around (0,0,0) (default is off)
Requirements:
Matlab, Octave is currently not supported due to missing hdf5 write functions
~6GB of RAM to convert the largest voxel model
Virtual Family voxel models e.g. Duke_34y_V5_1mm.raw and .txt See http://www.itis.ethz.ch/itis-for-health/virtual-population/overview/
Virtual Family tissue database e.g. DB_h5_20120711_SEMCADv14.8.h5 Download from: http://www.itis.ethz.ch/assets/Downloads/TissueDb/DBh5_20120711_SEMCADv14.8.zip
example:
Convert_VF_DiscMaterial('/tmp/Ella_26y_V2_1mm', ...
'/tmp/DB_h5_20120711_SEMCADv14.8.h5', ...
'Ella_centered_298MHz.h5', ...
'Frequency', 2.4e9);
(c) 2013 Thorsten Liebig