1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
| Const pi As Single = 3.14
Dim f As Variant
Dim fc As Single
Dim L1 As Integer
Dim L2 As Integer
Const c0 As Integer = 343
Const rho As Single = 1.21
Public Function sigma(f, fc, L1, L2, delta1, delta2, c0, pi) As Single
Dim f11 As Single
Dim sigma2 As Variant
Dim sigma3 As Variant
L1 = 5
L2 = 3
fc = 111.65
f11 = ((c0 ^ 2) / (4 * fc)) * ((1 / (L1 ^ 2)) + (1 / (L2 ^ 2)))
sigma = 0
Dim J As Integer
J = 1
For Each f In Range("Feuil1!B5:B25") '<< A Ajuster à ta plage ...
sigma2 = 4 * L1 * L2 * ((f / c0) ^ 2)
sigma3 = Sqr((2 * pi * f * (L1 + L2)) / (16 * c0))
Y = Sqr(f / fc)
If f11 <= (fc / 2) And f > fc Then ' => SI condition 1 validée ALORS
sigma = 1 / Sqr(1 - (fc / f))
ElseIf f11 <= (fc / 2) And f < fc And f > (fc / 2) Then ' => SINON, SI condition 2 validée ALORS
delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
delta2 = 0
sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
ElseIf f11 <= (fc / 2) And f < (fc / 2) Then '=> SINON
delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
delta2 = (8 * (c0 ^ 2) * (1 - (2 * (Y ^ 2)))) / ((fc ^ 2) * (pi ^ 4) * L1 * L2 * Y * Sqr(1 - (Y ^ 2)))
sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
ElseIf f11 < (fc / 2) And f < f11 And sigma > sigma2 Then
sigma = sigma2
ElseIf f11 > (fc / 2) And f < fc And sigma2 < sigma3 Then
sigma = sigma2
ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) < sigma3 Then
sigma = 1 / Sqr(1 - (fc / f))
ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) > sigma3 Then
sigma = sigma3
End If
J = J + 1
Sheets("Feuil3").Cells(J, 3).Value = sigma
Next
For i = 1 To 10
If Sheets("Feuil3").Cells(i, 3).Value = "" Then Cells(i, 3).Value = " facteur_rayonnement"
Next i
End Function
Sub rayonnement()
Dim R As Variant
Dim Tau As Variant
Dim Ms
Ms = 460
L1 = 5
L2 = 3
'Calcul de Tau
Dim sgm As Single
sgm = sigma(f, fc, L1, L2, delta1, delta2, c0, pi)
Dim J As Integer
J = 1
fc = 111.65
For Each f In Range("Feuil1!B5:B25")
'rayonnement
If f > fc Then
Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * fc * (sgma ^ 2)) / (2 * f))
ElseIf f = fc Then
Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * (sgma ^ 2)) / (2))
ElseIf f < fc Then
Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * (2 * 0.5 * (Log((2 * pi * f / c0) * Sqr(L1 + L2)) - (-0.964 - ((0.5 + (L2 / (pi * L1))) * Log(L2 / L1)) + ((5 * L2) / (2 * pi * L1)) - (1 / (4 * pi * L1 * L2 * ((2 * pi * f / c0) ^ 2))))) + ((((L1 + L2) ^ 2) / ((L1 ^ 2) + (L2 ^ 2))) * Sqr(fc / f) * (sgma ^ 2)))
End If
J = J + 1
Sheets("Feuil3").Cells(J, 5).Value = Tau
'R = 10 * ((Log(1 / Tau)) / Log(10))
'Sheets("Feuil3").Cells(J, 6).Value = R
Next
End Sub |
Partager