Vai al contenuto

Sonar: Routine di calcolo in Visual Basic per la determinazione, via grafica e  iterativa, della portata R di un apparato ecogoniometrico (sonar attivo)


C. Del Turco

Messaggi raccomandati

Immagine di uno scenario subacqueo durante la fase di scoperta sonar attiva:

(a) emette un impulso acustico che investe (b) (c) (d),

da (b) (c) (d) ritornano  tre impulsi d’eco per tre direzioni diverse che individuano la presenza dei tre bersagli.

 

ecginizio.jpg.4383f5aab0a96d577436b763c55e53ea.jpg

 

 

Il calcolo della portata di un sonar attivo è dipendente dalla soluzione del sistema trascendente:

 

ecg1.jpg.7ca90eee20ef4c58c9cd58e6f35f1be5.jpg

 

Nel post è disponibile un file di calcolo eseguibile della portata del sonar attivo con il quale esercitarsi alle procedure operative.

 

ecg.exe

 

Per entrare nella struttura del software è qui riportata la routine di calcolo:

 

Routine in VB

 

‘Listato da copiare e incollare  in ambiente Visual Basic con gli oggetti individuabili dopo il lancio dell’eseguibile precedente.

 

 

Private Sub Command1_Click()

calcolo

End Sub

 

Private Sub Form_Paint()

For xi = 0 To 6440 Step 322

For yi = 0 To 4480 Step 28

PSet (500 + xi, yi)

Next yi

Next xi

For yi = 0 To 4480 Step 224

For xi = 0 To 6440 Step 42

PSet (500 + xi, yi)

Next xi

Next yi

Line (500, 0)-(500, 4480)

Line (500, 4480)-(6440 + 500 + 160, 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 text5_KeyPress(KeyAscii As Integer)

If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then KeyAscii = 0

End Sub

 

Private Sub text6_KeyPress(KeyAscii As Integer)

If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then KeyAscii = 0

End Sub

Private Sub text7_KeyPress(KeyAscii As Integer)

If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then KeyAscii = 0

End Sub

 

Private Sub text8_KeyPress(KeyAscii As Integer)

If InStr("-+.0123456789" + Chr(&H8), Chr(KeyAscii)) = 0 Then KeyAscii = 0

End Sub

 

Private Sub calcolo()

Cls

For xi = 0 To 6440 Step 322

For yi = 0 To 4480 Step 28

PSet (500 + xi, yi)

Next yi

Next xi

For yi = 0 To 4480 Step 224

For xi = 0 To 6440 Step 42

PSet (500 + xi, yi)

Next xi

Next yi

Line (500, 0)-(500, 4480)

Line (500, 4480)-(6440 + 500 + 160, 4480)

 

If Combo1.Text = "Sferica" Then hhh = 20

If Combo1.Text = "Sfer.cil." Then hhh = 10

If hhh = 0 Then hhh = 20

k = Val(Text1.Text) 'Ftx

k1 = Val(Text2.Text) 'Banda rx

d = Val(Text8.Text)

tc = Val(Text7.Text) 'durata impulso

SL = Val(Text3.Text) 'livello di Tx

NL = Val(Text4.Text)

DI = Val(Text5.Text)

TS = Val(Text6.Text)

 

If k = 0 Then GoTo fine

If k1 = 0 Then GoTo fine

If tc = 0 Then GoTo fine

k2 = k / 1000 'frequenza Tx in Khz

a = (0.1 * (k2 ^ 2)) / (1 + (k2 ^ 2)) + (40 * (k2 ^ 2)) / (4100 + (k2 ^ 2)) + (2.75 * (k2) ^ 2) / 10000

DT = 5 * Log(d * k1 / (tc)) / Log(10)  'SOGLIA DI RIVELAZIONE IN CORRELAZ.

'''Bw = 10 * Log(k1) / Log(10) 'incremento rumore dovuto alla banda di ricezione

'NOTA BENE--->(Si/Ni)dB = (DT-BW+PE)

TL = (SL + TS - NL + DI - DT)  'MAX ATTENUAZIONE CONSENTITA

For R = 0.1 To 50 Step 0.1

TLP = 120 + 2 * hhh * Log(R) / Log(10) + 2 * a * R 'equazione attenuazione f(R)

PSet (500 + 2 * 64.4 * R, 2 * 2240 - 11.2 * TLP), vbBlue

PSet (500 + 2 * 64.4 * R, 2 * 2240 - 11.2 * TL), vbRed

Next

 

 

'ANELLO PER IL CALCOLO DISTANZA OLTRE I 100 Km

For R = 0.1 To 50 Step 0.001

TLP = 2 * (60 + hhh * Log(R) / Log(10) + a * R) 'equazione attenuazione f(R)

If Int(TLP) = Int(TL) Then distanza = R  'rivelazione distanza R

If Int(TLP) = Int(TL) Then perdita = TLP / 2 'rivelazione TLp per distanza R

Next

 

Label12.Caption = Format(distanza, "###.0")

fine:

Circle (500 + 2 * 64.4 * distanza, 2 * 2240 - 22.4 * perdita), 100, vbRed

End Sub

 

Link al commento
Condividi su altri siti

Join the conversation

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

Visitatore
Rispondi a questa discussione...

×   Hai incollato il contenuto con la formattazione.   Rimuovi formattazione

  Sono ammessi al massimo solo 75 emoticon.

×   Il tuo link è stato automaticamente aggiunto.   Mostrare solo il link di collegamento?

×   Il tuo precedente contenuto è stato ripristinato.   Pulisci l'editor

×   Non è possibile incollare direttamente le immagini. Caricare o inserire immagini da URL.

Caricamento...
  • Statistiche forum

    • Discussioni Totali
      45k
    • Messaggi Totali
      521,7k
×
×
  • Crea Nuovo...