13#ifdef NEED_AND_HAVE_BOOST_BESSEL_FUNC
14#include <boost/math/special_functions/bessel.hpp>
19#include "ns3/boolean.h"
20#include "ns3/double.h"
33constexpr double C = 299792458.0;
46 TypeId(
"ns3::CircularApertureAntennaModel")
48 .SetGroupName(
"Antenna")
50 .AddAttribute(
"AntennaCircularApertureRadius",
51 "The radius of the aperture of the antenna, in meters",
55 .AddAttribute(
"OperatingFrequency",
56 "The operating frequency in Hz of the antenna",
60 .AddAttribute(
"AntennaMinGainDb",
61 "The minimum gain value in dB of the antenna",
65 .AddAttribute(
"AntennaMaxGainDb",
66 "The maximum gain value in dB of the antenna",
70 .AddAttribute(
"ForceGainBounds",
71 "Force GetGainDb to [AntennaMinGainDb, AntennaMaxGainDb] range",
82 NS_ASSERT_MSG(aMeter > 0,
"Setting invalid aperture radius: " << aMeter);
96 NS_ASSERT_MSG(freqHz > 0,
"Setting invalid operating frequency: " << freqHz);
142 double theta2 = M_PI_2;
152 Vector p1(sin(theta1) * cos(phi1), sin(theta1) * sin(phi1), cos(theta1));
153 Vector p2(sin(theta2) * cos(phi2), sin(theta2) * sin(phi2), cos(theta2));
156 double theta = acos(p1 * p2);
164 else if (theta >= M_PI_2)
176#ifdef NEED_AND_HAVE_BOOST_BESSEL_FUNC
177 gain = boost::math::cyl_bessel_j(1, kasintheta) / kasintheta;
180 gain = std::cyl_bessel_j(1, kasintheta) / kasintheta;
182 gain = 10 * log10(4 * gain * gain) +
m_maxGain;
Class CircularApertureAntennaModel declaration.
Class holding the azimuth and inclination angles of spherical coordinates.
double GetInclination() const
Getter for inclination angle.
double GetAzimuth() const
Getter for azimuth angle.
interface for antenna radiation pattern models
AttributeValue implementation for Boolean.
Circular Aperture Antenna Model.
double m_maxGain
antenna gain in dB towards the main orientation
void SetApertureRadius(double aMeter)
Set the antenna aperture radius.
void SetOperatingFrequency(double freqHz)
Set the antenna operating frequency.
double m_apertureRadiusMeter
antenna aperture radius in meters
bool m_forceGainBounds
enforce maximum and minimum gains (disabled for testing)
double m_operatingFrequencyHz
antenna operating frequency in Hz
void SetMinGain(double gainDb)
Set the antenna min gain.
double m_minGain
antenna min gain in dB
double GetMaxGain() const
Return the antenna max gain.
double GetOperatingFrequency() const
Return the antenna operating frequency.
double GetMinGain() const
Return the antenna min gain.
double GetGainDb(Angles a) override
Get the gain in dB, using Bessel equation of first kind and first order.
void SetMaxGain(double gainDb)
Set the antenna max gain.
static TypeId GetTypeId()
Register this type.
double GetApertureRadius() const
Return the antenna aperture radius.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
log2() macro definition; to deal with Bug 1467 .
constexpr double C
speed of light in vacuum, in m/s
Every class exported by the ns3 library is enclosed in the ns3 namespace.