Commit 82e20c87 authored by Kittisak Maneewong's avatar Kittisak Maneewong

Add Sheet

parent 5290c59f
......@@ -138,7 +138,9 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def f1x(x):\n",
......@@ -345,7 +347,9 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import sympy\n",
......@@ -355,7 +359,9 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"x,y,z,e = sympy.Symbol('x'), sympy.Symbol('y'), sympy.Symbol('z'), sympy.Symbol('e')"
......@@ -364,7 +370,9 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from sympy import sin, cos"
......@@ -373,7 +381,9 @@
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"y = sin(x)*e**(-cos(x))"
......@@ -472,7 +482,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
......@@ -567,7 +579,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.1"
}
},
"nbformat": 4,
......
......@@ -333,6 +333,27 @@
"| 0.00125 | 1.28 | 0.367879 | 0.912121 |\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.36787944117144233"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from numpy import e\n",
"e**(-1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -371,6 +392,135 @@
"G = 0.367843\n",
"$$\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.3678361863589256"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def extra(h1,p):\n",
" from math import e\n",
" g1 = (e**(-(1+h1)) - 2*e**(-1) + e**(-(1-h1)))/(h1**2)\n",
" h1=h1/2\n",
" g2 = (e**(-(1+h1)) - 2*e**(-1) + e**(-(1-h1)))/(h1**2)\n",
" return ((2**p)*g2-g1)/((2**p)-1)\n",
"extra(0.64,2)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.3678361863589256"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def G(h):\n",
" from math import e\n",
" return (e**(-(1+h)) - 2*e**(-1) + e**(-(1-h)))/(h**2)\n",
"def extra(h1,p):\n",
" return ((2**p)*G(h1/2)-G(h1))/((2**p)-1)\n",
"extra(0.64,2)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.36784333333333336"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def extra(g1,g2,p):\n",
" return ((2**p)*g2-g1)/((2**p)-1)\n",
"extra(0.380610,0.371035,2)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.36784333333333336"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def g(h):\n",
" cda = {\n",
" 0.64:0.380610,\n",
" 0.32:0.371035,\n",
" 0.16:0.368711,\n",
" 0.08:0.368281,\n",
" 0.04:0.36875,\n",
" 0.02:0.37,\n",
" 0.01:0.38,\n",
" 0.005:0.40,\n",
" 0.0025:0.48,\n",
" 0.00125:1.28\n",
" }\n",
" return cda[h]\n",
"def extra(h,p):\n",
" return ((2**p)*g(h/2)-g(h))/((2**p)-1)\n",
"extra(0.64,2)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.36784333333333336"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"((2**2)*0.371035-0.380610)/3"
]
}
],
"metadata": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment