Microsoft Office Word RGR_6_Petuh.
Microsoft Office Word.
1.2.
³
Petuh.
→ → → .
RGR_6_Petuh.
1.3.
→ → . RGR_6_Petuh.
2 :
cikl
iteracia
1- . ϳ Visual Basic, :
' 202
'
MsgBox (" ")
, . .
1.4.
:
→ → → → .
Project. . .
1.5.
→ 2- .
: Petuh, , .
2.
ճ
2.1.
=1.3, b=0.2, =-1.4, ∆x=0.25, x0=-3, xn=5
-
- . 1
2.3.
a | b | c | x | y | ||||
a | b | c | x | y | Xo | Xn | dx | |
single | single | single | single | single | single | single | single |
Sub cikl()
'"
Dim a As Single, b As Single, c As Single, x As Single, y As Single
Dim x0 As Single, xn As Single, dx As Single
'
a = InputBox(" ")
|
|
b = InputBox(" b")
c = InputBox(" c")
x0 = InputBox(" x0")
xn = InputBox(" xn")
dx = InputBox(" dx")
'
x = x0
While x <= xn
'
If x < 1 Then
If x > 0 Then
y = a * Exp(-Sqr(x)) * Sin(b * x) + c
MsgBox ("x = " + Str(x) + ", y = " + Str(y))
Else
MsgBox ("x = " + Str(x) + ", y ")
End If
Else
y = a * Exp(-Sqr(x)) * Cos(b * x) + c
MsgBox ("x = " + Str(x) + ", y = " + Str(y))
End If
x = x + dx
Wend
End Sub
=1.3, b=0.2, =-1.4, ∆x=0.25, x0=-3, xn=5.
InputBox MsgBox:
a:
b:
c:
:
dx
,
x | y |
-3 | 2.126747E-02 |
-2.75 | 12.47402 |
-2.5 | 17.47636 |
-2.25 | 17.9572 |
-2 | 16.01898 |
-1.75 | 13.0542 |
-1.5 | 9.91495 |
-1.25 | 7.067346 |
-1 | 4.719155 |
-0.75 | 2.917959 |
-0.5 | 1.621912 |
-0.25 | 0.7475814 |
1.4 | |
0.25 | 0.9443408 |
0.5 | 0.5913371 |
0.75 | 0.3349606 |
0.1602839 | |
1.25 | 4.955369E-02 |
1.5 | 1.429384E-02 |
1.75 | 4.588255E-02 |
5.677956E-02 | |
2.25 | 5.554606E-02 |
2.5 | 4.813026E-02 |
2.75 | 0.0383911 |
2.862639E-02 | |
3.25 | 0.0200388 |
3.5 | 1.311266E-02 |
3.75 | 7.898283E-03 |
4.213225E-03 | |
4.25 | 1.775803E-03 |
4.5 | 2.868613E-04 |
4.75 | 5.254069E-04 |
8.853935E-04 |
:
3.
3.1
=0,7 n=5
-
3.3.
n | s | x | i | |
n | s | x | i | |
integer | single | single | integer |
Sub iteracia()
' iteracia
' 202 -
MsgBox (" ")
''
Dim x As Single, S As Single