File:Integration simpson.svg

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

Original file(SVG file, nominally 350 × 109 pixels, file size: 17 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Numerical integration by the Simpson's Method. The function being used is . The interval is split in 15 pieces.
Español: Integración numérica por el método de Simpson. La función a integrar es . El intervalo está partido en 15 sub-intervalos.
Date
Source Own work
Author Nicoguaro
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d


# Interpolation data
x = np.linspace(-2, 2, 15)
y = x**2 + np.sin(2*np.pi*x)
f = interp1d(x, y, kind='quadratic')

# Fine data
x = np.linspace(-2, 2, 200)
y = x**2 + np.sin(2*np.pi*x)

# Plots
fig = plt.figure(figsize=(4.5, 1))
ax = plt.subplot(1, 1, 1)
plt.plot(x, y, lw=2, zorder=6)
plt.plot(x, f(x), '--r', lw=2, zorder=7)
plt.ylim(-1.5, 4.75)
plt.xticks([-2, -1, 0, 1, 2])
plt.yticks([0, 2, 4])
plt.grid(b=True, lw=2, color='gray', linestyle='solid', alpha=0.5,
         zorder=3)
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
plt.savefig('Integration_simpson.svg', bbox_inches='tight')
plt.show()

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
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/TimeThumbnailDimensionsUserComment
current13:34, 12 July 2016Thumbnail for version as of 13:34, 12 July 2016350 × 109 (17 KB)Nicoguaro (talk | contribs)Change size of text
13:24, 12 July 2016Thumbnail for version as of 13:24, 12 July 2016360 × 123 (17 KB)Nicoguaro (talk | contribs)User created page with UploadWizard

The following page uses this file:

File usage on other wikis

The following other wikis use this file:

Metadata