Python How can velocity be plotted in Vpython?

  • Thread starter Thread starter e2m2a
  • Start date Start date
  • Tags Tags
    Plotting Velocity
AI Thread Summary
To plot velocity in VPython, one must first understand that while the documentation primarily focuses on position, velocity can be derived from position data. If you can plot position versus time, you can also plot velocity by calculating it as the derivative of position with respect to time. This can be done either by using an algebraic expression for position and differentiating it or by computing numerical derivatives from position data stored in an array. Unlike some other software that may automate this process, VPython requires users to manually compute the velocity or find a routine to assist with this calculation.
e2m2a
Messages
354
Reaction score
13
TL;DR Summary
Can't find any documentation on how to plot/graph velocity as a function of time in vpython.
Can someone tell me how to plot/graph velocity in vpython? All the documentation I see just deals with plotting the position of the object, nothing on plotting the velocity.
 
Technology news on Phys.org
e2m2a said:
Summary:: Can't find any documentation on how to plot/graph velocity as a function of time in vpython.

Can someone tell me how to plot/graph velocity in vpython? All the documentation I see just deals with plotting the position of the object, nothing on plotting the velocity.
I don't understand your quandary. If you are able to plot position vs. time, why can't you also plot velocity vs. time? I'm not familiar with vpython, but it seems to be concerned mostly with 3D plots. If all you need is a 2D graph, you might consider using matplotlib with Python.
 
Given the position as a function of time, you need to somehow compute the velocity as a function of time.
If you have an algebraic expression, then you have to take a derivative with respect to t, then plot that resulting function.
If you have a position data in an array, then you have to effectively the compute numerical derivatives akin to \Delta x/\Delta t. (You may be used to other software that does that "automatically"... but that's because that software is doing that behind the scenes. Here in VPython, you have to do it yourself [or find a routine that does it].
 
robphy said:
Given the position as a function of time, you need to somehow compute the velocity as a function of time.
My assumption was that the velocities at the various times were known.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Replies
3
Views
2K
Replies
9
Views
3K
Replies
2
Views
4K
Replies
14
Views
2K
Replies
11
Views
2K
Replies
7
Views
3K
Replies
3
Views
2K
Back
Top