Skip to content

Commit 7cf8533

Browse files
toammannthliebig
authored andcommitted
Change function descriptions to match markdown format for auto generation of documentation
1 parent 49213a6 commit 7cf8533

2 files changed

Lines changed: 73 additions & 69 deletions

File tree

matlab/AddDjordjevicSarkarMaterial.m

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
1-
function [CSX] = AddDjordjevicSarkarMaterial(varargin)
1+
function [CSX] = AddDjordjevicSarkarMaterial(CSX, matName, varargin)
2+
% function [CSX] = AddDjordjevicSarkarMaterial(CSX, matName, varargin)
23
%
34
% Add a wideband dielectric material to a CSX struct using a multi-term
45
% Debye fit of the Djordjevic–Sarkar model.
56
%
67
% Calculates Debye parameters from a single (eps_r, tanD) measurement via
7-
% 'calcDjordjevicSarkarApprox' and adds the material to the CSX struct.
8+
% `calcDjordjevicSarkarApprox` and adds the material to the CSX struct.
89
%
9-
% Input Parameters:
10-
% CSX - CSX struct to which the material will be added
11-
% materialName - String name of the material
10+
% - CSX : CSX struct to which the material will be added
11+
% - matName : String name of the material
1212
%
13-
% Name-Value Parameters (passed to `calcDjordjevicSarkarApprox`):
14-
% 'fMeas' - Measurement frequency [Hz]
15-
% 'epsRMeas' - Relative permittivity ε_r at 'fMeas'
16-
% 'tandMeas' - Loss tangent tan(δ) at 'fMeas'
17-
% 'f2' - Upper corner frequency of the Djordjevic–Sarkar model [Hz]
18-
% 'f1' - Lower corner frequency [Hz] (if `lowFreqEvalType` = 0)
19-
% 'epsRdc' - Permittivity at DC (if `lowFreqEvalType` = 1)
20-
% 'sigmaDC' - Optional DC conductivity [S/m]
21-
% 'nTermsPerDec' - Number of Debye terms per frequency decade
13+
% required name-value pairs:
14+
% - 'fMeas' : Measurement frequency [Hz]
15+
% - 'epsRMeas' : Relative permittivity ε_r at 'fMeas'
16+
% - 'tandMeas' : Loss tangent tan(δ) at 'fMeas'
17+
% - 'f2' : Upper corner frequency of the Djordjevic–Sarkar model [Hz]
2218
%
23-
% Output:
24-
% CSX - Updated CSX struct including the defined wideband dielectric material
19+
% optional name-value pairs:
20+
% - 'lowFreqEvalType': Low-frequency behavior:
21+
% 0 = use 'f1' (default), typical Djordjevic–Sarkar
22+
% 1 = use 'epsRdc'
23+
% - 'f1' : Lower corner frequency [Hz] (used if `lowFreqEvalType` = 0)
24+
% - 'epsRdc' : Permittivity at DC (used if `lowFreqEvalType` = 1)
25+
% - 'sigmaDC' : DC conductivity [S/m]
26+
% - 'nTermsPerDec' : Number of Debye terms per frequency decade
27+
% - 'plotEn' : Enable/Disable plots of the model
2528
%
26-
% Note:
27-
% - Internally uses 'calcDjordjevicSarkarApprox' to generate model parameters.
28-
% - See 'calcDjordjevicSarkarApprox' for detailed description of the model
29-
% fitting.
29+
% output:
30+
% - CSX : Updated CSX struct including the defined wideband dielectric material
3031
%
31-
% Example:
32-
% CSX = AddDjordjevicSarkarMaterial(CSX, 'MyMaterial', ...
33-
% 'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
34-
% 'f1', 1e6, 'f2', 200e9);
32+
% note:
33+
% - Internally uses `calcDjordjevicSarkarApprox` to generate model parameters.
34+
% - See `calcDjordjevicSarkarApprox` for detailed description of the model
35+
% fitting.
36+
%
37+
% example:
38+
%
39+
% CSX = AddDjordjevicSarkarMaterial(CSX, 'MyMaterial', ...
40+
% 'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
41+
% 'f1', 1e6, 'f2', 200e9);
3542
%
3643
% See also: calcDjordjevicSarkarApprox, AddDebyeMaterial
3744
%
@@ -60,7 +67,7 @@
6067
p.addParameter('plotEn', 0, @isIntegerScalar); % Enable/Disable plots of the model
6168

6269
% Parse and manually verify required parameters
63-
p.parse(varargin{:});
70+
p.parse(CSX, matName, varargin{:});
6471

6572
requiredParams = {'fMeas', 'epsRMeas', 'tandMeas', 'f2'};
6673
for i = 1:numel(requiredParams)
@@ -93,9 +100,6 @@
93100
'nTermsPerDec', p.Results.nTermsPerDec,...
94101
'plotEn', p.Results.plotEn);
95102

96-
CSX = p.Results.CSX;
97-
matName = p.Results.matName;
98-
99103
CSX = AddDebyeMaterial(CSX, matName);
100104
CSX = SetMaterialProperty(CSX, matName, ...
101105
'Epsilon', paramDebye.epsInf, ... % Epsilon here is acutally EpsilonRinf
@@ -107,7 +111,7 @@
107111
['EpsilonDelta_', int2str(i)], paramDebye.deltaEpsT(i),...
108112
['EpsilonRelaxTime_', int2str(i)], 1/paramDebye.wi(i));
109113

110-
end
114+
end
111115
end
112116

113117
% Validation functions for input argument checks

matlab/CalcDjordjevicSarkarApprox.m

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
function [paramDebye, paramSarkar] = calcDjordjevicSarkarApprox(varargin)
2-
% calcDjordjevicSarkarApprox - Approximate Djordjevic–Sarkar model with multi-term Debye model
1+
function [paramDebye, paramSarkar] = CalcDjordjevicSarkarApprox(varargin)
2+
%function [paramDebye, paramSarkar] = CalcDjordjevicSarkarApprox(varargin)
3+
%
4+
% Approximate Djordjevic–Sarkar model with multi-term Debye model
35
%
46
% Fits a wideband dielectric model using a single permittivity and loss tangent
57
% measurement at one frequency. The Djordjevic–Sarkar [1] model is calculated from
68
% these values and approximated using multiple Debye terms. The poles are placed
79
% logarithmically between f1 and f2. One term per decade is used by default.
810
%
9-
% INPUT PARAMETERS (Name-Value pairs):
10-
% Required:
11-
% 'fMeas' - Frequency of the Measurement [Hz]
12-
% 'epsRMeas' - Relative permittivity ε_r at 'fMeas'
13-
% 'tandMeas' - Loss tangent tan(δ) at 'fMeas'
14-
% 'f2' - Upper corner frequency of the Djordjevic–Sarkar model [Hz]
11+
% required name-value pairs:
12+
% - 'fMeas' : Frequency of the measurement [Hz]
13+
% - 'epsRMeas' : Relative permittivity ε_r at 'fMeas'
14+
% - 'tandMeas' : Loss tangent tan(δ) at 'fMeas'
15+
% - 'f2' : Upper corner frequency of the Djordjevic–Sarkar model [Hz]
1516
%
16-
% Depending on 'lowFreqEvalType':
17-
% 'lowFreqEvalType' - Low-frequency behavior:
18-
% 0 = use 'f1' (default), typical Djordjevic–Sarkar
19-
% 1 = use 'epsRdc'
20-
% 'f1' - Lower corner frequency [Hz], required if lowFreqEvalType = 0
21-
% 'epsRdc' - DC permittivity, required if lowFreqEvalType = 1
17+
% optional name-value pairs:
18+
% - 'lowFreqEvalType': Low-frequency behavior:
19+
% 0 = use 'f1' (default), typical Djordjevic–Sarkar
20+
% 1 = use 'epsRdc'
21+
% - 'f1' : Lower corner frequency [Hz] (required if `lowFreqEvalType` = 0)
22+
% - 'epsRdc' : DC permittivity (required if `lowFreqEvalType` = 1)
23+
% - 'sigmaDC' : DC conductivity [S/m], usually neglected, default: 0
24+
% - 'nTermsPerDec' : Debye poles per frequency decade, default: 1
25+
% - 'plotEn' : Enable plotting (0 = off, 1 = on), default: 0
2226
%
23-
% Optional:
24-
% 'sigmaDC' - DC conductivity [S/m], usally neglected, default: 0
25-
% 'nTermsPerDec' - Debye poles per frequency decade, default: 1
26-
% 'plotEn' - Enable plotting (0 = off, 1 = on), default: 0
27+
% output:
28+
% - paramDebye : Struct with multi-term Debye model:
29+
% .epsInf – Permittivity at infinite frequency
30+
% .deltaEpsT – Array of Δε'_i values
31+
% .wi – Array of angular pole frequencies ω_i
32+
% .sigmaDC – DC conductivity [S/m]
2733
%
28-
% OUTPUT:
29-
% paramDebye - Struct with multi-term Debye model:
30-
% .epsInf : Permittivity at infinite frequency
31-
% .deltaEpsT : Array of Δε'_i values
32-
% .wi : Array of angular pole frequencies ω_i
33-
% .sigmaDC : DC conductivity [S/m]
34+
% - paramSarkar : Struct with Djordjevic–Sarkar model parameters:
35+
% .epsInf – High-frequency permittivity
36+
% .deltaEpsT – Total permittivity change (ε_r,DC - ε_inf)
37+
% .m1 – log10(lower angular frequency)
38+
% .m2 – log10(upper angular frequency)
39+
% .sigmaDC DC conductivity [S/m]
3440
%
35-
% paramSarkar - Struct with Djordjevic–Sarkar model parameters:
36-
% .epsInf : High-frequency permittivity
37-
% .deltaEpsT : Total permittivity change (eps_r,DC - eps_inf)
38-
% .m1 : log10(lower angular freq)
39-
% .m2 : log10(upper angular freq)
40-
% .sigmaDC : DC conductivity [S/m]
41+
% example:
4142
%
42-
% EXAMPLE:
43-
% [pDebye, pSarkar] = calcDjordjevicSarkarApprox( ...
44-
% 'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
45-
% 'f1', 1e6, 'f2', 200e9, 'plotEn', 1);
43+
% [pDebye, pSarkar] = calcDjordjevicSarkarApprox( ...
44+
% 'fMeas', 1e9, 'epsRMeas', 4.2, 'tandMeas', 0.02, ...
45+
% 'f1', 1e6, 'f2', 200e9, 'plotEn', 1);
4646
%
47-
% NOTES:
48-
% - Either 'f1' or 'epsRdc' must be specified depending on 'lowFreqEvalType'.
49-
% - Debye model is matched to the imaginary part of the DS model, sampled at
50-
% logarithmically spaced frequencies.
47+
% notes:
48+
% - Either `'f1'` or `'epsRdc'` must be specified depending on `'lowFreqEvalType'`.
49+
% - Debye model is matched to the imaginary part of the DS model, sampled at
50+
% logarithmically spaced frequencies.
5151
%
5252
% See also: AddDebyeMaterial, AddLorentzMaterial
5353
%
5454
% [1] Djordjevic, Antonije R., et al. "Wideband frequency-domain
5555
% characterization of FR-4 and time-domain causality." IEEE Transactions
56-
% on electromagnetic compatibility 43.4 (2001): 662-667.
56+
% on Electromagnetic Compatibility 43.4 (2001): 662667.
5757
%
5858
% -------------------------------------------------------------------------
5959
% author: Tobias Ammann (2025)
@@ -89,7 +89,7 @@
8989
error('%s: Missing required parameter ''%s''.', p.FunctionName, param);
9090
end
9191
end
92-
92+
9393
if ((p.Results.lowFreqEvalType == 0) && ismember('f1', p.UsingDefaults))
9494
error(['%s: For ''lowFreqEvalType=0'' a value for f1 (Djordjevic Sarkar ',...
9595
'low corner frequency)must be specified.'], p.FunctionName);

0 commit comments

Comments
 (0)