Jump to content

Sonar: Studio basi idrofoniche rettilinee con routine di calcolo in Visual Basic (in banda di frequenze)


Recommended Posts

Posted (edited)

Per eventuali sviluppi compresi nel post: link al calcolatore SONARMATH (per la determinazione dei parametri acustci del sonar)

dirbw0.jpg.02e6e672990f83fc1fd4e62ea9a10a4a.jpg

fig. 1

Il dimensionamento delle basi idrofoniche rettilinee, fig 1, in banda di frequenze è fondamentale nel progetto del sonar e nella valutazione delle  portate di scoperta.

Detta operazione, sviluppata in Visual Basic, consente la determinazione dei parametri della direttività di una specifica base idrofonica in una banda di  frequenze di lavoro F1- F2,  in particolare il guadagno  DI , la larghezza Δ delta del lobo principale a due livelli diversi d’ampiezza e annesso grafico.

 

 

 dirbw1.jpg.917ef57b872401aa69268c38931462b6.jpg

Pannello di controllo

 

Il pannello di controllo che governa la routine di calcolo è formato da:

 

dirbw2.jpg.e3d584c5620180ffb7481c38a03a8eac.jpg

fig. 2

 

Nel software la rispondenza tra numero distintivo e oggetti  è indicata dai numeri rossi riportati in figura 3:

 

dirbw3.jpg.a3121dce47bff14dfb170fabfec0d015.jpg

fig. 3

 

Il computo di R(alfa) ed altre caratteristiche salienti della base idrofonica, quale ad esempio il tracciamento della curva di direttività sono affidate ad una routine di calcolo in Visual Basic della quale il listato:

 

Listato del programma

 

Private Sub Form_Paint()
For xi = 0 To 6440 Step 322
For yi = 0 To 4480 Step 28
PSet (550 + xi, 500 + yi)
Next yi
Next xi
For yi = 0 To 4480 Step 224
For xi = 0 To 6440 Step 42
PSet (550 + xi, 500 + yi)
Next xi
Next yi
Line (550 + 3220, 500)-(550 + 3220, 500 + 4480)
Line (550, 4480 + 500)-(6440 + 550, 500 + 4480)
End Sub

 

Private Sub text1_KeyPress(KeyAscii As Integer)
If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then _
KeyAscii = 0
End Sub
Private Sub text2_KeyPress(KeyAscii As Integer)
If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then _
KeyAscii = 0
End Sub
Private Sub text3_KeyPress(KeyAscii As Integer)
If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then _
KeyAscii = 0
End Sub
Private Sub text4_KeyPress(KeyAscii As Integer)
If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then _
KeyAscii = 0
End Sub
Private Sub Command1_Click()
Cls
For xi = 0 To 6440 Step 322
For yi = 0 To 4480 Step 28
PSet (550 + xi, 500 + yi)
Next yi
Next xi
For yi = 0 To 4480 Step 224
For xi = 0 To 6440 Step 42
PSet (550 + xi, 500 + yi)
Next xi
Next yi
Line (550, 500)-(550, 500 + 4480)
Line (550, 4480 + 500)-(6440 + 550, 500 + 4480)
Line (550 + 3220, 500)-(550 + 3220, 500 + 4480)
For alfa = 0 To 180 Step 0.01
f1 = Val(Text1.Text)
If Val(Text1.Text) = 0 Then GoTo salto
f2 = Val(Text2.Text)
If Val(Text2.Text) = 0 Then GoTo salto
L = Val(Text3.Text)
If Val(Text3.Text) = 0 Then GoTo salto
n = Val(Text4.Text)
If Val(Text4.Text) = 0 Then GoTo salto
d1 = L / (n - 1)
p = (f2 - f1) / f1
j3 = 90
x = 3.14 * d1 * (f1 / 1530) * Sin(((alfa - j3) + 0.000001) * (3.14 / 180))
For M = 1 To (n - 1)
b = (Sin(M * p * x)) / (M * p * x)
c = Cos((p + 2) * M * x)
d = (n - M)
e = (b * c * d)
k = k + e
Next M
s = ((2 / (n ^ 2)) * k) + (1 / n)
t = Sqr(s)
k = 0
Circle ((550 + 2 * alfa * 6440 / 360), 500 + (2 * 2240 - 2 * 2240 * t)), _
10, vbRed
Next
salto:
End Sub

 

Esempio d’impiego:

 

Digitazione variabili nel pannello di controllo

testoesercizio.jpg.c21d7d4b1d2fa4ec9a6f34b0e10c435c.jpg

 

in figura 5 il risultato del calcolo:

dirbw4.jpg.14ab1c4170b0b7b9aaa2a1f60b152603.jpg

fig. 4

Edited by C. Del Turco

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    • Total Topics
      45.4k
    • Total Posts
      526.2k
×
×
  • Create New...