38std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>&
46std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>&
75 if( !std::isfinite( Z0_param ) )
81 if( ( !std::isfinite( var ) ) || ( var == 0 ) )
85 double Z0_dest = Z0_param;
88 double angl_l_dest = ANG_L_param;
95 double Z0_current = Z0_param;
97 double error = fabs( Z0_dest - Z0_current );
102 double increment = var / 100.0;
107 double Z0_result = Z0_param;
113 double slope = ( Z0_result - Z0_current ) / increment;
114 slope = ( Z0_dest - Z0_current ) / slope - increment;
123 Z0_current = Z0_param;
124 error = fabs( Z0_dest - Z0_current );
126 if( iteration > 250 )
131 if( aRecalculateLength )
134 ANG_L_param = angl_l_dest;
136 * ANG_L_param / 2.0 /
M_PI );
141 ANG_L_param = angl_l_dest;
143 * ANG_L_param / 2.0 /
M_PI );
161 return std::sqrt( aEpsilonEff ) * ( 1.0e10 / 2.99e8 );
180 if( !std::isfinite( fSpec ) || fSpec <= 0.0 )
189 ds.
Fit( epsRSpec, tanDSpec, fSpec );
192 catch(
const std::invalid_argument& )
219 static constexpr double NR_EPSI = 2.2204460492503131e-16;
222 double k = 0.0, e = 0.0;
229 else if( std::isinf( arg ) && arg < 0 )
236 double a, b, c, fr, s, fk = 1, fe = 1, t, da = arg;
241 fk = 1 / sqrt( 1 - arg );
242 fe = sqrt( 1 - arg );
243 da = -arg / ( 1 - arg );
252 for( i = 0; i < iMax; i++ )
261 if( c / a < NR_EPSI )
273 e = M_PI_2 * ( 1 - s ) / a;
Kramers-Kronig-consistent wideband dielectric model after Djordjevic et al.
void Fit(double aEpsRSpec, double aTanDSpec, double aFSpec, double aF1=1.0e3, double aF2=1.0e12)
Fit the model from a single (epsR, tan delta) datapoint at f_spec.
double GetDispersedEpsilonR(double aF) const
Dispersed permittivity at aF. Returns raw EPSILONR when the model is inactive.
double GetDispersedTanDelta(double aF) const
Dispersed loss tangent at aF. Returns raw TAND when the model is inactive.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & GetSynthesisResults()
Gets the output parameters following synthesis.
virtual void SetAnalysisResults()=0
Sets values in the output analysis results structure.
virtual void SetSynthesisResults()=0
Sets values in the output synthesis results structure.
double GetParameter(const TRANSLINE_PARAMETERS aParam) const
Gets the given calculation property.
void InitProperties(const std::initializer_list< TRANSLINE_PARAMETERS > &aParams)
Initialises the properties used (as inputs or outputs) by the calculation.
std::optional< DIELECTRIC_DJORDJEVIC_SARKAR > m_dsModel
Fitted Djordjevic-Sarkar model. Empty unless DIELECTRIC_MODEL_SEL selects it.
static std::pair< double, double > EllipticIntegral(double arg)
Computes the complete elliptic integral of first kind K() and the second kind E() using the arithmeti...
void SetParameter(const TRANSLINE_PARAMETERS aParam, const double aValue)
Sets the given calculation property.
void SetSynthesisResult(TRANSLINE_PARAMETERS aParam, const double aValue, const TRANSLINE_STATUS aStatus=TRANSLINE_STATUS::OK)
Sets a synthesis result.
void UpdateDielectricModel()
Refit the Djordjevic-Sarkar model from the current parameter map.
static constexpr double m_maxError
The maximum error for Z0 optimisations.
double SkinDepth() const
Calculate skin depth.
virtual void Analyse()=0
Analyses the transmission line using the current parameter set.
double & GetParameterRef(const TRANSLINE_PARAMETERS aParam)
Adds a constant to the given parameter.
std::unordered_map< TRANSLINE_PARAMETERS, double > m_parameters
All input and output properties used by the calculation.
bool MinimiseZ0Error1D(TRANSLINE_PARAMETERS aOptimise, TRANSLINE_PARAMETERS aMeasure, bool aRecalculateLength=false)
minimizeZ0Error1D
void SetAnalysisResult(TRANSLINE_PARAMETERS aParam, const double aValue, const TRANSLINE_STATUS aStatus=TRANSLINE_STATUS::OK)
Sets an analysis result.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > m_synthesisStatus
Synthesis results.
static double UnitPropagationDelay(double aEpsilonEff)
Calculates the unit propagation delay (ps/cm) for the given effective permittivity.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & GetAnalysisResults()
Gets the output parameters following analysis.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > m_analysisStatus
Analysis results.
TRANSLINE_STATUS
Parameter status values.
TRANSLINE_PARAMETERS
All possible parameters used (as inputs or outputs) by the transmission line calculations.