Browse Source

prvi komit

master
Andrej 1 month ago
commit
68a1359c6b
  1. BIN
      dva/ang-1.8.pdf
  2. BIN
      dva/ang-2.0.pdf
  3. BIN
      dva/ang-2.5.pdf
  4. BIN
      dva/ang-3.0.pdf
  5. BIN
      dva/ang-3.5.pdf
  6. BIN
      dva/ang-3.9.pdf
  7. BIN
      dva/ang-4.0.pdf
  8. BIN
      dva/ang-4.4.pdf
  9. BIN
      dva/ang-4.5.pdf
  10. BIN
      dva/ang-5.0.pdf
  11. BIN
      dva/s11-1.8.pdf
  12. BIN
      dva/s11-2.0.pdf
  13. BIN
      dva/s11-2.5.pdf
  14. BIN
      dva/s11-3.0.pdf
  15. BIN
      dva/s11-3.5.pdf
  16. BIN
      dva/s11-3.9.pdf
  17. BIN
      dva/s11-4.0.pdf
  18. BIN
      dva/s11-4.4.pdf
  19. BIN
      dva/s11-4.5.pdf
  20. BIN
      dva/s11-5.0.pdf
  21. BIN
      dva/s21-1.8.pdf
  22. BIN
      dva/s21-2.0.pdf
  23. BIN
      dva/s21-2.5.pdf
  24. BIN
      dva/s21-3.0.pdf
  25. BIN
      dva/s21-3.5.pdf
  26. BIN
      dva/s21-3.9.pdf
  27. BIN
      dva/s21-4.0.pdf
  28. BIN
      dva/s21-4.4.pdf
  29. BIN
      dva/s21-4.5.pdf
  30. BIN
      dva/s21-5.0.pdf
  31. BIN
      ena/ang-1.8.pdf
  32. BIN
      ena/ang-2.0.pdf
  33. BIN
      ena/ang-2.5.pdf
  34. BIN
      ena/ang-3.0.pdf
  35. BIN
      ena/ang-3.5.pdf
  36. BIN
      ena/ang-3.9.pdf
  37. BIN
      ena/ang-4.0.pdf
  38. BIN
      ena/ang-4.4.pdf
  39. BIN
      ena/ang-4.5.pdf
  40. BIN
      ena/ang-5.0.pdf
  41. BIN
      ena/s11-1.8.pdf
  42. BIN
      ena/s11-2.0.pdf
  43. BIN
      ena/s11-2.5.pdf
  44. BIN
      ena/s11-3.0.pdf
  45. BIN
      ena/s11-3.5.pdf
  46. BIN
      ena/s11-3.9.pdf
  47. BIN
      ena/s11-4.0.pdf
  48. BIN
      ena/s11-4.4.pdf
  49. BIN
      ena/s11-4.5.pdf
  50. BIN
      ena/s11-5.0.pdf
  51. BIN
      ena/s21-1.8.pdf
  52. BIN
      ena/s21-2.0.pdf
  53. BIN
      ena/s21-2.5.pdf
  54. BIN
      ena/s21-3.0.pdf
  55. BIN
      ena/s21-3.5.pdf
  56. BIN
      ena/s21-3.9.pdf
  57. BIN
      ena/s21-4.0.pdf
  58. BIN
      ena/s21-4.4.pdf
  59. BIN
      ena/s21-4.5.pdf
  60. BIN
      ena/s21-5.0.pdf
  61. BIN
      enastopnja/ang-10.0.pdf
  62. BIN
      enastopnja/ang-4.0.pdf
  63. BIN
      enastopnja/ang-4.5.pdf
  64. BIN
      enastopnja/ang-5.0.pdf
  65. BIN
      enastopnja/ang-5.5.pdf
  66. BIN
      enastopnja/ang-6.0.pdf
  67. BIN
      enastopnja/ang-6.5.pdf
  68. BIN
      enastopnja/ang-7.0.pdf
  69. BIN
      enastopnja/ang-7.5.pdf
  70. BIN
      enastopnja/ang-8.0.pdf
  71. BIN
      enastopnja/ang-8.5.pdf
  72. BIN
      enastopnja/ang-9.0.pdf
  73. BIN
      enastopnja/ang-9.5.pdf
  74. BIN
      enastopnja/s11-10.0.pdf
  75. BIN
      enastopnja/s11-4.0.pdf
  76. BIN
      enastopnja/s11-4.5.pdf
  77. BIN
      enastopnja/s11-5.0.pdf
  78. BIN
      enastopnja/s11-5.5.pdf
  79. BIN
      enastopnja/s11-6.0.pdf
  80. BIN
      enastopnja/s11-6.5.pdf
  81. BIN
      enastopnja/s11-7.0.pdf
  82. BIN
      enastopnja/s11-7.5.pdf
  83. BIN
      enastopnja/s11-8.0.pdf
  84. BIN
      enastopnja/s11-8.5.pdf
  85. BIN
      enastopnja/s11-9.0.pdf
  86. BIN
      enastopnja/s11-9.5.pdf
  87. BIN
      enastopnja/s21-10.0.pdf
  88. BIN
      enastopnja/s21-4.0.pdf
  89. BIN
      enastopnja/s21-4.5.pdf
  90. BIN
      enastopnja/s21-5.0.pdf
  91. BIN
      enastopnja/s21-5.5.pdf
  92. BIN
      enastopnja/s21-6.0.pdf
  93. BIN
      enastopnja/s21-6.5.pdf
  94. BIN
      enastopnja/s21-7.0.pdf
  95. BIN
      enastopnja/s21-7.5.pdf
  96. BIN
      enastopnja/s21-8.0.pdf
  97. BIN
      enastopnja/s21-8.5.pdf
  98. BIN
      enastopnja/s21-9.0.pdf
  99. BIN
      enastopnja/s21-9.5.pdf
  100. 128
      nri.jl

