Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
numer-60-2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittipong Maneewong
numer-60-2
Commits
b5a5dfeb
Commit
b5a5dfeb
authored
Mar 29, 2018
by
Kittipong Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่งงาน week09
parent
61887d7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
FirstCDA.py
week09/FirstCDA.py
+16
-0
No files found.
week09/FirstCDA.py
View file @
b5a5dfeb
...
...
@@ -17,3 +17,19 @@ def fsinx_1():
fsinx
(
1
,
0.001
)
fsinx_1
()
#output 0.7272689097917728
#จงเขียนฟังก์ชันเพื่อแสดงตารางค่าความสัมพันธ์ระหว่าง h กับ ค่า First CDA ของฟังก์ชันต่างๆในข้อ 1. เมื่อกำหนด x=1 และ h=[0.64,0.32,0.16,0.08,0.04,0.02,0.01,0.005,0.0025,0.00125]
def
fx
(
x
,
h
):
return
[((
sin
(
x
+
h
[
i
])
*
e
**
(
-
cos
(
x
+
h
[
i
])))
-
((
sin
(
x
-
h
[
i
])
*
e
**
(
-
cos
(
x
-
h
[
i
])))))
/
(
2
*
h
[
i
])
for
i
in
range
(
0
,
10
)]
h
=
[
0.64
,
0.32
,
0.16
,
0.08
,
0.04
,
0.02
,
0.01
,
0.005
,
0.0025
,
0.00125
]
fx
(
1
,
h
)
#output [0.7272315407770419,
# 0.7294856916511139,
# 0.7279664514641956,
# 0.7274522897769059,
# 0.7273152972988396,
# 0.7272805201077245,
# 0.7272717927303579,
# 0.7272696088183261,
# 0.7272690627111111,
# 0.7272689261761833]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment