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, see <https://www.gnu.org/licenses/>.
18 */
19
21
22#include <cmath>
23#include <stdexcept>
24
26
27
28BOOST_AUTO_TEST_SUITE( DjordjevicSarkar )
29
30
31// Oracle values come from the scikit-rf djordjevicsvensson reference evaluated
32// with (epsR=4.4, tanD=0.02, f_spec=1 GHz, f1=1 kHz, f2=1 THz).
34{
36 model.Fit( 4.4, 0.02, 1.0e9 );
37
38 BOOST_TEST( !model.IsLossless() );
39 BOOST_TEST( model.GetEpsilonInf() == 4.01276, boost::test_tools::tolerance( 1.0e-4 ) );
40 BOOST_TEST( model.GetM() == 0.05606, boost::test_tools::tolerance( 1.0e-4 ) );
41}
42
43
45{
47 model.Fit( 4.4, 0.02, 1.0e9 );
48
49 BOOST_TEST( model.EpsilonRealAt( 1.0e6 ) == 4.7872, boost::test_tools::tolerance( 0.01 ) );
50 BOOST_TEST( model.TanDeltaAt( 1.0e6 ) == 0.01838, boost::test_tools::tolerance( 0.0005 ) );
51}
52
53
55{
57 model.Fit( 4.4, 0.02, 1.0e9 );
58
59 BOOST_TEST( model.EpsilonRealAt( 1.0e10 ) == 4.2709, boost::test_tools::tolerance( 0.01 ) );
60 BOOST_TEST( model.TanDeltaAt( 1.0e10 ) == 0.02049, boost::test_tools::tolerance( 0.0005 ) );
61}
62
63
64// Lossless fit must produce a frequency-flat permittivity and exact-zero tan delta
65// at any probing frequency, including the numerical extremes.
66BOOST_AUTO_TEST_CASE( LosslessInput )
67{
69 model.Fit( 4.4, 0.0, 1.0e9 );
70
71 BOOST_TEST( model.IsLossless() );
72 BOOST_TEST( model.EpsilonRealAt( 1.0e-6 ) == 4.4 );
73 BOOST_TEST( model.EpsilonRealAt( 1.0e15 ) == 4.4 );
74 BOOST_TEST( model.TanDeltaAt( 1.0e-6 ) == 0.0 );
75 BOOST_TEST( model.TanDeltaAt( 1.0e15 ) == 0.0 );
76 BOOST_TEST( model.TanDeltaAt( 0.0 ) == 0.0 );
77}
78
79
80BOOST_AUTO_TEST_CASE( InvalidBandwidth )
81{
83
84 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e9, 0.0, 1.0e12 ), std::invalid_argument );
85 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e9, 1.0e12, 1.0e10 ), std::invalid_argument );
86 BOOST_CHECK_THROW( model.Fit( 4.4, 0.02, 1.0e20, 1.0e3, 1.0e12 ), std::invalid_argument );
87}
88
89
90// At DC the argument (f2+0j)/(f1+0j) is purely real, so ln is real and the
91// complex permittivity collapses to the static limit with zero loss tangent.
93{
95 model.Fit( 4.4, 0.02, 1.0e9 );
96
97 const double epsAtDC = model.EpsilonRealAt( 0.0 );
98 const double expected = model.GetEpsilonInf() + model.GetM() * std::log( 1.0e12 / 1.0e3 );
99
100 BOOST_TEST( std::isfinite( epsAtDC ) );
101 BOOST_TEST( epsAtDC == expected, boost::test_tools::tolerance( 1.0e-9 ) );
102 BOOST_TEST( model.TanDeltaAt( 0.0 ) == 0.0 );
103}
104
105
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_AUTO_TEST_SUITE_END()
BOOST_TEST(netlist.find("R_G1 ARM_OUT1 DIE_B R='0.001 / ((SW_STATE)") !=std::string::npos)
KIBIS_MODEL * model
VECTOR3I expected(15, 30, 45)