Skip to content

Instantly share code, notes, and snippets.

@rolambert
Last active January 11, 2021 22:23
Show Gist options
  • Save rolambert/b73c7fbe51c139587879b1a00132ac71 to your computer and use it in GitHub Desktop.
Save rolambert/b73c7fbe51c139587879b1a00132ac71 to your computer and use it in GitHub Desktop.
# Author: Robert J Lambert
# Revision: 0.1.0
param(
[array]$val, #Units
[switch]$waveleng, #m
[switch]$freq, #1/s
[switch]$da, #10
[switch]$hecto, #10^2
[switch]$kilo, #10^3
[switch]$Mega, #10^6
[switch]$giga, #10^9
[switch]$tera, #10^12
[switch]$peta, #10^15
[switch]$exa, #10^18
[uint32]$n
)
function wrongvars{
write-host "Wrong Parameters"
break
}
if(($waveleng -eq $null) -and ($freq -eq $null)){
wrongvars
}
$anntenna= @()
$y = $null
function siUnitConvert($var){
if($Da){$f= $var*10}
if($Hecto){$f= $var*100}
if($kilo){$f= $var*1000}
if($Mega){$f= $var*1000000}
if($Giga){$f= $var*1000000000}
if($Tera){$f= $var*1000000000000}
if($Peta){$f= $var*1000000000000000}
if($Exa){$f= $var*1000000000000000000}
$f
}
if($freq){
$val | %{
$anntenna += New-Object -TypeName psobject -Property @{
freq = siunit($_)
freqExpNegOne = 1/(siunit($_))
lambda = 299792458*(1/(siunit($_)))#m/s*s
diameter = (299792458*(1/(siunit($_))))/3.14159 #Diameter is close to a C/pi where 1*lambda -eq C
#inequalites roughly determine the operating bandwidth of the helix antenna 3/4*lambda -lt C -gt 3/4*lambda
period = 0.22 * 299792458*(1/(siunit($_)))
minGroundPlaneLength = (0.8*299792458*(1/(siunit($_))))
#D is gt or eq to Gdelta
wireGuage = 0.11 * 299792458*(1/(siunit($_))) #wiregage
groundPlaneGap = 0.02* 299792458*(1/(siunit($_)))
coils = $n
length = $n * (0.22 * 299792458*(1/(siunit($_))))
gain = 6.2*(299792458*299792458)*$n #The gain of the helix antenna can be approximated by:
Impedance = 140 * (299792458*(1/(siunit($_))))/(299792458*(1/(siunit($_))))
}
}
}else{$lambda = $val}
if($anntenna.length -gt 0){
$anntenna
}
<#
.SYNOPSIS
Field Expedient Helix Antenna Metrics:
1. one turn is approximately λ
2. the antenna radiates in the axial mode
.DESCRIPTION
D diameter of he
S intervals between turns
Axial length(nS)
d diameter of conductor in helix
G ground plane diameter
n number of turns
.PARAMETER val
The value that is the metric for either Hz or lambda wave lenght
.EXAMPLE
PS> & .\Antenna.ps1 -val 1574 -freq -Mega
The Road goes ever on and on
Out from the door where it began.
Now far ahead the Road has gone,
Let others follow it who can!
Let them a journey new begin,
But I at last with weary feet
Will turn towards the lighted inn,
My evening-rest and sleep to meet.
— J. R. R. Tolkien
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment