20#ifndef TRANSLINE_CALCULATIONS_TRANSLINE_CALCULATION_BASE_H
21#define TRANSLINE_CALCULATIONS_TRANSLINE_CALCULATION_BASE_H
26#include <unordered_map>
171 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>&
GetAnalysisResults();
174 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>&
GetSynthesisResults();
239 double aTanDeltaSubstrate,
240 double aEpsRSubstrate,
252 static double WanHoorfarQ2(
double aU,
double aHBarTop );
256 void InitProperties(
const std::initializer_list<TRANSLINE_PARAMETERS>& aParams );
287 bool aRecalculateLength =
false );
328 static double coth(
const double x ) {
return ( std::exp( 2.0 * x ) + 1.0 ) / ( std::exp( 2.0 * x ) - 1.0 ); }
331 static double sech(
const double x ) {
return 2.0 / ( std::exp( x ) + std::exp( -x ) ); }
337 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>
m_analysisStatus;
340 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>
m_synthesisStatus;
static double coth(const double x)
Calculates cosh of the given argument.
virtual bool Synthesize(SYNTHESIZE_OPTS aOpts)=0
Synthesis the transmission line using the current parameter set target.
double GetDispersedEpsilonR(double aF) const
Dispersed permittivity at aF. Returns raw EPSILONR when the model is inactive.
TRANSLINE_PARAMETERS m_synthesizeTarget
Which geometry parameter is the unknown during synthesis (set by the UI)
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 SetSynthesizeTarget(TRANSLINE_PARAMETERS aTarget)
Hint from UI picking which geometry parameter is the unknown when Synthesize is called.
virtual void SetSynthesisResults()=0
Sets values in the output synthesis results structure.
double GetParameter(const TRANSLINE_PARAMETERS aParam) const
Gets the given calculation property.
static double sech(const double x)
Calculates sech of the given argument.
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.
std::pair< double, double > ApplySoldermaskCorrection(double aEpsEffUncoated, double aTanDeltaSubstrate, double aEpsRSubstrate, double aWOverH, double aF) const
Apply a three-layer (substrate / soldermask / air) correction to an un-coated (eps_eff,...
double SkinDepth() const
Calculate skin depth.
static double WanHoorfarQ2(double aU, double aHBarTop)
Wan-Hoorfar 2000 eq.
virtual void Analyse()=0
Analyses the transmission line using the current parameter set.
virtual double GetSoldermaskDeltaQ(double, double) const
Incremental filling factor Delta q_mask representing the fraction of the un-coated above-trace air re...
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.
virtual ~TRANSLINE_CALCULATION_BASE()
TRANSLINE_CALCULATION_BASE(std::initializer_list< TRANSLINE_PARAMETERS > aParameters)
Constructs the transmission line calculation object.
static double UnitPropagationDelay(double aEpsilonEff)
Calculates the unit propagation delay (ps/cm) for the given effective permittivity.
TRANSLINE_PARAMETERS GetSynthesizeTarget() const
Returns the parameter that will be solved for during synthesis.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & GetAnalysisResults()
Gets the output parameters following analysis.
bool MinimiseZ0Error2D(TRANSLINE_PARAMETERS aParam1, TRANSLINE_PARAMETERS aParam2)
minimizeZ0Error2D
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > m_analysisStatus
Analysis results.
SYNTHESIZE_OPTS
Options for specifying synthesis inputs, targets, or strategies.
DIELECTRIC_MODEL
Frequency-domain model used for the substrate dielectric properties.
TRANSLINE_STATUS
Parameter status values.
TRANSLINE_PARAMETERS
All possible parameters used (as inputs or outputs) by the transmission line calculations.
@ TWISTEDPAIR_EPSILONR_ENV