BIN
dva/ang-1.8.pdf

BIN
dva/ang-2.0.pdf

BIN
dva/ang-2.5.pdf

BIN
dva/ang-3.0.pdf

BIN
dva/ang-3.5.pdf

BIN
dva/ang-3.9.pdf

BIN
dva/ang-4.0.pdf

BIN
dva/ang-4.4.pdf

BIN
dva/ang-4.5.pdf

BIN
dva/ang-5.0.pdf

BIN
dva/s11-1.8.pdf

BIN
dva/s11-2.0.pdf

BIN
dva/s11-2.5.pdf

BIN
dva/s11-3.0.pdf

BIN
dva/s11-3.5.pdf

BIN
dva/s11-3.9.pdf

BIN
dva/s11-4.0.pdf

BIN
dva/s11-4.4.pdf

BIN
dva/s11-4.5.pdf

BIN
dva/s11-5.0.pdf

BIN
dva/s21-1.8.pdf

BIN
dva/s21-2.0.pdf

BIN
dva/s21-2.5.pdf

BIN
dva/s21-3.0.pdf

BIN
dva/s21-3.5.pdf

BIN
dva/s21-3.9.pdf

BIN
dva/s21-4.0.pdf

BIN
dva/s21-4.4.pdf

BIN
dva/s21-4.5.pdf

BIN
dva/s21-5.0.pdf

BIN
ena/ang-1.8.pdf

BIN
ena/ang-2.0.pdf

BIN
ena/ang-2.5.pdf

BIN
ena/ang-3.0.pdf

BIN
ena/ang-3.5.pdf

BIN
ena/ang-3.9.pdf

BIN
ena/ang-4.0.pdf

BIN
ena/ang-4.4.pdf

BIN
ena/ang-4.5.pdf

BIN
ena/ang-5.0.pdf

BIN
ena/s11-1.8.pdf

BIN
ena/s11-2.0.pdf

BIN
ena/s11-2.5.pdf

BIN
ena/s11-3.0.pdf

BIN
ena/s11-3.5.pdf

BIN
ena/s11-3.9.pdf

BIN
ena/s11-4.0.pdf

BIN
ena/s11-4.4.pdf

BIN
ena/s11-4.5.pdf

BIN
ena/s11-5.0.pdf

BIN
ena/s21-1.8.pdf

BIN
ena/s21-2.0.pdf

BIN
ena/s21-2.5.pdf

BIN
ena/s21-3.0.pdf

BIN
ena/s21-3.5.pdf

BIN
ena/s21-3.9.pdf

BIN
ena/s21-4.0.pdf

BIN
ena/s21-4.4.pdf

BIN
ena/s21-4.5.pdf

BIN
ena/s21-5.0.pdf

BIN
enastopnja/ang-10.0.pdf

BIN
enastopnja/ang-4.0.pdf

BIN
enastopnja/ang-4.5.pdf

BIN
enastopnja/ang-5.0.pdf

BIN
enastopnja/ang-5.5.pdf

BIN
enastopnja/ang-6.0.pdf

BIN
enastopnja/ang-6.5.pdf

BIN
enastopnja/ang-7.0.pdf

BIN
enastopnja/ang-7.5.pdf

BIN
enastopnja/ang-8.0.pdf

BIN
enastopnja/ang-8.5.pdf

BIN
enastopnja/ang-9.0.pdf

BIN
enastopnja/ang-9.5.pdf

BIN
enastopnja/s11-10.0.pdf

BIN
enastopnja/s11-4.0.pdf

BIN
enastopnja/s11-4.5.pdf

BIN
enastopnja/s11-5.0.pdf

BIN
enastopnja/s11-5.5.pdf

BIN
enastopnja/s11-6.0.pdf

BIN
enastopnja/s11-6.5.pdf

BIN
enastopnja/s11-7.0.pdf

BIN
enastopnja/s11-7.5.pdf

BIN
enastopnja/s11-8.0.pdf

BIN
enastopnja/s11-8.5.pdf

BIN
enastopnja/s11-9.0.pdf

BIN
enastopnja/s11-9.5.pdf

BIN
enastopnja/s21-10.0.pdf

BIN
enastopnja/s21-4.0.pdf

BIN
enastopnja/s21-4.5.pdf

BIN
enastopnja/s21-5.0.pdf

BIN
enastopnja/s21-5.5.pdf

BIN
enastopnja/s21-6.0.pdf

BIN
enastopnja/s21-6.5.pdf

BIN
enastopnja/s21-7.0.pdf

BIN
enastopnja/s21-7.5.pdf

BIN
enastopnja/s21-8.0.pdf

BIN
enastopnja/s21-8.5.pdf

BIN
enastopnja/s21-9.0.pdf

BIN
enastopnja/s21-9.5.pdf

128
nri.jl

@ -0,0 +1,128 @@
using LinearAlgebra
using Plots
function unit_cell(Mse::Array{Complex{Float64},2},
Mtl::Array{Complex{Float64},2},
Msh::Array{Complex{Float64},2})
# izracuna ABCD parametre ene π celice sukalnika
# Mse - ABCD matrika serijske impedance
# Mtl - ABCD matrika linije
# Msh - ABCD matrika vzporedne impedance (shunt)
Mse * Mtl * Msh * Mtl * Mse
end
function AtoS(A::Array{Complex{Float64},2})
# konvertira ABCD matriko v S matriko
imenovalec = A[1,1] + A[1,2]/50. + A[2,1]*50. + A[2,2]
S11 = A[1,1] + A[1,2]/50. - A[2,1]*50. - A[2,2]
S22 = -A[1,1] + A[1,2]/50. - A[2,1]*50. + A[2,2]
S12 = 2(A[1,1]*A[2,2] - A[1,2]*A[2,1])
S21 = 2
[S11 S12; S21 S22]/imenovalec
end
struct varactor
R::Float64
L::Float64
C::Float64
end
function Zd(d::varactor, f::Float64)
d.R + im*2*pi*f*d.L - im/2/pi/f/d.C
end
function Yin(Z::Complex{Float64}, β::Float64, l::Float64)
# admitanca l dolge linije zakljucene na Z
# karakteristicna impedanca linije je 50/√2 = 35Ω
2/50. * (50/2 + im*Z*tan(β*l)) / (Z+im*50/2*tan(β*l))
end
function Aseries(Z::Complex{Float64})
[1. Z; 0. 1.]
end
function Atline(β::Float64, l::Float64)
[cos(β*l) im*50*sin(β*l); im*sin(β*l)/50. cos(β*l)]
end
function Ashunt(Y::Complex{Float64})
[1. 0.; Y 1.]
end
struct model
l1::Float64
ϵ1::Float64
l2::Float64
ϵ2::Float64
end
function response1(f::Float64, m::model, d::varactor)
# izracunaj vse vmesne velicine in vrni ABCD parametre
Z = Zd(d, f)
Mse = Aseries(Z)
Mtr = Atline(beta(f, m.ϵ1), m.l1)
Y = Yin(Z, beta(f, m.ϵ2), m.l2)
Msh = Ashunt(Y)
unit_cell(Mse,Mtr,Msh)
end
function S2row(S::Array{Complex{Float64},2})
mag = 10*log10.(abs2.(S))
ang = angle.(S)
[mag[1,1] ang[1,1] mag[2,1] ang[2,1] mag[1,2] ang[1,2] mag[2,2] ang[2,2]]
end
function celo_obmocje(f::Array{Float64,1}, m::model, d::varactor)
n = length(f)
out = Array{Float64,2}(undef, n, 9)
for (i, fi) in enumerate(f)
abcd = response1(fi,m,d)
S = AtoS(abcd)
out[i,1] = fi
out[i,2:end] = S2row(S)
end
out
end
function beta(f::Float64, ϵ::Float64)
2*pi*f*ϵ/3e8
end
#dioda = varactor(.5, 0.6e-9, 1.3e-12)
#m = model(2e-3, 2.788, 18e-3, 2.937)
#f = collect(range(1e9, 4e9, length=801))
#
#@time test = celo_obmocje(f, m, dioda)
#p = plot(test[:,1], test[:,2],label="S11")
#plot!(p, test[:,1], test[:,4],label="S21")
function cela_simulacija(f, C, l; mapa="./", R=.5, L=.6e-9)
for l1 in l
p11 = plot(title="S @ l = $l1 mm",xlabel="Frekvenca (GHz)",
ylabel="S11 (dB)")
p21 = plot(title="S @ l = $l1 mm",xlabel="Frekvenca (GHz)",
ylabel="S21 (dB)")
m = model(l1*1e-3, 2.8504, 18e-3, 2.992)
for Cd in C
d = varactor(R, L, Cd*1e-12)
s2p = celo_obmocje(f, m, d)
plot!(p11, s2p[:,1], s2p[:,2],label="$Cd pF")
plot!(p21, s2p[:,1], s2p[:,4],label="$Cd pF")
end
savefig(p11, "s11-$l1.pdf")
savefig(p21, "s21-$l1.pdf")
end
end
f = collect(range(1e9, 4e9, length=801))
l = range(2.,10., step=2.)
C = [8., 4., 2.]
cela_simulacija(f,C,l)

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save