From f3ca0f16e693370e76c9859ba33b12f063282691 Mon Sep 17 00:00:00 2001 From: J RB Date: Wed, 3 Nov 2021 21:03:28 +0000 Subject: [PATCH] updated Z0 to accepted value, update ZTEM10 <-> a calc/synth as per #9146 --- pcb_calculator/transline/rectwaveguide.cpp | 35 ++++++++++------------ pcb_calculator/transline/units.h | 5 +++- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pcb_calculator/transline/rectwaveguide.cpp b/pcb_calculator/transline/rectwaveguide.cpp index b7b8a7001f..e7b26082e8 100644 --- a/pcb_calculator/transline/rectwaveguide.cpp +++ b/pcb_calculator/transline/rectwaveguide.cpp @@ -238,6 +238,7 @@ void RECTWAVEGUIDE::get_rectwaveguide_phys() /* * analyze - analysis function + * source: https://empossible.net/wp-content/uploads/2018/03/Lecture-5c-Rectangular-waveguide.pdf */ void RECTWAVEGUIDE::calcAnalyze() { @@ -252,9 +253,8 @@ void RECTWAVEGUIDE::calcAnalyze() // Z0 definition using fictive voltages and currents m_parameters[Z0_PRM] = - 2.0 * ZF0 * sqrt( m_parameters[MUR_PRM] / m_parameters[EPSILONR_PRM] ) - * ( m_parameters[PHYS_B_PRM] / m_parameters[PHYS_A_PRM] ) - / sqrt( 1.0 - pow( ( fc( 1, 0 ) / m_parameters[FREQUENCY_PRM] ), 2.0 ) ); + ZF0 * sqrt( m_parameters[MUR_PRM] / m_parameters[EPSILONR_PRM] ) + / sqrt( 1.0 - pow( ( fc( 1, 0 ) / m_parameters[FREQUENCY_PRM] ), 2.0 ) ); /* calculate electrical angle */ lambda_g = 2.0 * M_PI / sqrt( k_square - kc_square( 1, 0 ) ); @@ -278,26 +278,23 @@ void RECTWAVEGUIDE::calcAnalyze() /* * synthesize - synthesis function + * source: re-arrangment of calcAnalyze equation + * TE10 (via fc(1,0) ) results in the b term not influencing the result, as long as + * 1) fc > f + * 2) a > b */ void RECTWAVEGUIDE::calcSynthesize() { double lambda_g, k_square, beta; - - if( isSelected( PHYS_B_PRM ) ) - { - /* solve for b */ - m_parameters[PHYS_B_PRM] = - m_parameters[Z0_PRM] * m_parameters[PHYS_A_PRM] - * sqrt( 1.0 - pow( fc( 1, 0 ) / m_parameters[FREQUENCY_PRM], 2.0 ) ) - / ( 2.0 * ZF0 * sqrt( m_parameters[MUR_PRM] / m_parameters[EPSILONR_PRM] ) ); - } - else if( isSelected( PHYS_A_PRM ) ) - { - /* solve for a */ - m_parameters[PHYS_A_PRM] = - sqrt( pow( 2.0 * ZF0 * m_parameters[PHYS_B_PRM] / m_parameters[Z0_PRM], 2.0 ) - + pow( C0 / ( 2.0 * m_parameters[FREQUENCY_PRM] ), 2.0 ) ); - } + /* solve for a */ + m_parameters[PHYS_A_PRM] = + C0 + / ( sqrt( ( m_parameters[MUR_PRM] * m_parameters[EPSILONR_PRM] ) ) * 2 + * m_parameters[FREQUENCY_PRM] * sqrt( 1 + - pow( ( ZF0 * sqrt( m_parameters[MUR_PRM] + / m_parameters[EPSILONR_PRM] ) ) + / m_parameters[Z0_PRM] + ,2.0 ) ) ); k_square = kval_square(); beta = sqrt( k_square - kc_square( 1, 0 ) ); diff --git a/pcb_calculator/transline/units.h b/pcb_calculator/transline/units.h index d604d5448c..542a294700 100644 --- a/pcb_calculator/transline/units.h +++ b/pcb_calculator/transline/units.h @@ -59,6 +59,9 @@ inline double atanh( double x ) #define MU0 12.566370614e-7 // magnetic constant #define C0 299792458.0 // speed of light in vacuum -#define ZF0 376.73031346958504364963 // wave resistance in vacuum +#define ZF0 376.730313668 // wave resistance in vacuum + +// ZF0 value update: +// https://physics.nist.gov/cgi-bin/cuu/Value?z0 #endif /* __UNITS_H */