Jump to content
Wikipedia The Free Encyclopedia

File:Mplwp ballistic trajectories velocities.svg

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Original file (SVG file, nominally 600 ×ばつ 400 pixels, file size: 29 KB)
This is a file from the Wikimedia Commons. Information from its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

Summary

DescriptionMplwp ballistic trajectories velocities.svg
English: Plot of a ballistic trajectory with air resistance. The trajectory follows the differential equation r ̈ ( t ) = k v v g y ^ {\displaystyle {\ddot {\vec {r}}}(t)=-k,円v\cdot {\vec {v}}-g\cdot {\hat {\vec {y}}}} {\displaystyle {\ddot {\vec {r}}}(t)=-k,円v\cdot {\vec {v}}-g\cdot {\hat {\vec {y}}}} with initial conditions r ( 0 ) = 0 , r ̇ ( 0 ) = v 0 ( x ^ cos ( α 0 ) + y ^ sin ( α 0 ) ) {\displaystyle {\vec {r}}(0)={\vec {0}},\;{\dot {\vec {r}}}(0)=v_{0}({\hat {\vec {x}}}\cos(\alpha _{0})+{\hat {\vec {y}}}\sin(\alpha _{0}))} {\displaystyle {\vec {r}}(0)={\vec {0}},\;{\dot {\vec {r}}}(0)=v_{0}({\hat {\vec {x}}}\cos(\alpha _{0})+{\hat {\vec {y}}}\sin(\alpha _{0}))}.

The parameters are:

  • g = 1 {\displaystyle g=1} {\displaystyle g=1}, k = 1 {\displaystyle k=1} {\displaystyle k=1}, α 0 = 45 {\displaystyle \alpha _{0}=45^{\circ }} {\displaystyle \alpha _{0}=45^{\circ }}
  • The initial velocity takes the values v 0 = 2 {\displaystyle v_{0}=2} {\displaystyle v_{0}=2}, v 0 = 4 {\displaystyle v_{0}=4} {\displaystyle v_{0}=4}, v 0 = 6 {\displaystyle v_{0}=6} {\displaystyle v_{0}=6}, v 0 = 8 {\displaystyle v_{0}=8} {\displaystyle v_{0}=8}, v 0 = 10 {\displaystyle v_{0}=10} {\displaystyle v_{0}=10}
The differential equation is solved numerically using Scipy odeint.
Date
Source Own work
Author Geek3
SVG development
InfoField
The SVG code is valid .
This plot was created with mplwp, the Matplotlib extension for Wikipedia plots.
Source code
InfoField

mplwp source code

The plot was generated with mplwp 1.0
#!/usr/bin/python
# -*- coding: utf8 -*-
importmatplotlib.pyplotasplt
importmatplotlibasmpl
importnumpyasnp
frommathimport *
code_website = 'http://commons.wikimedia.org/wiki/User:Geek3/mplwp'
try:
 importmplwp
except ImportError, er:
 print 'ImportError:', er
 print 'You need to download mplwp.py from', code_website
 exit(1)
name = 'mplwp_ballistic_trajectories_velocities.svg'
fig = mplwp.fig_standard(mpl)
xlim = 0,2.6; fig.gca().set_xlim(xlim)
ylim = 0,2.6*355/515.; fig.gca().set_ylim(ylim)
fig.gca().xaxis.set_major_locator(mpl.ticker.MultipleLocator(0.4))
fig.gca().yaxis.set_major_locator(mpl.ticker.MultipleLocator(0.4))
fromscipy.integrateimport odeint
fromscipy.optimizeimport brentq
defballistic(g, k, xy0, v0, alpha0, tt):
 # use a four-dimensional vector function vec = [x, y, vx, vy]
 defdif(vec, t):
 v = sqrt(vec[2]**2 + vec[3]**2)
 return [vec[2], vec[3], -k*v*vec[2], -g -k*v*vec[3]]
 
 # solve the differential equation numerically
 vec = odeint(dif, [xy0[0], xy0[1], v0*cos(alpha0), v0*sin(alpha0)], tt)
 return vec[:,0], vec[:,1] # return x(tt) and y(tt)
g = 1.0
k = 1.0
alpha0 = pi/4
for v0 in np.linspace(0, 10, 6)[1:]:
 t1 = brentq(lambda t: ballistic(g,k,[0,0],v0,alpha0,[0,t])[1][1],0.1,5)
 t = np.linspace(0, t1, 5001)
 x, y = ballistic(g, k, [0, 0], v0, alpha0, t)
 while len(y) > 1 and y[-2] <= 0.0: x = x[:-1]; y = y[:-1]
 plt.plot(x, y,
 label=ur'$v_0=,円{:.0f}$'.format(v0))
mpl.rc('legend', borderaxespad=1.0)
plt.legend(loc='upper left').get_frame().set_alpha(0.9)
plt.savefig(name)
mplwp.postprocess(name)

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
[画像:GNU head] Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License , Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License .http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 3.0 Unported 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.
https://creativecommons.org/licenses/by/3.0CC BY 3.0 Creative Commons Attribution 3.0 truetrue
You may select the license of your choice.

See also

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

copyright status<\/a>"}},"text\/plain":{"en":{"":"copyright status"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":50423863,\"id\":\"Q50423863\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P6216":"copyrighted<\/a>"}},"text\/plain":{"en":{"P6216":"copyrighted"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P6216 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
inception<\/a>"}},"text\/plain":{"en":{"":"inception"}}},"{\"value\":{\"time\":\"+2014年09月28日T00:00:00Z\",\"timezone\":0,\"before\":0,\"after\":0,\"precision\":11,\"calendarmodel\":\"http:\\\/\\\/www.wikidata.org\\\/entity\\\/Q1985727\"},\"type\":\"time\"}":{"text\/html":{"en":{"P571":"28 September 2014"}},"text\/plain":{"en":{"P571":"28 September 2014"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P571 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">

28 September 2014

source of file<\/a>"}},"text\/plain":{"en":{"":"source of file"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":66458942,\"id\":\"Q66458942\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P7482":"original creation by uploader<\/a>"}},"text\/plain":{"en":{"P7482":"original creation by uploader"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P7482 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:00, 28 September 2014 Thumbnail for version as of 14:00, 28 September 2014 600 ×ばつ 400 (29 KB)Geek3 ballistic_trajectories_velocities plot by Geek3

The following page uses this file:

Global file usage

The following other wikis use this file:

Metadata

This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.

If the file has been modified from its original state, some details may not fully reflect the modified file.

Short titlemplwp_ballistic_trajectories_velocities.svg
Image titlehttp://commons.wikimedia.org/wiki/File:mplwp_ballistic_trajectories_velocities.svg Plot created with mplwp, the Matplotlib extension for Wikipedia plots.
Width600px
Height400px

AltStyle によって変換されたページ (->オリジナル) /