File:Laplaces method.svg

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

Original file(SVG file, nominally 263 × 475 pixels, file size: 24 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Illustration of Laplace's method for the approximation of integrals. Created using python with numpy and matplotlib toolkits.
Source Code
from matplotlib.pyplot import *
from mpl_toolkits.axes_grid.axislines import SubplotZero
from numpy import *

N, L, fs = 500., 15., 12.
M = [.5,3]

x1 = linspace(-L,L,N)
f = lambda x: sin(x) / x
g = lambda x: 1. - (x**2)/6.

y = lambda m,x: exp(m * f(x))
z = lambda m,x: exp(m * g(x))

fig = figure(figsize=(3,6))
ax1 = SubplotZero(fig,211)
ax2 = SubplotZero(fig,212)
fig.add_subplot(ax1)
fig.add_subplot(ax2)

ax1.axis["top"].set_visible(False)
ax1.axis["right"].set_visible(False)
ax1.axis["left"].set_axisline_style("->")
ax1.axis["bottom"].set_axisline_style("->")
ax1.set_yticks([0,.5,1,1.5])
ax1.set_xticks([-10,0,10])

ax2.axis["top"].set_visible(False)
ax2.axis["right"].set_visible(False)
ax2.axis["left"].set_axisline_style("->")
ax2.axis["bottom"].set_axisline_style("->")
ax2.set_yticks([0,5,10,15,20])
ax2.set_xticks([-10,0,10])
#ax.set_xlim(-1,10)
#ax.set_ylim(-3,3)

ax1.plot(x1,z(M[0],x1),'r',lw=2)
ax1.plot(x1,y(M[0],x1),'b',lw=2)
ax2.plot(x1,z(M[1],x1),'r',lw=2)
ax2.plot(x1,y(M[1],x1),'b',lw=2)

#ax.text(10,-2.8,u'$n$')
#ax.text(-.75,3,u'$X_n$')
fig.savefig

("Laplaces_method.svg",bbox_inches="tight",pad_inches=.15)
Date
Source Own work
Author Krishnavedala

Based on File:Laplaces_method.png

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
current05:06, 9 September 2011Thumbnail for version as of 05:06, 9 September 2011263 × 475 (24 KB)Krishnavedala (talk | contribs)

The following page uses this file:

File usage on other wikis

The following other wikis use this file: