Skip to content

Commit 2c43216

Browse files
committed
Merge branch 'feature/rcs'
2 parents 070641a + 462641f commit 2c43216

File tree

8 files changed

+182
-3
lines changed

8 files changed

+182
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SphericalScattering"
22
uuid = "1a9ea918-b599-4f1f-bd9a-d681e8bb5b3e"
33
authors = ["Bernd Hofmann <Bernd.Hofmann@tum.de> and contributors"]
4-
version = "0.7.0"
4+
version = "0.7.1"
55

66
[deps]
77
LegendrePolynomials = "3db4a2ba-fc88-11e8-3e01-49c72059a882"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following aspects are implemented (✔) and planned (⌛):
4040
##### Available quantities (where applicable):
4141
- ✔ Far-fields
4242
- ✔ Near-fields (electric & magnetic)
43-
- Radar cross section (RCS)
43+
- Radar cross section (RCS)
4444
- ⌛ Surface currents
4545
- ✔ Scalar potentials
4646
- ✔ Displacement fields

docs/src/application.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,80 @@ print("Far-field error: $diff_FF %\n")
9191
[CompScienceMeshes](https://github.com/krcools/CompScienceMeshes.jl) are used to define several functional tests.
9292

9393

94+
---
95+
## [Radar Cross Section](@id rcsApplication)
96+
97+
The monostatic and the bistatic [radar cross section (RCS)](@ref rcsPW) can be evaluated.
98+
99+
### Monostatic RCS
100+
101+
The monostatic radar cross section as a function of the sphere radius can be computed as follows (compare also the plot in [[1, pp. 352ff]](@ref refs)):
102+
```@example RCS
103+
using SphericalScattering
104+
using PlotlyJS
105+
106+
f = 1e8
107+
c = 2.99792458e8 # speed of light
108+
λ = c / f
109+
110+
RCS = Float64[]
111+
aTλ = Float64[]
112+
113+
# --- compute RCS
114+
for rg in 0.01:0.01:3.0
115+
116+
a = λ*rg
117+
118+
monoRCS = rcs(PECSphere(radius=a), planeWave(frequency=f))
119+
120+
push!(RCS, monoRCS / (π * a^2))
121+
push!(aTλ, rg)
122+
end
123+
124+
# --- plot
125+
layout = Layout(
126+
yaxis=attr(title_text="RCS / πa² in dB"),
127+
xaxis=attr(title_text="a / λ")
128+
)
129+
130+
plot(scatter(; x=aTλ, y=10*log10.(RCS), mode="lines+markers"), layout)
131+
t = plot(scatter(; x=aTλ, y=10*log10.(RCS), mode="lines+markers"), layout) # hide
132+
savefig(t, "monoRCS.html"); nothing # hide
133+
```
134+
135+
```@raw html
136+
<object data="../monoRCS.html" type="text/html" style="width:100%;height:50vh;"> </object>
137+
```
138+
139+
### Bistatic RCS
140+
141+
The bistatic radar cross section along a ϑ-cut can be computed as follows (compare also the plot in [[1, pp. 351ff]](@ref refs)):
142+
```@example RCS
143+
using StaticArrays
144+
145+
# --- points
146+
ϑ = [i*π/500 for i in 0:500]
147+
φ = 0
148+
points_cart = [SphericalScattering.sph2cart(SVector(1.0, ϑi, φ)) for ϑi in ϑ]
149+
150+
# --- compute RCS
151+
biRCS = rcs(PECSphere(radius=λ), planeWave(frequency=1e8), points_cart) / λ^2
152+
153+
# --- plot
154+
layout = Layout(
155+
yaxis=attr(title_text="RCS / λ² in dB"),
156+
xaxis=attr(title_text="ϑ in degree")
157+
)
158+
159+
plot(scatter(; x=ϑ*180/π, y=10*log10.(biRCS), mode="lines+markers"), layout)
160+
t = plot(scatter(; x=ϑ*180/π, y=10*log10.(biRCS), mode="lines+markers"), layout) # hide
161+
savefig(t, "biRCS.html"); nothing # hide
162+
```
163+
164+
```@raw html
165+
<object data="../biRCS.html" type="text/html" style="width:100%;height:50vh;"> </object>
166+
```
167+
94168

95169

96170
---

docs/src/manual.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,31 @@ E = field(sp, ex, ElectricField(point_cart))
135135
H = field(sp, ex, MagneticField(point_cart))
136136

137137
FF = field(sp, ex, FarField(point_cart))
138-
139138
```
140139
For the uniform field excitation, only the electric field as well as the scalar potential can be calculated:
141140
```julia
142141
Φ = field(sp, ex, ScalarPotential(point_cart))
143142
```
144143

145144

145+
---
146+
## Radar Cross Section
147+
148+
To compute the bistatic [radar cross section (RCS)](@ref rcsPW), the function
149+
```julia
150+
σ = rcs(sp, ex, points_cart)
151+
```
152+
is provided. For the monostatic RCS, the function
153+
```julia
154+
σ = rcs(sp, ex)
155+
```
156+
is provided.
157+
158+
!!! note
159+
The RCS is (so far) only defined for a plane wave excitation.
160+
161+
162+
146163
---
147164
## Conversion Between Bases
148165

docs/src/planeWave.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,21 @@ H = field(sp, ex, MagneticField(point_cart))
9595

9696
!!! note
9797
The total far-field is not defined (since the incident far-field is not defined).
98+
99+
100+
---
101+
## [Radar Cross Section](@id rcsPW)
102+
103+
To compute the bistatic radar cross section (RCS) [[1, pp. 350ff]](@ref refs)
104+
```math
105+
\sigma (\vartheta, \varphi) = \lim_{r\rightarrow \infty} \left( 4 \pi r^2 \frac{{|e^\mathrm{sc}|}^2}{{|e^\mathrm{sc}|}^2} \right)
106+
```
107+
the function
108+
```julia
109+
σ = rcs(sp, ex, points_cart)
110+
```
111+
is provided. For the monostatic RCS, the function
112+
```julia
113+
σ = rcs(sp, ex)
114+
```
115+
is provided.

src/SphericalScattering.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export SphericalMode, SphericalModeTE, SphericalModeTM
4343
export PECSphere, DielectricSphere, LayeredSphere, LayeredSpherePEC
4444
export DielectricSphereThinImpedanceLayer
4545
export field, scatteredfield
46+
export rcs
4647
export sphericalGridPoints, phiCutPoints, thetaCutPoints
4748

4849

@@ -82,6 +83,7 @@ include("UniformField/scattered.jl")
8283
include("totalFields.jl")
8384
include("coordinateTransforms.jl")
8485
include("utils.jl")
86+
include("rcs.jl")
8587

8688
if !isdefined(Base, :get_extension)
8789
include("../ext/SphericalScatteringExt.jl") # for backwards compatibility with julia versions below 1.9

src/rcs.jl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
"""
3+
rcs(sphere::Sphere, excitation::PlaneWave, point_cart; parameter::Parameter=Parameter())
4+
5+
Compute the bistatic radar cross-section (RCS).
6+
"""
7+
function rcs(sphere::Sphere, excitation::PlaneWave, points_cart; parameter::Parameter=Parameter())
8+
9+
FF = scatteredfield(sphere, excitation, FarField(points_cart); parameter=parameter)
10+
11+
return 4π * norm.(FF) .^ 2 / abs2(excitation.amplitude)
12+
end
13+
14+
15+
16+
"""
17+
rcs(sphere::Sphere, excitation::PlaneWave; parameter::Parameter=Parameter())
18+
19+
Compute the monostatic radar cross-section (RCS): the bistatic RCS solely for the incident direction of the plane wave.
20+
"""
21+
function rcs(sphere::Sphere, excitation::PlaneWave; parameter::Parameter=Parameter())
22+
23+
point_cart = -excitation.direction
24+
25+
return rcs(sphere, excitation, [point_cart]; parameter=parameter)[1]
26+
end
27+
28+
29+
30+
"""
31+
rcs(sphere::Sphere, excitation::Excitation, point_cart; parameter::Parameter=Parameter())
32+
33+
RCS only defined for plane waves, so far.
34+
"""
35+
function rcs(sphere::Sphere, excitation::Excitation, point_cart; parameter::Parameter=Parameter())
36+
37+
return error("The (bistatic) RCS is only defined for a plane-wave excitation (so far).")
38+
end
39+
40+
41+
42+
"""
43+
rcs(sphere::Sphere, excitation::Excitation; parameter::Parameter=Parameter())
44+
45+
RCS only defined for plane waves, so far.
46+
"""
47+
function rcs(sphere::Sphere, excitation::Excitation; parameter::Parameter=Parameter())
48+
49+
return error("The (monostatic) RCS is only defined for a plane-wave excitation (so far).")
50+
end

test/utils.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,21 @@ end
3939
@test_nowarn plotffcut(norm.(FF), points_sph, normalize=true, scale="log", format="rectangular")
4040
@test_nowarn plotffcut(norm.(FF), points_sph, normalize=true, scale="linear", format="rectangular")
4141
end
42+
43+
@testset "Radar cross section" begin
44+
45+
# --- monostatic RCS
46+
@test_nowarn rcs(PECSphere(; radius=2.0), planeWave(; frequency=1e8))
47+
48+
@test_throws ErrorException("The (monostatic) RCS is only defined for a plane-wave excitation (so far).") rcs(
49+
PECSphere(; radius=1.0), SphericalModeTE(; frequency=f)
50+
)
51+
52+
53+
# --- bistatic RCS
54+
@test_nowarn rcs(PECSphere(; radius=2.0), planeWave(; frequency=1e8), [SVector(1.0, 0.0, 0.0)])
55+
56+
@test_throws ErrorException("The (bistatic) RCS is only defined for a plane-wave excitation (so far).") rcs(
57+
PECSphere(; radius=1.0), SphericalModeTE(; frequency=f), []
58+
)
59+
end

0 commit comments

Comments
 (0)