<iframe width="600" height="338" src="//www.youtube.com/embed/uXURYBVEv-c?rel=0" frameborder="0" allowfullscreen></iframe> |
<iframe width="600" height="338" src="//www.youtube.com/embed/IyRJmOd48NE?rel=0" frameborder="0" allowfullscreen></iframe> </iframe> |
The following video shows how to implement the Euler's integration method for one time-step.
<iframe width="600" height="338" src="//www.youtube.com/embed/3khcp_ZjnaU?rel=0" frameborder="0" allowfullscreen></iframe> |
We extend our script to perform the Euler integration over multiple time-steps by looping over the appropriate statements as shown in the video below.
<iframe width="600" height="338" src="//www.youtube.com/embed/OaGJsamM8rw?rel=0" frameborder="0" allowfullscreen></iframe> |
Our script saves only the final location of the mass. We are also interested in saving the intermediate locations so that we can make a plot of position vs. time. We do this by creating arrays for the position and time as shown in the video below.
<iframe width="600" height="338" src="//www.youtube.com/embed/8g4kSDT8SZo?rel=0" frameborder="0" allowfullscreen></iframe> |