97 const double nan = std::numeric_limits<double>::quiet_NaN();
115 const double z0e_image = 2.0 / ( 1.0 / z0e_1 + 1.0 / z0e_2 );
116 const double z0o_image = 2.0 / ( 1.0 / z0o_1 + 1.0 / z0o_2 );
142 if( ( z0e + z0o ) > 0.0 )
163 if( !( zDiffTarget > 0.0 ) || !( zCommTarget > 0.0 ) )
189 const double z0 = sqrt( z0e_target * z0o_target );
190 const double k = ( z0e_target - z0o_target ) / ( z0e_target + z0o_target );
195 static constexpr double ai[] = { 1, -0.301, 3.209, -27.282, 56.609, -37.746 };
196 static constexpr double bi[] = { 0.020, -0.623, 17.192, -68.946, 104.740, -16.148 };
197 static constexpr double ci[] = { 0.002, -0.347, 7.171, -36.910, 76.132, -51.616 };
199 const double AW = exp( z0 * sqrt( er + 1.0 ) / 42.4 ) - 1.0;
200 const double F1 = 8.0 * sqrt(
AW * ( 7.0 + 4.0 / er ) / 11.0 + ( 1.0 + 1.0 / er ) / 0.81 ) /
AW;
202 double F2 = 0.0, F3 = 0.0;
205 for(
int i = 0; i <= 5; i++ )
206 F2 = F2 + ai[i] * pow( k, i );
208 for(
int i = 0; i <= 5; i++ )
209 F3 = F3 + ( bi[i] - ci[i] * ( 9.6 - er ) ) * pow( ( 0.6 - k ),
static_cast<double>( i ) );
211 double w = h * fabs( F1 * F2 );
212 double s = h * fabs( F1 * F3 );
220 const double cval = 1e-12 * z0e_target * z0o_target;
222 while( !done && iters < maxiters )
234 const double err = pow( ( ze0 - z0e_target ), 2.0 ) + pow( ( zo0 - z0o_target ), 2.0 );
257 const double dedw = ( ze1 - ze0 ) /
delta;
258 const double dodw = ( zo1 - zo0 ) /
delta;
259 const double deds = ( ze2 - ze0 ) /
delta;
260 const double dods = ( zo2 - zo0 ) /
delta;
263 const double d = dedw * dods - deds * dodw;
266 double dw = -1.0 * ( ( ze0 - z0e_target ) * dods - ( zo0 - z0o_target ) * deds ) / d;
268 if( fabs( dw ) > 0.1 * w )
278 double ds = ( ( ze0 - z0e_target ) * dodw - ( zo0 - z0o_target ) * dedw ) / d;
280 if( fabs( ds ) > 0.1 * s )
325 auto writeChecked = [&write](
const TRANSLINE_PARAMETERS aParam,
const double aValue,
const bool aPositive,
328 const bool invalid = !std::isfinite( aValue ) || ( aPositive ? aValue <= 0.0 : aValue < 0.0 );
375 * ( ( 2.0 / ( 1.0 - t / h ) ) * log( ( 1.0 / ( 1.0 - t / h ) ) + 1.0 )
376 - ( 1.0 / ( 1.0 - t / h ) - 1.0 ) * log( ( 1.0 / pow( 1.0 - t / h, 2.0 ) ) - 1.0 ) );
387 const double k_e = tanh(
M_PI * w / ( 2.0 * h ) ) * tanh(
M_PI * ( w + s ) / ( 2.0 * h ) );
388 const double k_o = tanh(
M_PI * w / ( 2.0 * h ) ) *
coth(
M_PI * ( w + s ) / ( 2.0 * h ) );
389 const double k_e_p = std::sqrt( 1 - std::pow( k_e, 2 ) );
390 const double k_o_p = std::sqrt( 1 - std::pow( k_o, 2 ) );
402 return std::fabs( a - h / 2.0 ) <= h * 1e-9;
412 return ( a > 0.5 * t ) && ( a < h - 0.5 * t );
417 const double s,
const double t,
432 const double s,
const double t,
const double er )
454 const double z0e_image = 2.0 / ( 1.0 / z0e_1 + 1.0 / z0e_2 );
455 const double z0o_image = 2.0 / ( 1.0 / z0o_1 + 1.0 / z0o_2 );
467 const double aWidth,
const double aThickness,
const double aEr )
481 const double position = std::fabs( 0.5 - aOffset / aPlateSpacing );
482 const double positionFactor = std::pow( position, 2.2 );
483 const double widthFactor = std::pow( ( aThickness + aWidth ) / aPlateSpacing, 2.9 );
484 const double correction = ( 0.26 *
M_PI / 8.0 ) * std::sqrt( aEr ) * aZImage * positionFactor * widthFactor;
501 const double k =
sech(
M_PI * w / ( 2.0 * h ) );
502 const double k_p = tanh(
M_PI * w / ( 2.0 * h ) );
529 const double Z_o = s / t >= 5.0 ? Z_o_1 : Z_o_2;
548 const double atten_d = alpha_d_dB_per_m * length;
580 double atten_c_e = 0.0;
581 double atten_c_o = 0.0;
583 if( z0_e > 0.0 && std::isfinite( z0_e ) )
584 atten_c_e = loss_single * ( z0_single / z0_e );
586 if( z0_o > 0.0 && std::isfinite( z0_o ) )
587 atten_c_o = loss_single * ( z0_single / z0_o );
610 const double v =
TC::C0 / sqrt( e_r );
void Analyse() override
Analyse track geometry parameters to output Z0 and Ang_L.
double C_f_t_h
Fringing capacitance of single strip of finite width.
void calcLosses()
Calculates conductor and dielectric losses.
void SetSynthesisResults() override
Sets the output values and status following synthesis.
STRIPLINE m_striplineCalc
Calculator used to determine single stripline values.
double unit_prop_delay_o
Odd mode unit propagation delay (ps/cm)
bool Synthesize(SYNTHESIZE_OPTS aOpts) override
Synthesis track geometry parameters to match given Z0.
void calcFringeCapacitances(double h, double t, double er)
Calculate the coupling fringe capacitances.
double Z0_o_w_h_0_s_h
Odd mode impedance of coupled zero thickness strips.
double Z0_w_h_t_h
Impedance of single strip of finite thickness.
void calcZ0EvenMode()
Calculates even mode Z0.
void calcDielectrics()
Calculate dialectric and propagation parameters.
static bool isOffsetWithinFiniteThicknessLimits(double a, double h, double t)
Returns true when the offset a is far enough from each ground plane that the Reference [1] finite-thi...
static bool IsCenteredOffset(double a, double h)
Returns true when the strip plane offset a is effectively at the centre (a = h/2 within numerical tol...
double Z0_w_h_0
Impedance of single strip of zero thickness.
void calcSingleStripImpedances()
Calculates impedances of finite- and zero-thickness single strips.
std::pair< double, double > calcOffsetVirtualBranch(double aVirtualH, double w, double s, double t, double er)
Runs the centred finite-thickness pipeline for a single Reference [3] virtual stripline of plate spac...
static double applyOffsetCorrection(double aZImage, double aOffset, double aPlateSpacing, double aWidth, double aThickness, double aEr)
Applies the Reference [3] Eq.
double e_eff_e
Even mode effective dielectric constant.
void calcZ0OddMode(double t, double s)
Calculates odd mode Z0.
void SetAnalysisResults() override
Sets the output values and status following analysis.
double C_f_0
Fringing capacitance from one edge to ground of zero thickness strip.
double e_eff_o
Odd mode effective dielectric constant.
double Z0_e_w_h_0_s_h
Even mode impedance of coupled zero thickness strips.
double calcZ0SymmetricStripline()
Calculates the impedance of a finite-width single strip.
double ang_l
Angular length (rad)
void calcZeroThicknessCoupledImpedances(double h, double w, double s, double er)
Calculates zero-thickness coupled strip impedances.
void calcOffsetZeroThicknessCoupledImpedances(double h, double a, double w, double s, double t, double er)
Offset-aware wrapper around calcZeroThicknessCoupledImpedances built on Reference [3] Sec.
ResultSink
Identifies which result map publishResults() should populate.
void publishResults(ResultSink aSink, TRANSLINE_STATUS aImpedanceFailure, TRANSLINE_STATUS aGeometryFailure)
Shared body of SetAnalysisResults / SetSynthesisResults.
double unit_prop_delay_e
Even mode unit propagation delay (ps/cm)
static double coth(const double x)
Calculates cosh of the given argument.
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.
double GetParameter(const TRANSLINE_PARAMETERS aParam) const
Gets the given calculation property.
static double sech(const double x)
Calculates sech of the given argument.
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.
double SkinDepth() const
Calculate skin depth.
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.
static double UnitPropagationDelay(double aEpsilonEff)
Calculates the unit propagation delay (ps/cm) for the given effective permittivity.
constexpr double UNIT_MIL
constexpr double correction
SYNTHESIZE_OPTS
Options for specifying synthesis inputs, targets, or strategies.
TRANSLINE_STATUS
Parameter status values.
TRANSLINE_PARAMETERS
All possible parameters used (as inputs or outputs) by the transmission line calculations.