KiCad PCB EDA Suite
|
The base class for all transmission line calculations. More...
#include <transline_calculation_base.h>
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. | |
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.
|
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().
|
inlinevirtual |
Definition at line 115 of file transline_calculation_base.h.
|
pure virtual |
Analyses the transmission line using the current parameter set.
Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.
Referenced by MinimiseZ0Error1D().
|
inlinestaticprotected |
Calculates cosh of the given argument.
Definition at line 211 of file transline_calculation_base.h.
Referenced by COUPLED_STRIPLINE::calcZeroThicknessCoupledImpedances().
|
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.
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().
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & TRANSLINE_CALCULATION_BASE::GetAnalysisResults | ( | ) |
Gets the output parameters following analysis.
Definition at line 36 of file transline_calculation_base.cpp.
References m_analysisStatus, and SetAnalysisResults().
Referenced by C_MICROSTRIP::showAnalyze(), C_STRIPLINE::showAnalyze(), MICROSTRIP_UI::showAnalyze(), STRIPLINE_UI::showAnalyze(), C_MICROSTRIP::showSynthesize(), and C_STRIPLINE::showSynthesize().
|
inline |
Gets the given calculation property.
Definition at line 121 of file transline_calculation_base.h.
References m_parameters.
Referenced by COUPLED_STRIPLINE::Analyse(), STRIPLINE::Analyse(), MICROSTRIP::attenuation(), COUPLED_STRIPLINE::calcDielectrics(), COUPLED_STRIPLINE::calcSingleStripImpedances(), COUPLED_STRIPLINE::calcZ0SymmetricStripline(), COUPLED_MICROSTRIP::compute_single_line(), COUPLED_MICROSTRIP::conductor_losses(), MICROSTRIP::conductor_losses(), COUPLED_MICROSTRIP::delta_u_thickness(), COUPLED_MICROSTRIP::dielectric_losses(), MICROSTRIP::dielectric_losses(), MICROSTRIP::dispersion(), COUPLED_MICROSTRIP::er_eff_freq(), COUPLED_MICROSTRIP::er_eff_static(), COUPLED_MICROSTRIP::line_angle(), MICROSTRIP::line_angle(), STRIPLINE::lineImpedance(), MICROSTRIP::microstrip_Z0(), MinimiseZ0Error1D(), MICROSTRIP::mur_eff_ms(), COUPLED_MICROSTRIP::SetAnalysisResults(), COUPLED_STRIPLINE::SetAnalysisResults(), MICROSTRIP::SetAnalysisResults(), STRIPLINE::SetAnalysisResults(), COUPLED_MICROSTRIP::SetSynthesisResults(), COUPLED_STRIPLINE::SetSynthesisResults(), MICROSTRIP::SetSynthesisResults(), STRIPLINE::SetSynthesisResults(), SkinDepth(), COUPLED_MICROSTRIP::syn_fun(), COUPLED_MICROSTRIP::synth_width(), COUPLED_MICROSTRIP::Synthesize(), COUPLED_STRIPLINE::Synthesize(), MICROSTRIP::Synthesize(), MICROSTRIP::SynthesizeWidth(), COUPLED_MICROSTRIP::Z0_dispersion(), and COUPLED_MICROSTRIP::Z0_even_odd().
|
inline |
Adds a constant to the given parameter.
Definition at line 124 of file transline_calculation_base.h.
References m_parameters.
Referenced by MinimiseZ0Error1D().
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().
|
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().
|
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
aOptimise | Parameter to optimise |
aMeasure | The parameter to measure / optimise against |
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().
|
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
aParam1 | First parameter to optimise |
aParam2 | Secpmd parameter to optimise |
|
inlinestaticprotected |
Calculates sech of the given argument.
Definition at line 214 of file transline_calculation_base.h.
Referenced by COUPLED_STRIPLINE::calcSingleStripImpedances().
|
protected |
Sets an analysis result.
Definition at line 51 of file transline_calculation_base.cpp.
References m_analysisStatus.
Referenced by COUPLED_MICROSTRIP::SetAnalysisResults(), COUPLED_STRIPLINE::SetAnalysisResults(), MICROSTRIP::SetAnalysisResults(), STRIPLINE::SetAnalysisResults(), and COUPLED_MICROSTRIP::SetSynthesisResults().
|
protectedpure virtual |
Sets values in the output analysis results structure.
Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.
Referenced by GetAnalysisResults().
|
inline |
Sets the given calculation property.
Definition at line 118 of file transline_calculation_base.h.
References m_parameters.
Referenced by COUPLED_STRIPLINE::Analyse(), STRIPLINE::Analyse(), COUPLED_MICROSTRIP::attenuation(), MICROSTRIP::attenuation(), COUPLED_STRIPLINE::calcZ0EvenMode(), COUPLED_STRIPLINE::calcZ0OddMode(), COUPLED_STRIPLINE::calcZ0SymmetricStripline(), COUPLED_MICROSTRIP::compute_single_line(), MICROSTRIP::dispersion(), C_MICROSTRIP::getProperties(), C_STRIPLINE::getProperties(), MICROSTRIP_UI::getProperties(), STRIPLINE_UI::getProperties(), MICROSTRIP::line_angle(), MICROSTRIP::microstrip_Z0(), MinimiseZ0Error1D(), COUPLED_MICROSTRIP::syn_fun(), COUPLED_MICROSTRIP::synth_width(), COUPLED_MICROSTRIP::Synthesize(), COUPLED_STRIPLINE::Synthesize(), MICROSTRIP::Synthesize(), and COUPLED_MICROSTRIP::Z0_dispersion().
|
protected |
Sets a synthesis result.
Definition at line 58 of file transline_calculation_base.cpp.
References m_synthesisStatus.
Referenced by COUPLED_STRIPLINE::SetSynthesisResults(), MICROSTRIP::SetSynthesisResults(), and STRIPLINE::SetSynthesisResults().
|
protectedpure virtual |
Sets values in the output synthesis results structure.
Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.
Referenced by GetSynthesisResults().
|
protected |
Calculate skin depth.
Definition at line 144 of file transline_calculation_base.cpp.
References GetParameter(), and TRANSLINE_CALCULATIONS::MU0.
Referenced by COUPLED_STRIPLINE::Analyse(), STRIPLINE::Analyse(), COUPLED_MICROSTRIP::attenuation(), and MICROSTRIP::attenuation().
|
pure virtual |
Synthesis the transmission line using the current parameter set target.
Implemented in COUPLED_MICROSTRIP, COUPLED_STRIPLINE, MICROSTRIP, and STRIPLINE.
|
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().
|
protected |
Analysis results.
Definition at line 220 of file transline_calculation_base.h.
Referenced by GetAnalysisResults(), and SetAnalysisResult().
|
staticconstexprprotected |
The maximum error for Z0 optimisations.
Definition at line 226 of file transline_calculation_base.h.
Referenced by MinimiseZ0Error1D().
|
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().
|
protected |
Synthesis results.
Definition at line 223 of file transline_calculation_base.h.
Referenced by GetSynthesisResults(), and SetSynthesisResult().