Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ArrayRadiation"
uuid = "bd679b92-6dae-455f-83b3-ba41583ebc1e"
authors = ["Erik Buer <buer94@gmail.com>"]
version = "0.1.2"
version = "0.1.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/Examples/element_radiation_pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ f
using GLMakie
using ArrayRadiation

angleRad = LinRange(0, π, 81);
angleRad = LinRange(-π/2, π/2, 81);

Ge = AntennaElement.yagi_uda.(angleRad)
Ge_dB = DspUtility.pow2db(Ge)
Expand All @@ -164,7 +164,7 @@ Ge_dB = clamp.(Ge_dB, y_lower_limit, Inf)
f = Figure()
ax = PolarAxis(f[1, 1],
title = "Yagi Uda",
thetalimits = (-0, pi),
thetalimits = (-π/2, π/2),
radius_at_origin = -30,
theta_0 = -pi/2,
direction = -1,
Expand Down
32 changes: 17 additions & 15 deletions src/AntennaElement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Optionally provide α. α=1.4 accounts for mutual coupling between elements.

- R. A. Dana, Electronically Scanned Arrays and K-Space Gain Formulation, Springer, 2019.
"""
function cos_taper(θ::Real, α = 1.4)
if (θ>pi/2)
function cos_taper(θ::Real, ϕ::AbstractFloat=0.0, α=1.4)
if (θ > pi / 2)
return 0
end
cos(θ)^α
Expand All @@ -36,7 +36,7 @@ function half_wave_dipole(θ::AbstractFloat, ϕ::AbstractFloat=0.0)
# Variables for empirical modeling.
c1 = 0.7796
c2 = 0.2192
return 1.64 * (c1*sin(θ) + c2*sin(θ)^3)
return 1.64 * (c1 * sin(θ) + c2 * sin(θ)^3)
end

"""
Expand Down Expand Up @@ -82,17 +82,19 @@ The model is based on the following geometry:

"""
function yagi_uda(θ::AbstractFloat, ϕ::AbstractFloat=0.0)
if abs(θ)>π/2
if abs(θ) > π / 2
@warn "The model is only valid for θ ∈ [−π/2, π/2]. Current value: θ = $θ"
end

θ = θ - pi / 2

# Variables for empirical modeling.
c1= 0.7535
c2= -8.1865
c3= 21.9141
c4= 3.7784
c5= -6.5321
return c1 + c2*sin(θ)^2 + c3*sin(θ)^4 + c4*sin(θ)^6 + c5*sin(θ)^8
c1 = 0.7535
c2 = -8.1865
c3 = 21.9141
c4 = 3.7784
c5 = -6.5321
return c1 + c2 * sin(θ)^2 + c3 * sin(θ)^4 + c4 * sin(θ)^6 + c5 * sin(θ)^8
end

"""
Expand All @@ -113,15 +115,15 @@ The model is only valid for θ ∈ [−π/2, π/2].

"""
function microstrip_patch(θ::AbstractFloat, ϕ::AbstractFloat=0.0)
if abs(θ)>π/2
if abs(θ) > π / 2
@warn "The model is only valid for θ ∈ [−π/2, π/2]. Current value: θ = $θ"
end

# Variables for empirical modeling.
c1= 0.9731
c2= -0.8119
c3= 5.7330
return c1 + c2*sin(θ)^4 + c3*cos(θ)^4
c1 = 0.9731
c2 = -0.8119
c3 = 5.7330
return c1 + c2 * sin(θ)^4 + c3 * cos(θ)^4
end

end
Loading