pcb_calculator, STRIPLINE: fix incorrect formula for conductor loss.

This commit is contained in:
jean-pierre charras 2025-02-22 17:02:09 +01:00
parent e972fb42ee
commit fc9795e95d
2 changed files with 6 additions and 5 deletions

View File

@ -30,9 +30,6 @@
#include "stripline.h"
#include "units.h"
// const to convert a attenuation / loss from log to decibel
const double LOG2DB = 20.0 / log( 10.0 );
STRIPLINE::STRIPLINE() : TRANSLINE()
{
m_Name = "StripLine";
@ -41,7 +38,7 @@ STRIPLINE::STRIPLINE() : TRANSLINE()
// -------------------------------------------------------------------
// calculate characteristic impedance and conductor loss (in log/meter)
// calculate characteristic impedance and conductor loss (in db/meter)
double STRIPLINE::lineImpedance( double height, double& ac )
{
double ZL;
@ -98,7 +95,7 @@ void STRIPLINE::calcAnalyze()
m_parameters[Z0_PRM] = 2.0
/ ( 1.0 / lineImpedance( 2.0 * a + t, ac1 )
+ 1.0 / lineImpedance( 2.0 * ( h - a ) - t, ac2 ) );
m_parameters[LOSS_CONDUCTOR_PRM] = LOG2DB * m_parameters[PHYS_LEN_PRM] * ( ac1 + ac2 );
m_parameters[LOSS_CONDUCTOR_PRM] = m_parameters[PHYS_LEN_PRM] * ( ac1 + ac2 );
m_parameters[LOSS_DIELECTRIC_PRM] = LOG2DB * m_parameters[PHYS_LEN_PRM]
* ( M_PI / C0 ) * m_parameters[FREQUENCY_PRM]
* sqrt( m_parameters[EPSILONR_PRM] )

View File

@ -61,6 +61,10 @@ inline double atanh( double x )
#define C0 299792458.0 // speed of light in vacuum
#define ZF0 376.730313668 // wave resistance in vacuum
// const to convert a attenuation / loss from log (Neper) to decibel
// (1 Np = 8.68589 dB)
const double LOG2DB = 20.0 / log( 10.0 );
// ZF0 value update:
// https://physics.nist.gov/cgi-bin/cuu/Value?z0