File:Sine iterations.svg
From Vigyanwiki
Sine iterations.svg
Size of this PNG preview of this SVG file: 720 × 540 pixels. Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 1,024 × 768 pixels | 1,280 × 960 pixels | 2,560 × 1,920 pixels.
Original file (SVG file, nominally 720 × 540 pixels, file size: 37 KB)
This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.
Summary
DescriptionSine iterations.svg |
English: Iterates of the sine function (blue), in the first half-period. Half-iterate (orange), i.e., the sine's functional square root; the functional square root of that, the quarter-iterate (black) above it, up until the 1/64 iterate; and six integral iterates below it, starting with the second iterate (red). The green envelope triangle represents the limiting null iterate, the sawtooth function serving as the starting point leading to the sine function. The dashed black function is iterate -1, or the inverse of sine (arc sine).
Python source code: import numpy as np import matplotlib.pyplot as plt from scipy import interpolate x = np.linspace(0, np.pi, 10000) def double_iter(a): d = np.array(a) interpolated = interpolate.interp1d(x, a, kind="linear") for i in range(len(a)): d[i] = interpolated(min(x[-1], a[i])) return d def improve(candidate, f): improved = np.empty_like(candidate) for i in range(len(f)): naive_newval = np.argmin(np.abs(candidate[:len(f)/2]-f[i])) * np.pi/len(f) improved[i] = candidate[i] + 0.1*(naive_newval - candidate[i]) return improved def half_iter(f): half = np.array(f) mean_error = float("inf") while mean_error > 1e-4: half = improve(half, f) mean_error = np.mean(np.abs(double_iter(half)-f)) print mean_error return half iter_1 = np.sin(x) iter_minus1 = np.arcsin(x) iter_0 = np.concatenate((x[0:len(x)/2], np.flipud(x[0:len(x)/2])), axis=1) iter_2 = double_iter(iter_1) iter_4 = double_iter(iter_2) iter_8 = double_iter(iter_4) iter_16 = double_iter(iter_8) iter_32 = double_iter(iter_16) iter_64 = double_iter(iter_32) iter_1_2 = half_iter(iter_1) iter_1_4 = half_iter(iter_1_2) iter_1_8 = half_iter(iter_1_4) iter_1_16 = half_iter(iter_1_8) iter_1_32 = half_iter(iter_1_16) iter_1_64 = half_iter(iter_1_32) n = 10 plotx = x[::n] plt.plot(plotx, iter_1[::n],"b",linewidth=2) plt.plot(plotx, iter_2[::n],"r") plt.plot(plotx, iter_4[::n],"k") plt.plot(plotx, iter_8[::n],"k") plt.plot(plotx, iter_16[::n],"k") plt.plot(plotx, iter_32[::n],"k") plt.plot(plotx, iter_64[::n],"k") plt.plot(plotx, iter_1_2[::n],"orange") plt.plot(plotx, iter_1_4[::n],"k") plt.plot(plotx, iter_1_8[::n],"k") plt.plot(plotx, iter_1_16[::n],"k") plt.plot(plotx, iter_1_32[::n],"k") plt.plot(plotx, iter_1_64[::n],"k") plt.plot(plotx, iter_0[::n],"g") plt.plot(x, iter_minus1,"k--") plt.ylim([0,np.pi/2]) plt.xlim([0,np.pi]) plt.tight_layout(pad=0.15) plt.savefig("Sine_iterations.svg") |
Date | |
Source | Own work |
Author | Qorilla |
Licensing
I, the copyright holder of this work, hereby publish it under the following licence:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International licence.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the licence, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible licence as the original.
Items portrayed in this file
depicts
3 April 2015
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:19, 3 April 2015 | 720 × 540 (37 KB) | wikimediacommons>Qorilla | User created page with UploadWizard |
File usage
The following 2 pages use this file:
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitise it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Width | 576pt |
---|---|
Height | 432pt |
Retrieved from ‘https://www.vigyanwiki.in/wiki/File:Sine_iterations.svg’