File:Damped Oscillation2.svg

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

Original file(SVG file, nominally 444 × 386 pixels, file size: 70 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Damped oscillaions given by the equation
Date
Source Own work
Author Krishnavedala
Other versions File:Damped.svg
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

Source code
from numpy import *
from matplotlib.pyplot import *
from mpl_toolkits.axisartist import *

time = linspace(0,10)
fun = lambda a,b,t: exp(a*t) * (cos(b*t) - (a/b) * sin(b*t))

fig = figure(figsize=(5,5))
ax1 = Subplot(fig,"111")
ax1.axis["right"].set_visible(False)
ax1.axis["left"].set_axisline_style("-|>")
ax1.axis["top"].set_visible(False)
ax1.axis["bottom"].set_visible(False)
ax1.axis["x"] = ax1.new_floating_axis(0,0)
ax1.axis["x"].set_axisline_style("-|>")

ax1.plot(time,fun(-.25,1.,time),lw=1.5,label='a=-0.25,b=1')
ax1.plot(time,fun(-.5,1.,time),lw=1.5,label='a=-0.5,b=1')
ax1.plot(time,fun(-.5,.5,time),lw=1.5,label='a=-0.5,b=0.5')
ax1.grid(True)
ax1.text(10,.05,r'$t$')
ax1.set_ylabel(r'$x(t)=e^{at} \left[ \cos(bt) - \frac{a}{b}\sin(bt) \right]$')
ax1.set_ylim(-.5,1.25)
ax1.set_yticks(arange(-0.4,1.25,.2))
ylabels = []
for i in arange(-0.4,1.25,.2):
	if i != 0:
		ylabels = append(ylabels,"%.1f"%i)
	else:
		ylabels = append(ylabels,"")
ax1.set_yticklabels(ylabels)
ax1.minorticks_on()
ax1.legend(frameon=False)
fig.add_subplot(ax1)
fig.savefig("test.png",
	bbox_inches="tight",
	pad_inches=.15)
 
W3C-validity not checked.

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:20, 15 June 2011Thumbnail for version as of 06:20, 15 June 2011444 × 386 (70 KB)Krishnavedala (talk | contribs)many minor corrections
06:17, 15 June 2011Thumbnail for version as of 06:17, 15 June 2011444 × 386 (69 KB)Krishnavedala (talk | contribs){{Information |Description ={{en|1=Damped oscillaions given by the equation <math>x(t)=e^{at} \left[ \cos(bt) - \frac{a}{b}\sin(bt) \right]</math>. Created using python. <syntaxhighlight lang="python

There are no pages that use this file.