0% found this document useful (0 votes)
15 views4 pages

Application of The Equations of Motion Using Vpython

The document discusses the challenges faced by physics teachers and students during online education, particularly in materializing physics concepts. It introduces VPython as a tool for computational modeling and visualization of physics phenomena, specifically focusing on equations of motion. The paper presents examples of applying VPython to illustrate sliding friction and the motion of charged particles in a magnetic field, enhancing students' understanding of physics through programming.

Uploaded by

Bojan Lazarevic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Application of The Equations of Motion Using Vpython

The document discusses the challenges faced by physics teachers and students during online education, particularly in materializing physics concepts. It introduces VPython as a tool for computational modeling and visualization of physics phenomena, specifically focusing on equations of motion. The paper presents examples of applying VPython to illustrate sliding friction and the motion of charged particles in a magnetic field, enhancing students' understanding of physics through programming.

Uploaded by

Bojan Lazarevic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

XXVII Skup TRENDOVI RAZVOJA: “ON-LINE NASTAVA NA UNIVERZITETIMA”,

Novi Sad, 15. -18. 02. 2021.

APPLICATION OF THE EQUATIONS OF MOTION USING VPYTHON


Bojan Lazarević1, Luka Tanasijin2
1,2
College of Engineering & Technology, American University of the Middle East, Egaila, Kuwait
1,2 Univerzitet u Novom Sadu, Prirodno-matematički fakultet, Novi Sad, Srbija
1
[Link]@[Link], [Link]@[Link]

Abstract: Dealing with the online learning, physics teachers are facing difficulties in "materializing” basic
physics’ phenomena. Regardless of whether we speak about lectures or experiments, the fact is that students are not
present in the classroom or lab. Therefore, teachers are forced to move forward by using all digital innovations in
order to provide the highest possible teaching quality. At the same time, students also struggle with understanding of
the concepts, mathematical or logical formations.
This paper describes computational modelling, simulating and visualizing physics’ phenomena using VPython
(Visual Python) programming language. It is a great tool for the illustration, calculation and simulation of simple
physics’ demonstrations and experiments, particularly during “crisis” called online education. By focusing more on
the computational aspect, equations of motion will be applied to assist undergraduate students with performing
mathematical operations.
Sliding Friction and Motion of a Charged Particle in Magnetic Field are chosen as two examples that cover
different topics in Physics for the students who are coming from different majors.
Key Words: VPython/physics/equations of motion/friction/charged particle/magnetic field

1. INTRODUCTION

Although in the 21st century the teachers are exposed to usage of the modern technologies, the crises that hit us
in 2020, transformed teachers into online educators. During previous semesters, both, students and teachers, faced
difficulties. For students those were misunderstandings of the concepts, mathematical or logical formations, while for
the teachers, mostly, presenting the materials and trying to materialize them were struggles that cannot easily be
overcame as the students are not present in the classrooms or labs. Therefore, no matter if it is spoken about
experiments or lectures, physics teachers were forced to move forward in order to provide the highest possible teaching
quality.
There are different methods in online learning that teachers can apply depending on the specificity of their major.
One of the tools that can be applied in physics so students can understand and come up with the idea and imagination
of basic physics’ concepts, is usage of the programming language that can compute, model, simulate and visualize
physics problems.
One of the most popular, easily readable and user-friendly programming languages used worldwide is Python.
The variation of it that is often used in physics is Visual Python - VPython. In order to do 3D visualizations and
matrices with Python, an additional module need to be included. It is Python with its Visual package as a part of very
wide library. A package or module is a collection of related methods that are assembled into a library [1].

2. OBJECTS’ VISUALIZATION AND VECTORS’ DEFINITION USING VPYTHON

Everything related to visualization usually makes a trouble for students who are having problems with imagining
things, especially 3D objects such as sphere, box, arrow, cylinder, etc. Many physical quantities that are vectors cause
an issue in terms of locating them in 3D space. Additionally, students usually misunderstand that the term vector itself
doesn’t represent a location for an arrow. Instead, their prediction that vector presents the arrow’s tail is wrong. By
applying VPython, students are becoming familiar with creating 3D shapes and their attributes (position, axis, size,
radius, color, etc.). In case of an arrow, as an example, they can distinguish what the position and axis represent (Photo
1).

1
XXVII Skup TRENDOVI RAZVOJA: “ON-LINE NASTAVA NA UNIVERZITETIMA”,
Novi Sad, 15. -18. 02. 2021.

Photo 1. Arrow’s code and its 3D representation

3. MOVING THE OBJECTS

