diff --git a/Project.toml b/Project.toml index 4ce0c84..a4cfc7f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ArrayRadiation" uuid = "bd679b92-6dae-455f-83b3-ba41583ebc1e" authors = ["Erik Buer "] -version = "0.1.2" +version = "0.1.3" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/docs/src/Examples/element_radiation_pattern.md b/docs/src/Examples/element_radiation_pattern.md index 6827b77..d00586f 100644 --- a/docs/src/Examples/element_radiation_pattern.md +++ b/docs/src/Examples/element_radiation_pattern.md @@ -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) @@ -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, diff --git a/src/AntennaElement.jl b/src/AntennaElement.jl index e4924b3..2ef3ac2 100644 --- a/src/AntennaElement.jl +++ b/src/AntennaElement.jl @@ -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(θ)^α @@ -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 """ @@ -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 """ @@ -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 \ No newline at end of file