File:Pendulum rel error.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 659 × 509 pixels. Other resolutions: 311 × 240 pixels | 622 × 480 pixels | 994 × 768 pixels | 1,280 × 989 pixels | 2,560 × 1,977 pixels.
Original file (SVG file, nominally 659 × 509 pixels, file size: 72 KB)
File information
Structured data
Captions
Summary[edit]
DescriptionPendulum rel error.svg |
English: Relative error in the approximation of the period of oscillation of a pendulum using a power series. The error is a function of the initial angle, for small angles the period does not depend on it.
Español: Error relativo en la aproximación del período de oscilación de un péndulo usando una serie de potencias. El error es una función del ángulo inicial, para ángulos pequeños el período no depende de este parámetro. |
Date | |
Source | Own work |
Author | Nicoguaro |
SVG development InfoField | This plot was created with Matplotlib. |
Source code InfoField | Python codefrom __future__ import division
from scipy.special import ellipk, factorial
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams['font.size'] = 16
palette= ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33"]
def period(angle):
return 4*ellipk(np.sin(angle/2)**2)
def approx_period(angle, num):
return 2*np.pi*sum((factorial(2*n)/(2**n * factorial(n))**2)**2
* np.sin(angle/2)**(2*n) for n in range(0, num + 1))
theta = np.linspace(0, np.pi/2, 100)
for num in range(0, 6):
rel_error = np.abs(approx_period(theta, num) - period(theta))/period(theta)
plt.plot(theta*180/np.pi, 100*rel_error,
label=r"$T_{%i}$"%(2*num), lw=2, color=palette[num])
plt.xlabel(r"Initial angle (degrees): $\theta_0$ ")
plt.ylabel(r"Relative Error (%): $\left\Vert\frac{T - T_k}{T}\right\Vert \times 100$")
plt.ylim(0, 1)
plt.grid(ls="--", alpha=0.4)
plt.legend(loc="best", fontsize=14, framealpha=0.8)
plt.savefig("Pendulum_rel_error.svg", bbox_inches="tight")
plt.show()
|
Licensing[edit]
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution 4.0 International license.
- 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 license, 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.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 17:23, 4 July 2016 | 659 × 509 (72 KB) | Nicoguaro (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on nl.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 527pt |
---|---|
Height | 407pt |