File:The continuos in irrational and discontinuos in rational derivative.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 576 × 432 pixels, file size: 71 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Graphic of

where

sequence of rational positive number by diagonal argument down
Date
Source Own work
Author Arami Mira
SVG development
InfoField
 
The SVG code is valid.
 
This diagram was created with Matplotlib.
Source code
InfoField

Python code

import 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) == 0 else 2*(x-center)*math.sin(1/(x-center))-math.cos(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 = 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 continuos in irrational and discontinuos in rational derivative.svg")

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero 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.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current06:40, 11 October 2021Thumbnail for version as of 06:40, 11 October 2021576 × 432 (71 KB)Arami Mira (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata