3 #include <maths/EnergyMaths.h>
19 double const eps = 0.00001;
56 std::vector<double> I0({450, 575, 250, 75, 370, 40, 30, 900});
57 std::vector<double> lambda(
58 {0.3, 0.6, 0.0001, 0.001, 0.005, 0.01, 0.05, 0.1}
60 std::vector<double> R({7.5, 6.3, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0});
61 std::vector<double> R0({8.0, 9.0, 0.1, 0.5, 1.0, 5.0, 10.0, 15.0});
62 std::vector<double> r({0.33, 0.67, 0.09, 13, 0.55, 0.26, 0.19, 7.4});
63 std::vector<double> w0({0.9, 0.6, 0.05, 0.1, 0.3, 1.0, 1.5, 1.3});
64 std::vector<double> Dr2({0.9, 0.8, 0.1, 0.2, 0.7, 0.3, 0.6, 0.5});
65 std::vector<double> Bt2({0.7, 0.6, 0.5, 0.4, 0.05, 0.1, 0.2, 0.3});
66 std::vector<double> etaSys({1.1, 0.3, 0.6, 0.9, 1.2, 1.0, 0.5, 0.1});
67 std::vector<double> ae({0.0, 0.05, 0.1, 0.15, 0.23, 0.17, 0.09, 0.009});
68 std::vector<double> sigma({3.0, 0.5, 0.4, 0.3, 0.6, 0.7, 1.5, 2.0});
71 size_t const nTests = I0.size();
72 for(
size_t i = 0 ; i < nTests ; ++i){
75 I0[i], lambda[i], R[i], R0[i], r[i], w0[i]
78 I0[i], lambda[i], R[i], R0[i], r[i], w0[i]
80 if(std::fabs(PeNew-PeOld) >
eps)
return false;
83 I0[i], lambda[i], R[i], R0[i], r[i], w0[i],
84 Dr2[i], Bt2[i], etaSys[i], ae[i], sigma[i]
87 PeOld, Dr2[i], R[i], Bt2[i], etaSys[i],
91 if(std::fabs(PrNew-PrOld) >
eps)
return false;
static double calcEmittedPowerLegacy(double const I0, double const lambda, double const R, double const R0, double const r, double const w0)
Legacy version of EnergyMaths::calcEmittedPower.
Definition: EnergyMaths.cpp:19
static double calcReceivedPower(double const I0, double const lambda, double const R, double const R0, double const r, double const w0, double const Dr2, double const Bt2, double const etaSys, double const ae, double const sigma)
Solve the laser radar equation.
Definition: EnergyMaths.cpp:35
static double calcEmittedPower(double const I0, double const lambda, double const R, double const R0, double const r, double const w0)
Compute the space distribution equation to calculate the beam energy decreasing the further away from...
Definition: EnergyMaths.cpp:7
static double calcReceivedPowerLegacy(double const Pe, double const Dr2, double const R, double const Bt2, double const etaSys, double const etaAtm, double const sigma)
Legacy version of EnergyMaths::calcReceivedPower.
Definition: EnergyMaths.cpp:58
static double calcAtmosphericFactor(double const R, double const ae)
Compute the atmospheric factor , understood as the energy left after attenuation by air partciles in ...
Definition: EnergyMaths.cpp:74
BaseTest class.
Definition: BaseTest.h:20
Energy models test.
Definition: EnergyModelsTest.h:12
double const eps
Decimal precision for validation purposes.
Definition: EnergyModelsTest.h:19
EnergyModelsTest()
Energy models test constructor.
Definition: EnergyModelsTest.h:26
bool testEmittedReceivedPower()
Test emitted received power.
Definition: EnergyModelsTest.h:54
bool run() override
Definition: EnergyModelsTest.h:46