









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Igor Volobouev
Computational Physics (PHYS 5322)
Texas Tech University
a m
F
F
i
i
r
r
r
=
=
K
r
r
r
r
=
=
2
2 2
1 2
) (
)
(^
t
dt
v d
t
dt
v d
v
t
v
t
t
τ
τ
τ
τ
t
m
v
F
v
t
dt
v d
v
t
v
t
Δ + = Δ + ≈ Δ +
=
) , ( ) ( ) ( ) ( r r r r r r τ
τ
τ
τ
τ
i
i
i i
i
i
) , , ( 2 2 v x t F
dt
x d m
r r
r
r
=
) (^0). (^0) , (^8). 9 , (^0). (^0) (
2 2
−
=
dt
x d
r
m
d
y y t
F
t dy
y
dy dt
dx dt
y
x
y
) , , , ( ,
1 0
0
1
1
0
0
1
0
0
K
= =
=
=
can be a complicated function. Best way to represent such a function in Python is to createa “callable” object.
Any object which can be called like a function is a“callable”. To make such an object, implement a classwhich includes the special function call(self, …). Callables can perform a lot of work during theirinitialization stage which can later be used to savecomputing time (no need to repeat the initialization atevery step). In C++ similar objects are called
functors
. They
must provide the function operator “()”.
Go to the course web page:
http://highenergy.phys.ttu.edu/~igv/ComputationalPhysics/Lectures/Le
cture2Examples/
Realistic Physics of Baseball: Escalation of the Air Drag Model
Velocity-dependentdrag coefficient Variable surfaceroughness(“knuckleball”) Head/tail wind Magnus force
ball
0
v
S
F
M
r
r
r
×
=
ω