File:The continuosly differentiably in irrational and discontinuosly differentiably in rational function.svg
Summary
| Description |
English: Graphic of
where |
| Date | |
| Source | Own work |
| Author | Arami Mira |
| SVG development | |
| Source code | Python codeimport numpy as np
import matplotlib.pyplot as plt
import math
from fractions import Fraction
def nextPair(x, y):
a = x
b = y
if (a + b) % 2 == 0:
a -= 1
b += 1
if a == 0:
a = 1
else:
a += 1
b -= 1
if b == 0:
b = 1
return a, b
def nextRational(x):
if x == 0:
return Fraction(1, 1)
n = x.numerator
d = x.denominator
n, d = nextPair(n, d)
while math.gcd(n, d) != 1:
n, d = nextPair(n, d)
return Fraction(n, d)
def seriesFunction(center, x):
return 0 if x == center else (x-center)*(x-center)*math.sin(1/(x-center))
def series(n, x):
q = 1.1
f = 1
s = 0
r = Fraction(0, 1)
for i in range(n):
s += (seriesFunction(r, x)) / f
if (i > 0):
s += (seriesFunction(-r, x)) / f
f *= q
r = nextRational(r)
return s - 20*x
x = np.linspace(-2.1, 2.1, 5000)
y = [series(100, i) for i in x]
f, ax = plt.subplots()
ax.set_xlim(-2, 2)
plt.plot(x, y)
plt.savefig("The continuosly differentiably in irrational and discontinuosly differentiably in rational function.svg")
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|