KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TRANSLINE_CALCULATION_BASE Class Referenceabstract

The base class for all transmission line calculations. More...

#include <transline_calculation_base.h>

Inheritance diagram for TRANSLINE_CALCULATION_BASE:
COUPLED_MICROSTRIP COUPLED_STRIPLINE MICROSTRIP STRIPLINE

Public Member Functions

 TRANSLINE_CALCULATION_BASE (std::initializer_list< TRANSLINE_PARAMETERS > aParameters)
 Constructs the transmission line calculation object.
 
virtual ~TRANSLINE_CALCULATION_BASE ()
 
void SetParameter (const TRANSLINE_PARAMETERS aParam, const double aValue)
 Sets the given calculation property.
 
double GetParameter (const TRANSLINE_PARAMETERS aParam) const
 Gets the given calculation property.
 
double & GetParameterRef (const TRANSLINE_PARAMETERS aParam)
 Adds a constant to the given parameter.
 
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 > > & GetSynthesisResults ()
 Gets the output parameters following synthesis.
 
virtual void Analyse ()=0
 Analyses the transmission line using the current parameter set.
 
virtual bool Synthesize (SYNTHESIZE_OPTS aOpts)=0
 Synthesis the transmission line using the current parameter set target.
 

Protected Member Functions

void InitProperties (const std::initializer_list< TRANSLINE_PARAMETERS > &aParams)
 Initialises the properties used (as inputs or outputs) by the calculation.
 
virtual void SetAnalysisResults ()=0
 Sets values in the output analysis results structure.
 
virtual void SetSynthesisResults ()=0
 Sets values in the output synthesis results structure.
 
void SetAnalysisResult (TRANSLINE_PARAMETERS aParam, const double aValue, const TRANSLINE_STATUS aStatus=TRANSLINE_STATUS::OK)
 Sets an analysis result.
 
void SetSynthesisResult (TRANSLINE_PARAMETERS aParam, const double aValue, const TRANSLINE_STATUS aStatus=TRANSLINE_STATUS::OK)
 Sets a synthesis result.
 
bool MinimiseZ0Error1D (TRANSLINE_PARAMETERS aOptimise, TRANSLINE_PARAMETERS aMeasure)
 minimizeZ0Error1D
 
bool MinimiseZ0Error2D (TRANSLINE_PARAMETERS aParam1, TRANSLINE_PARAMETERS aParam2)
 minimizeZ0Error2D
 
double SkinDepth () const
 Calculate skin depth.
 

Static Protected Member Functions

static double UnitPropagationDelay (double aEpsilonEff)
 Calculates the unit propagation delay (ps/cm) for the given effective permittivity.
 
static std::pair< double, double > EllipticIntegral (double arg)
 Computes the complete elliptic integral of first kind K() and the second kind E() using the arithmetic-geometric mean algorithm (AGM) by Abramowitz and Stegun.
 
static double coth (const double x)
 Calculates cosh of the given argument.
 
static double sech (const double x)
 Calculates sech of the given argument.
 

Protected Attributes

std::unordered_map< TRANSLINE_PARAMETERS, double > m_parameters
 All input and output properties used by the calculation.
 
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > m_analysisStatus
 Analysis results.
 
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > m_synthesisStatus
 Synthesis results.
 

Static Protected Attributes

static constexpr double m_maxError { 0.000001 }
 The maximum error for Z0 optimisations.
 

Detailed Description

The base class for all transmission line calculations.

This is used by the PCB calculator, and by delay profiles

Definition at line 102 of file transline_calculation_base.h.

Constructor & Destructor Documentation

◆ TRANSLINE_CALCULATION_BASE()

TRANSLINE_CALCULATION_BASE::TRANSLINE_CALCULATION_BASE ( std::initializer_list< TRANSLINE_PARAMETERS aParameters)
inline

Constructs the transmission line calculation object.

@aParameters all parameters that are used (as inputs or outputs) by the calculation

Definition at line 110 of file transline_calculation_base.h.

References InitProperties().

◆ ~TRANSLINE_CALCULATION_BASE()

virtual TRANSLINE_CALCULATION_BASE::~TRANSLINE_CALCULATION_BASE ( )
inlinevirtual

Definition at line 115 of file transline_calculation_base.h.

Member Function Documentation

◆ Analyse()

virtual void TRANSLINE_CALCULATION_BASE::Analyse ( )
pure virtual

Analyses the transmission line using the current parameter set.

Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.

Referenced by MinimiseZ0Error1D().

◆ coth()

static double TRANSLINE_CALCULATION_BASE::coth ( const double  x)
inlinestaticprotected

Calculates cosh of the given argument.

Definition at line 211 of file transline_calculation_base.h.

Referenced by COUPLED_STRIPLINE::calcZeroThicknessCoupledImpedances().

◆ EllipticIntegral()

std::pair< double, double > TRANSLINE_CALCULATION_BASE::EllipticIntegral ( double  arg)
staticprotected

Computes the complete elliptic integral of first kind K() and the second kind E() using the arithmetic-geometric mean algorithm (AGM) by Abramowitz and Stegun.

Returns
std::pair<K, E> where K = first kind integral, E = second kind integral

Definition at line 159 of file transline_calculation_base.cpp.

References INFINITY, M_PI_2, and NR_EPSI.

Referenced by COUPLED_STRIPLINE::calcSingleStripImpedances(), and COUPLED_STRIPLINE::calcZeroThicknessCoupledImpedances().

◆ GetAnalysisResults()

std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & TRANSLINE_CALCULATION_BASE::GetAnalysisResults ( )

◆ GetParameter()

double TRANSLINE_CALCULATION_BASE::GetParameter ( const TRANSLINE_PARAMETERS  aParam) const
inline

◆ GetParameterRef()

double & TRANSLINE_CALCULATION_BASE::GetParameterRef ( const TRANSLINE_PARAMETERS  aParam)
inline

Adds a constant to the given parameter.

Definition at line 124 of file transline_calculation_base.h.

References m_parameters.

Referenced by MinimiseZ0Error1D().

◆ GetSynthesisResults()

std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & TRANSLINE_CALCULATION_BASE::GetSynthesisResults ( )

Gets the output parameters following synthesis.

Definition at line 44 of file transline_calculation_base.cpp.

References m_synthesisStatus, and SetSynthesisResults().

Referenced by MICROSTRIP_UI::showSynthesize(), and STRIPLINE_UI::showSynthesize().

◆ InitProperties()

void TRANSLINE_CALCULATION_BASE::InitProperties ( const std::initializer_list< TRANSLINE_PARAMETERS > &  aParams)
protected

Initialises the properties used (as inputs or outputs) by the calculation.

Definition at line 28 of file transline_calculation_base.cpp.

References m_parameters.

Referenced by TRANSLINE_CALCULATION_BASE().

◆ MinimiseZ0Error1D()

bool TRANSLINE_CALCULATION_BASE::MinimiseZ0Error1D ( TRANSLINE_PARAMETERS  aOptimise,
TRANSLINE_PARAMETERS  aMeasure 
)
protected

minimizeZ0Error1D

Tries to find a parameter that minimizes the error on Z0. This function only works with a single parameter. Calls Analyse several times until the error is acceptable.

This function does not change Z0 / Angl_L

Parameters
aOptimiseParameter to optimise
aMeasureThe parameter to measure / optimise against
Returns
true if error < MAX_ERROR, otherwise false

Definition at line 65 of file transline_calculation_base.cpp.

References Analyse(), TRANSLINE_CALCULATIONS::C0, GetParameter(), GetParameterRef(), m_maxError, and SetParameter().

Referenced by COUPLED_MICROSTRIP::Synthesize(), COUPLED_STRIPLINE::Synthesize(), MICROSTRIP::Synthesize(), and STRIPLINE::Synthesize().

◆ MinimiseZ0Error2D()

bool TRANSLINE_CALCULATION_BASE::MinimiseZ0Error2D ( TRANSLINE_PARAMETERS  aParam1,
TRANSLINE_PARAMETERS  aParam2 
)
protected

