11namespace Propagation {
16#ifndef DOXYGEN_SHOULD_SKIP
18 #define DLLEXPORT extern "C" __declspec(dllexport)
20 #define DLLEXPORT extern "C"
106constexpr double PI = 3.1415926535897932384;
109constexpr double C = 299792458.0;
110constexpr double ETA = 119.9169832 *
PI;
128 const double h_tx__meter,
129 const double h_rx__meter,
131 const double P_tx__watt,
134 const double epsilon,
147 const double h_tx__meter,
148 const double h_rx__meter,
150 const double P_tx__watt,
153 const double epsilon,
160 const std::complex<double> delta,
161 const std::complex<double> q,
162 const double h_1__km,
163 const double h_2__km,
170 const double h_1__km,
171 const double h_2__km,
174 const std::complex<double> q
176std::complex<double>
wofz(
const std::complex<double> z);
177std::complex<double>
Airy(
180std::complex<double>
WiRoot(
182 std::complex<double> &DWi,
183 const std::complex<double> q,
184 std::complex<double> &Wi,
189 const double h_tx__meter,
190 const double h_rx__meter,
192 const double P_tx__watt,
195 const double epsilon,
200 const double A,
const double B,
const double maxRelDiff = DBL_EPSILON
std::complex< double > Airy(const std::complex< double > Z, const AiryKind kind, const AiryScaling scaling)
Finds the functions and their derivatives for Airy functions of the first, second,...
Definition Airy.cpp:129
double FlatEarthCurveCorrection(const std::complex< double > delta, const std::complex< double > q, const double h_1__km, const double h_2__km, const double d__km, const double k, const double a_e__km)
Calculates the groundwave field strength using the flat Earth approximation with curvature correction...
Definition FlatEarthCurveCorrection.cpp:35
ReturnCode LFMF(const double h_tx__meter, const double h_rx__meter, const double f__mhz, const double P_tx__watt, const double N_s, const double d__km, const double epsilon, const double sigma, const int pol, Result &result)
Compute the LFMF propagation prediction.
Definition LFMF.cpp:32
bool AlmostEqualRelative(const double A, const double B, const double maxRelDiff)
Relative epsilon comparisons method.
Definition LFMF.cpp:185
ReturnCode LFMF_CPP(const double h_tx__meter, const double h_rx__meter, const double f__mhz, const double P_tx__watt, const double N_s, const double d__km, const double epsilon, const double sigma, const Polarization pol, Result &result)
Compute the LFMF propagation prediction.
Definition LFMF.cpp:78
SolutionMethod
Solution method used to generate model result.
Definition LFMF.h:34
@ RESIDUE_SERIES
Residue series method.
@ FLAT_EARTH_CURVE
Flat earth curve method.
AiryScaling
Multiplicative scaling to use when dealing with Airy functions.
Definition LFMF.h:77
@ HUFFORD
Use Hufford scaling.
constexpr double PI
Approximate value of .
Definition LFMF.h:106
constexpr double epsilon_0
Vacuum permittivity (F/m)
Definition LFMF.h:107
constexpr double a_0__km
Earth radius, in km.
Definition LFMF.h:108
AiryKind
Kinds of Airy functions to specify for Airy() and WiRoot() operation.
Definition LFMF.h:55
@ AIRY
Airy function of the first kind, .
@ DWONE
Derivative of WONE, (Wait's )
@ BAIRY
Airy function of the second kind, .
@ AIRYD
Derivative of AIRY, .
@ DWTWO
Derivative of WTWO, (Wait's )
@ WTWO
Hufford's Airy function of a third kind, (Wait's )
@ WONE
Hufford's Airy function of a third kind, (Wait's )
@ BAIRYD
Derivative of BAIRY, .
ReturnCode
Return Codes defined by this software (0-127)
Definition LFMF.h:87
@ ERROR__POLARIZATION
Invalid value for polarization.
Definition LFMF.h:99
@ ERROR__PATH_DISTANCE
Path distance is out of range.
Definition LFMF.h:96
@ SUCCESS
Return Success.
Definition LFMF.h:88
@ ERROR__FREQUENCY
Frequency is out of range.
Definition LFMF.h:93
@ ERROR__SIGMA
Sigma is out of range.
Definition LFMF.h:98
@ ERROR__TX_POWER
Transmit power is out of range.
Definition LFMF.h:94
@ ERROR__EPSILON
Epsilon is out of range.
Definition LFMF.h:97
@ ERROR__RX_TERMINAL_HEIGHT
RX terminal height is out of range.
Definition LFMF.h:92
@ ERROR__SURFACE_REFRACTIVITY
Surface refractivity is out of range.
Definition LFMF.h:95
@ ERROR__TX_TERMINAL_HEIGHT
TX terminal height is out of range.
Definition LFMF.h:91
constexpr double ETA
Intrinsic impedance of free space (ohms)
Definition LFMF.h:110
Polarization
Valid RF polarizations for use of this model.
Definition LFMF.h:28
@ VERTICAL
Vertical polarization.
@ HORIZONTAL
Horizontal polarization.
constexpr double C
Speed of light (m/s)
Definition LFMF.h:109
double ResidueSeries(const double k, const double h_1__km, const double h_2__km, const double nu, const double theta__rad, const std::complex< double > q)
Calculates the groundwave field strength using the Residue Series method.
Definition ResidueSeries.cpp:25
std::complex< double > WiRoot(const int i, std::complex< double > &DWi, const std::complex< double > q, std::complex< double > &Wi, const AiryKind kind, const AiryScaling scaling)
Finds the roots to the equation .
Definition WiRoot.cpp:54
void FreeReturnStatusCharArray(char *c_msg)
Free the memory allocated by GetReturnStatusCharArray.
Definition ReturnCodes.cpp:85
std::string GetReturnStatus(int code)
Get an error message string from a return code.
Definition ReturnCodes.cpp:31
char * GetReturnStatusCharArray(const int code)
Get an error message string (as C-style string) from a return code.
Definition ReturnCodes.cpp:69
Structure to hold LF/MF model outputs.
Definition LFMF.h:117
double P_rx__dbm
Received power, in dBm.
Definition LFMF.h:120
double A_btl__db
Basic transmission loss, in dB.
Definition LFMF.h:118
double E_dBuVm
Electric field strength, in dB(uV/m)
Definition LFMF.h:119
SolutionMethod method
Method used to obtain results.
Definition LFMF.h:121
std::complex< double > wofz(const std::complex< double > z)
This function computes the Faddeeva function .
Definition wofz.cpp:44