Ask your own question, for FREE!
Physics 13 Online
OpenStudy (anonymous):

hey guys, i could really use some help with some vpython programming problems. it doesn't seem to tough, but I'm just not that very familiar with it.

OpenStudy (isaiah.feynman):

The user @dan815 enjoys programming. But he's currently offline unfortunately. He would have helped you for sure.

OpenStudy (anonymous):

awwww man :/

OpenStudy (anonymous):

OpenStudy (anonymous):

well, here;s the problem if you anyone else could provide help. it would be greatly appreciated.

OpenStudy (isaiah.feynman):

I'm not knowledgeable in programming unfortunately. I would have helped if it was a theoretical problem.

OpenStudy (anonymous):

it;s all good dude.

OpenStudy (dan815):

just make a loop and pause like 0.01 second for every frame

OpenStudy (dan815):

you can do something like this instead of going at it from a programming point where u just have some step size for your graping points

OpenStudy (dan815):

pseudo code for t from 0:0.01:final time or using while loops t=0 while x>0 and x<L <---- boundary conditions t=t+0.01 x=v*t plot object at (x,y) if u want x to have smooth increasing velocity, then use acceleration function x=v*t+1/2a*t^2 <--- u can lose the initial v condition plot object at (x,y) pause 0.01 secs end

OpenStudy (dan815):

this will take care of your first motion if u start plotting from x=0 it will go till x=>L and stop

OpenStudy (dan815):

to reverse you take t = final t : -0.01 : 0

OpenStudy (dan815):

this is the more mathematical approach

OpenStudy (dan815):

another way which is simpler to code pseudo code if x>=L velocity=negative int elif x<=0 velocity = positive int while x>0 and x<L x=x+velocity plot object @ (x,y) end

OpenStudy (dan815):

if u want velocity to be increasing constant then

OpenStudy (dan815):

velocity=velocity*k %if u want a linear rise in velocity

OpenStudy (dan815):

pseudo code for linear velocity increase if x>=L velocity=negative int elif x<=0 velocity = positive int while x>0 and x<L velocity=velocity*k %where k is some constant for the rate of linear increase in velocity x=x+velocity plot object @ (x,y) end

OpenStudy (dan815):

okay I hope that gives you some ideas, to do yor assignment, there are many other ways, don't forget to include pause steps so the plots show

OpenStudy (dan815):

and look u those draw commands for objects for vpython

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!