minimizeZ0Error2D

Tries to find the parameters that minimizes the error on Z_Diff. This function only works with two parameters. Calls Analyse several times until the error is acceptable. While the error is unacceptable, changes slightly the parameter.

This function does not change Z0 / Angl_L

Parameters
aParam1First parameter to optimise
aParam2Secpmd parameter to optimise
Returns
true if error < MAX_ERROR, otherwise false

◆ sech()

static double TRANSLINE_CALCULATION_BASE::sech ( const double  x)
inlinestaticprotected

Calculates sech of the given argument.

Definition at line 214 of file transline_calculation_base.h.

Referenced by COUPLED_STRIPLINE::calcSingleStripImpedances().

◆ SetAnalysisResult()

void TRANSLINE_CALCULATION_BASE::SetAnalysisResult ( TRANSLINE_PARAMETERS  aParam,
const double  aValue,
const TRANSLINE_STATUS  aStatus = TRANSLINE_STATUS::OK 
)
protected

◆ SetAnalysisResults()

virtual void TRANSLINE_CALCULATION_BASE::SetAnalysisResults ( )
protectedpure virtual

Sets values in the output analysis results structure.

Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.

Referenced by GetAnalysisResults().

◆ SetParameter()

◆ SetSynthesisResult()

void TRANSLINE_CALCULATION_BASE::SetSynthesisResult ( TRANSLINE_PARAMETERS  aParam,
const double  aValue,
const TRANSLINE_STATUS  aStatus = TRANSLINE_STATUS::OK 
)
protected

◆ SetSynthesisResults()

virtual void TRANSLINE_CALCULATION_BASE::SetSynthesisResults ( )
protectedpure virtual

Sets values in the output synthesis results structure.

Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.

Referenced by GetSynthesisResults().

◆ SkinDepth()

double TRANSLINE_CALCULATION_BASE::SkinDepth ( ) const
protected

◆ Synthesize()

virtual bool TRANSLINE_CALCULATION_BASE::Synthesize ( SYNTHESIZE_OPTS  aOpts)
pure virtual

Synthesis the transmission line using the current parameter set target.

Returns
true if the synthesis converged, otherwise false

Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.

◆ UnitPropagationDelay()

double TRANSLINE_CALCULATION_BASE::UnitPropagationDelay ( double  aEpsilonEff)
staticprotected

Calculates the unit propagation delay (ps/cm) for the given effective permittivity.

@aEpsilonEff is the effective permittivity of the material

Definition at line 153 of file transline_calculation_base.cpp.

Referenced by STRIPLINE::Analyse(), COUPLED_STRIPLINE::calcDielectrics(), MICROSTRIP::dispersion(), and COUPLED_MICROSTRIP::er_eff_freq().

Member Data Documentation

◆ m_analysisStatus

std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS> > TRANSLINE_CALCULATION_BASE::m_analysisStatus
protected

Analysis results.

Definition at line 220 of file transline_calculation_base.h.

Referenced by GetAnalysisResults(), and SetAnalysisResult().

◆ m_maxError

constexpr double TRANSLINE_CALCULATION_BASE::m_maxError { 0.000001 }
staticconstexprprotected

The maximum error for Z0 optimisations.

Definition at line 226 of file transline_calculation_base.h.

Referenced by MinimiseZ0Error1D().

◆ m_parameters

std::unordered_map<TRANSLINE_PARAMETERS, double> TRANSLINE_CALCULATION_BASE::m_parameters
protected

All input and output properties used by the calculation.

Definition at line 217 of file transline_calculation_base.h.

Referenced by GetParameter(), GetParameterRef(), InitProperties(), and SetParameter().

◆ m_synthesisStatus

std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS> > TRANSLINE_CALCULATION_BASE::m_synthesisStatus
protected

Synthesis results.

Definition at line 223 of file transline_calculation_base.h.

Referenced by GetSynthesisResults(), and SetSynthesisResult().


The documentation for this class was generated from the following files: