KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_djordjevic_sarkar.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25
26#include <cmath>
27#include <stdexcept>
28
30
31
32BOOST_AUTO_TEST_SUITE( DjordjevicSarkar )
33
34
35// Oracle values come from the scikit-rf djordjevicsvensson reference evaluated
36// with (epsR=4.4, tanD=0.02, f_spec=1 GHz, f1=1 kHz, f2=1 THz).
38{
40 model.Fit( 4.4, 0.02, 1.0e9 );
41
42 BOOST_TEST( !model.IsLossless() );
43 BOOST_TEST( model.GetEpsilonInf() == 4.01276, boost::test_tools::tolerance( 1.0e-4 ) );
44 BOOST_TEST( model.GetM() == 0.05606, boost::test_tools::tolerance( 1.0e-4 ) );
45}
46
47
49{
51 model.Fit( 4.4, 0.02, 1.0e9 );
52
53 BOOST_TEST( model.EpsilonRealAt( 1.0e6 ) == 4.7872, boost::test_tools::tolerance( 0.01 ) );
54 BOOST_TEST( model.TanDeltaAt( 1.0e6 ) == 0.01838, boost::test_tools::tolerance( 0.0005 ) );
55}
56
57
59{
61 model.Fit( 4.4, 0.02, 1.0e9 );
62
63 BOOST_TEST( model.EpsilonRealAt( 1.0e10 ) == 4.2709, boost::test_tools::tolerance( 0.01 ) );
64 BOOST_TEST( model.TanDeltaAt( 1.0e10 ) == 0.02049, boost::test_tools::tolerance( 0.0005 ) );
65}
66
67
68// Lossless fit must produce a frequency-flat permittivity and exact-zero tan delta
69// at any probing frequency, including the numerical extremes.
70BOOST_AUTO_TEST_CASE( LosslessInput )
71{
73 model.Fit( 4.4, 0.0, 1.0e9 );
74
75 BOOST_TEST( model.IsLossless() );
76 BOOST_TEST( model.EpsilonRealAt( 1.0e-6 ) == 4.4 );
77 BOOST_TEST( model.EpsilonRealAt( 1.0e15 ) == 4.4 );
78 BOOST_TEST( model.TanDeltaAt( 1.0e-6 ) == 0.0 );
79 BOOST_TEST( model.TanDeltaAt( 1.0e15 ) == 0.0 );
80 BOOST_TEST( model.TanDeltaAt( 0.0 ) == 0.0 );
81}
82
83
84BOOST_AUTO_TEST_CASE( InvalidBandwidth )
85{
87
88 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e9, 0.0, 1.0e12 ), std::invalid_argument );
89 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e9, 1.0e12, 1.0e10 ), std::invalid_argument );
90 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e20, 1.0e3, 1.0e12 ), std::invalid_argument );
91}
92
93
94// At DC the argument (f2+0j)/(f1+0j) is purely real, so ln is real and the
95// complex permittivity collapses to the static limit with zero loss tangent.
97{
99 model.Fit( 4.4, 0.02, 1.0e9 );
100
101 const double epsAtDC = model.EpsilonRealAt( 0.0 );
102 const double expected = model.GetEpsilonInf() + model.GetM() * std::log( 1.0e12 / 1.0e3 );
103
104 BOOST_TEST( std::isfinite( epsAtDC ) );
105 BOOST_TEST( epsAtDC == expected, boost::test_tools::tolerance( 1.0e-9 ) );
106 BOOST_TEST( model.TanDeltaAt( 0.0 ) == 0.0 );
107}
108
109
Kramers-Kronig-consistent wideband dielectric model after Djordjevic et al.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(FR4Fit)
BOOST_TEST(contains==c.ExpectedContains)
BOOST_AUTO_TEST_SUITE_END()
KIBIS_MODEL * model
VECTOR3I expected(15, 30, 45)