13#ifdef NEED_AND_HAVE_BOOST_BESSEL_FUNC
14#include <boost/math/special_functions/bessel.hpp>
19#include <ns3/double.h>
32constexpr double C = 299792458.0;
45 TypeId(
"ns3::CircularApertureAntennaModel")
47 .SetGroupName(
"Antenna")
49 .AddAttribute(
"AntennaCircularApertureRadius",
50 "The radius of the aperture of the antenna, in meters",
54 .AddAttribute(
"OperatingFrequency",
55 "The operating frequency in Hz of the antenna",
59 .AddAttribute(
"AntennaMinGainDb",
60 "The minimum gain value in dB of the antenna",
64 .AddAttribute(
"AntennaMaxGainDb",
65 "The maximum gain value in dB of the antenna",
76 NS_ASSERT_MSG(aMeter > 0,
"Setting invalid aperture radius: " << aMeter);
90 NS_ASSERT_MSG(freqHz > 0,
"Setting invalid operating frequency: " << freqHz);
136 double theta2 = M_PI_2;
146 Vector p1(sin(theta1) * cos(phi1), sin(theta1) * sin(phi1), cos(theta1));
147 Vector p2(sin(theta2) * cos(phi2), sin(theta2) * sin(phi2), cos(theta2));
150 double theta = acos(p1 * p2);
158 else if (theta >= M_PI_2)
170#ifdef NEED_AND_HAVE_BOOST_BESSEL_FUNC
171 gain = boost::math::cyl_bessel_j(1, kasintheta) / kasintheta;
174 gain = std::cyl_bessel_j(1, kasintheta) / kasintheta;
176 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
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
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...
#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.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)