Students who are coming from different engineering majors and taking physics courses are supposed to master
some basic mathematical skills. But, when it comes to the application of them in other courses, such as physics or
programming, their performances are not so developed. With VPython application, by focusing more on the
computational aspect, students' progress in understanding of the mathematical application in physics is significant.
3.1 EQUATIONS OF MOTION
Equations of motion are used to describe physics’ phenomena related to the objects that are in motion as a
function of time. Although, when it comes to the motion there are two branches – kinematics and dynamics, this paper
will cover kinematics only. It deals with variables that are brought derived from the positions of the object and time.
Equations that can be used to describe motion of any physical systems are:
1 𝐹⃗𝑛𝑒𝑡 2
𝑟⃗ = 𝑟⃗0 + 𝑣⃗0 𝑡 + ∆𝑡
2 𝑚
𝐹⃗𝑛𝑒𝑡
𝑣⃗ = 𝑣⃗0 + ∆𝑡
𝑚
For understanding of these equations, it should be emphasized the awareness of the importance of the force
thanks to which all the objects are moved. In the following examples, we will speak about two different forces: 𝑓⃗
(friction force) and 𝐹⃗ (Lorentz force):
𝑓⃗ =< −𝜇𝑚𝑔, 0,0 > N
𝐹⃗ = 𝑞𝑣⃗ × 𝐵 ⃗⃗
It should be assumed that in case of the sliding friction simulation object is moving to the right (along +x
direction), so friction force is defined along -x direction.
3.2 WHILE LOOP
To get objects in motion, “while loop” as a syntax structure has to be implemented using VPython. The “while”

2
XXVII Skup TRENDOVI RAZVOJA: “ON-LINE NASTAVA NA UNIVERZITETIMA”,
Novi Sad, 15. -18. 02. 2021.
itself means a period of time or interval, and “loop” refers to a part of a code that has to be executed “over and over”.
In addition, it can be said that “while loop” executes statements repetitively until a condition is fulfilled.
When it comes to the conditions, it’s necessary to define variables “moving” an object by changing its position:
t (time) and v (velocity), before the loop is applied:

In order to get iterative process, series of steps must be repeated. In case of physics, it would be dt - time step, in other
words, how often the process will be repeated:

The next step is to define while loop with the condition until the value of the variables that are important for the
specific problem become satisfied. At the end of this statement, “colon” must be used in order to make the next
statements indented:

Those would be the equations of motion. As the equation for position contains another variable dependable on the
time step, which is the velocity, both of them should be defined inside the loop. In respect of terminating the iterative
process, the variables previously defined must be updated by incrementing them:

Additionally, inside the loop it must be applied a “rate” statement to slow down the entire animation of motion as it
occurs faster than detectable by human eye.

4. EXAMPLES OF VPYTHON’S APPLICATION

To describe how the equation of motions can be applied for different topics, Sliding Friction and Motion of a
Charged Particle in Magnetic Field are chosen.

Photo 2. Representation of the iterative process in Sliding Friction example

3
XXVII Skup TRENDOVI RAZVOJA: “ON-LINE NASTAVA NA UNIVERZITETIMA”,
Novi Sad, 15. -18. 02. 2021.

Photo 3. Visualization of the Sliding Friction along x- direction

Photo 4. Representation of the iterative process due to Lorentz force and its visualization

5. CONCLUSION

The equations of motion can be easily used to visualize object’s motion by using VPython in terms of providing
support to the students’ imagination and strengthening their mathematical background. Moreover, their curiosity about
solving physical problems by programming immerses.
From these examples and others similar, students are aware of the importance of the applied forces thanks to
which object can be moved. So, no matter what kinematics example we are using to simulate the motion, forces will
affect the velocity dependable on the time and changes of position for each iterative step (Photo 5).

Photo 5. Schematic representation of the iterative process


The Euler method is applied twice, once for the velocity and then for the position. Notice also that we update the
velocity first and then use the new velocity to update position second. It turns out that this order of operation is often
superior to the reverse order in terms of computational accuracy. It is called the Euler-Cromer method [2].

6. REFERENCES

[1] Ergi Bufasi, Kawtar Lakrad, Improving Teaching Techniques Using Visual Python: A Case Study In Physics
Laboratories, International journal of scientific & technology research: Volume 8, Issue 12, December 2019.
[2] Alan Cromer, Stable solutions using the Euler Approximation, American Journal of Physics: Volume 49, Issue 5,
May 1981.
[3] [Link]
[4] [Link]
[5] Windsor Morgan, Lars English, VPython for Introductory Mechanics: Complete Version, Dickson College:
Department of Physics and Astronomy, Carlisle, 2019.

You might also like