Sheet 7
Sheet 7
CSIS
Computer Simulation in Science
WS 23/24
Prof. Dr. F. Knechtli
M.Sc. T. Asmussen, Dr. J. A. Urrea
Exercise 7
due 11.12.2023 before 8 AM
The solution to the exercises must be uploaded following the instructions shown
in Moodle.
d2 ϕ g
2
= − sin(ϕ)
dt l
where g = 9.81 m/s2 is the acceleration due to gravity, l = 1.0 m is the length of
the pendulum and ϕ(t) is the angular displacement (radian) at time t.
a) Write a Matlab program that uses the Euler method to compute the motion
of the pendulum for a given initial displacement
ϕ0 = ϕ(t = 0) = 0.45 (≈ 25.8◦ ) for the time t = 0 to t = 15 s. At t = 0
the pendulum is at rest. You can use the script ball.m from Moodle as a
starting point. Plot ϕ(t) vs t and also ϕ(t) vs dϕ(t)
dt
. Estimate the period of
oscillation of the pendulum from your results.
(10 points)
1
Note: For each exercise we should be able to see, from what you handed in, what
you did and what came out of it. Print out/write down everything we need for
this. If you don’t manage to write a working program, then write down a kind of
pseudo code. That is, explain step by step, what your program should be doing.