You are on page 1of 20

PROGRAM P1

' Program grafic valoare medie patratica pt. deplasare


Private Sub CommandButton1_Click()
Dim m, k, c, alfa, p As Double
Dim it, i, j As Integer
Dim w(100), sigmap(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
p = Sqr(k / m)
alfa = 0.1
it = 15
For j = 1 To it
w(j) = alfa
alfa = alfa + 0.5
sigmap(j) = (Sqr(c ^ 2 * p ^ 2 + 12 * alfa * c * 3.14 * 2000) - c * p) / (6 * alfa
* c * p)
Next
For j = 1 To it
Worksheets("Foaie1").Cells(40 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(40 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(40 + (it + 1) * (i - 1) + j, 3).Value = sigmap(j)
Next
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub

PROGRAM P2
' Program densitate spectrala raspuns cu calculul valorii mediei patratice
Private Sub CommandButton1_Click()
Dim m, k, c, gama, sigmap, alfa, p, pe, pep, psi, psie As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
gama = Val(tgama.Value)
alfa = Val(talfa.Value)
n=1
it = Val(Tit.Value)
p = Sqr(k / m)
psi = c / (2 * m * p)
sigmap = (Sqr(c * c * p * p + 12 * alfa * c * 3.14 * 2) - c * p) / (6 * alfa * c * p)
tsigma.Value = sigmap
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
For i = 1 To n
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(29 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
s(j) = 2 / (m*((p ^2 - w(j) ^2 + 3 * alfa * p ^2 * sigmap) * (p ^2- w(j) ^2+
3 * alfa * p ^2 * sigmap) + 4 * psi ^2 * p ^2 * w(j)^2))
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
p = pep
Next
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub
PROGRAM P3
'program imbunatatire liniarizare
Private Sub CommandButton1_Click()

Dim m, k, c, gama, sigma, alfa, p, pe, pep, psi, psie As Double


Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
sigmapatr = Val(tsigmapatr.Value)
alfa = Val(talfa.Value)
n = Val(tn.Value)
it = Val(Tit.Value)
p = Sqr(k / m)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
For i = 1 To n
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Value = "S"
pep = (p ^ 2) * (1 + 3 * alfa * sigmapatr)
For j = 1 To it
f1 = p * p - (w(j) ^ 2)
f2 = (c * w(j) / m) ^ 2
s(j) = 2 / (m*(f1 ^ 2 + f2))
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 1).Value = 0.2
* (j - 1)
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(25 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
p = Sqr(pep)
Next
End Sub
Private Sub talfa_Change()
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_Change()
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_Change()
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_Change()
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_Change()
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
k.Activate
End If
End Sub
Private Sub tsigma_Change()
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub

Program P4
' Program densitate spectrala pentru excitatie 1
Private Sub CommandButton1_Click()
Dim d, landa, beta, f1, f2 As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
d = Val(tD.Value)
landa = Val(tlanda.Value)
beta = Val(tbeta.Value)
it = Val(tit.Value)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = d * landa / 3.14
f2 = w(j) * w(j) + landa * landa + beta * beta
f3 = (landa ^ 2 + beta ^ 2 - w(j) ^ 2) * (landa ^ 2 + beta ^ 2 - w(j) ^ 2) + 4
* landa ^ 2 * w(j) ^ 2
s(j) = f1 * (f2 / f3)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
if KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub

PROGRAM P5
Program calcul densitate spectrala raspuns excit de banda ingusta 2
sigmap = Val(tsigmap.Value)
psi = c / (2 * m * p)
it = Val(tit.Value)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.1 * (j - 1))
Next
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = d * landa / (3.14*m*m)
f2 = w(j) ^ 2 + landa ^ 2 + beta ^ 2
f3 = (landa ^ 2 + beta ^ 2 - w(j) ^ 2) * (landa ^ 2 + beta ^ 2 - w(j) ^ 2) + 4
* landa ^ 2 * w(j) ^ 2
s(j) = (f1/m) * (f2 / f3)
pp = 1 / ((p ^ 2-w(j) ^ 2 + 3 * alfa * p ^ 2 * sigmap) * (p ^ 2- w(j) ^ 2 + 3
* alfa * p ^ 2 * sigmap) + 4 * psi ^ 2 * p ^ 2 * w(j)^ 2))
s(j) = s(j) * pp
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub
Private Sub Label4_Click()
End Sub

PROGRAM P6
' Program densitate spectrala pentru excitatie 2
Private Sub CommandButton1_Click()
Dim d, landa, beta, f1, f2 As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
d = Val(tD.Value)
landa = Val(tlanda.Value)
beta = Val(tbeta.Value)
it = Val(tit.Value)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(25 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = 2 * d * landa / 3.14
f2 = landa^2 + beta^2
f3 = (landa ^2 + beta ^2 - w(j)^2) * (landa ^2 + beta ^2- w(j) ^2) + 4 *
landa^2 * w(j)^2
s(j) = f1 * (f2 / f3)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(38 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub

PROGRAM P7
'Program densitate spectrala raspuns excit aleatoare de banda ingusta
Private Sub CommandButton1_Click()
Dim d, landa, beta, f1, f2, f3, m, k, p, pp, sigmap, psi As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
p = Sqr(k / m)
d = Val(tD.Value)
c = Val(tc.Value)
landa = Val(tlanda.Value)
beta = Val(tbeta.Value)
alfa = Val(talfa.Value)
sigmap = Val(tsigmap.Value)
psi = c / (2 * m * p)
it = Val(tit.Value)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.1 * (j - 1))
Next
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(28 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = 2 * d * landa / (3.14*m*m)
f2 = landa * landa + beta * beta
f3 = (landa * landa + beta * beta - w(j) * w(j)) * (landa * landa + beta *
beta - w(j) * w(j)) + 4 * landa * landa * w(j) * w(j)
s(j) = f1 * (f2 / f3)
pp = 1 / ((p * p - w(j) * w(j) + 3 * alfa * p * p * sigmap) * (p * p - w(j) *
w(j) + 3 * alfa * p * p * sigmap) + 4 * psi * psi * p * p * w(j) * w(j))
s(j) = s(j) * pp
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(50 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub
Private Sub Label4_Click()
End Sub
PROGRAM P8
' Program densitate spectrala raspuns cu comp. nel. exp.
Private Sub CommandButton1_Click()
Dim m, k, c, gama, sigmap, beta, p, pe, pep, psi, psie As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
beta = Val(tbeta.Value)
it = Val(Tit.Value)
p = Sqr(k / m)
psi = c / (2 * m * p)
sigmap = tsigma.Value
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = beta ^ 2 * sigmap / 2
f2 = expf1
s(j) = (1/m) / (((p ^ 2 + p ^ 2 * f2 - w(j) ^ 2) ^ 2) + (4 * psi ^ 2 * p ^ 2 *
w(j) ^ 2))
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
p = pep
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub
PROGRAM P9
'Program densitate spectrala raspuns
Private Sub CommandButton1_Click()
Dim f1, f2 As Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
it = 15
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
For j = 1 To it
f1 = (36 - w(j) ^ 2) ^ 2
f2 = 1273.23 * w(j) ^ 2
s(j) = 1 / ((f1 + f2)*m)
Worksheets("Foaie1").Cells(10 + j, 1).Value = 1 * (j - 1)
Worksheets("Foaie1").Cells(10 + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(10 + j, 3).Value = s(j)
Next
End Sub
PROGRAM P10
'Program densitate spectrala raspuns
Private Sub CommandButton1_Click()
Dim f1, f2 As Double
Dim n, it, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
it = 15
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
For j = 1 To it
f1 = 35.4 - w(j) ^ 2
f2 = 17.82 * w(j) ^ 2
s(j) = 1 / ((f1 ^ 2 + f2)*m)
Worksheets("Foaie1").Cells(10 + j, 1).Value = 1 * (j - 1)
Worksheets("Foaie1").Cells(10 + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(10 + j, 3).Value = s(j)
Next
End Sub
PROGRAM P11
' Program densitate probabilitate
Private Sub CommandButton1_Click()
Dim m, k, c, p As Double
Dim it, i, j As Integer
Dim dens_prob(100), zeta(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
So = Val(tSo.Value)
it = Val(Tit.Value)
p = Sqr(k / m)
zeta(1) = 0
For i = 2 To it
zeta(i) = zeta(i - 1) + 0.02
Next
For j = 1 To it
dens_prob(j) = (p / 3.14) * Sqr(c / (m * So)) * Exp((-c * p ^ 2 * zeta(j) ^
2) / (m * 3.14 * So))
Worksheets("Foaie1").Cells(25 + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(25 + j, 2).Value = zeta(j)
Worksheets("Foaie1").Cells(25 + j, 3).Value = dens_prob(j)
Next
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
PROGRAM P12
' Program densitate spectrala raspuns cu comp. nel. exp.
Private Sub CommandButton1_Click()
Dim m, k, c, gama, sigmap, alfa, p, pe, pep, f1, f2, f3, f4, f5, psi, psie As
Double
Dim n, it, i, j As Integer
Dim s(100), w(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
m = Val(tm.Value)
k = Val(tk.Value)
c = Val(tc.Value)
alfa = Val(talfa.Value)
beta = Val(tbeta.Value)
it = Val(Tit.Value)
p = Sqr(k / m)
psi = c / (2 * m * p)
w(1) = 0
For j = 2 To it
w(j) = 2 * 3.14 * (0.2 * (j - 1))
Next
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 1).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 1).Value = "n=" +
Trim(Str(i))
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 2).Value = "W"
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).Font.Bold = True
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).HorizontalAlignment =
xlCenter
Worksheets("foaie1").Cells(45 + (i - 1) * (it + 1), 3).Value = "S"
For j = 1 To it
f1 = (beta ^ 2 * 3.14) / (8 * psi * p ^ 3)
ex = Expf1
s(j) = p ^ 2 - w(j) ^ 2 + p ^ 2 * ex
s(j) = s(j) * s(j) + 4 * psi ^ 2 * p ^ 2 * w(j) ^ 2
s(j) = 1000 / s(j)
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 1).Value = 0.2 * (j - 1)
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 2).Value = w(j)
Worksheets("Foaie1").Cells(45 + (it + 1) * (i - 1) + j, 3).Value = s(j)
Next
p = pep
End Sub
Private Sub Label5_Click()
End Sub
Private Sub talfa_Change()
End Sub
Private Sub talfa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tn.Activate
End If
End Sub
Private Sub tc_Change()
End Sub
Private Sub tc_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tgama.Activate
End If
End Sub
Private Sub tgama_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tsigma.Activate
End If
End Sub
Private Sub tk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
tc.Activate
End If
End Sub
Private Sub tm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
tk.Activate
End If
End Sub
Private Sub tsigma_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
talfa.Activate
End If
End Sub
PROG P 13
'Program densitate spectrala raspuns
Private Sub CommandButton1_Click()
Dim f1, f2, f3 As Double
Dim n, it, i, j As Integer
Dim s(100), r(100) As Double
Worksheets("Foaie1").Range("a25:c1000").Clear
Worksheets("Foaie1").Range("a25:c1000").Font.Bold = False
r(1) = 0
it = 11
For j = 2 To it
r(j) = r(j - 1) + 0.2
Next
For j = 1 To it
If r(j) = 1 Then
s(j) = 0.00642
Worksheets("Foaie1").Cells(10 + j, 1).Value = 1 * (j - 1)
Worksheets("Foaie1").Cells(10 + j, 2).Value = r(j)
Worksheets("Foaie1").Cells(10 + j, 3).Value = s(j)
Else
f1 = 5.84 * r(j) ^4
f2 = 12.2 * r(j^2
f3 = 1 - (r(j) * r(j))
s(j) = 0.000054 + (f1 - f2 + 0.054)*0.0001 / (f3^4)
Worksheets("Foaie1").Cells(10 + j, 1).Value = 1 * (j - 1)
Worksheets("Foaie1").Cells(10 + j, 2).Value = r(j)
Worksheets("Foaie1").Cells(10 + j, 3).Value = s(j)
End If
Next
End Sub

You might also like