0% found this document useful (0 votes)
25 views2 pages

Sheet 7

This document provides instructions for Exercise 7 of a computer simulation course. Students are asked to: 1) Write a Matlab program using the Euler method to simulate the motion of a pendulum with no friction over 15 seconds, starting at an initial displacement of 0.45 radians. They must plot the displacement and velocity over time and estimate the period of oscillation. 2) Add a friction term to the differential equation and rerun the simulation to observe how friction affects the motion. They must plot the displacement vs velocity. The document explains the relevant pendulum differential equation and provides the initial conditions, simulation time interval, and expected plots. It emphasizes showing the work for full credit and providing pseudo-code if

Uploaded by

amarvenkat30
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)
25 views2 pages

Sheet 7

This document provides instructions for Exercise 7 of a computer simulation course. Students are asked to: 1) Write a Matlab program using the Euler method to simulate the motion of a pendulum with no friction over 15 seconds, starting at an initial displacement of 0.45 radians. They must plot the displacement and velocity over time and estimate the period of oscillation. 2) Add a friction term to the differential equation and rerun the simulation to observe how friction affects the motion. They must plot the displacement vs velocity. The document explains the relevant pendulum differential equation and provides the initial conditions, simulation time interval, and expected plots. It emphasizes showing the work for full credit and providing pseudo-code if

Uploaded by

amarvenkat30
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/ 2

Introduction to Computer Simulation

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.

Exercise 7.1: Pendulum

The motion of a pendulum is described by the differential equation

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)

b) Add a friction term −ρ dϕdt


, with ρ = 0.15 s−1 to the right hand side of the
differential equation and again compute the motion of the pendulum with
the same initial conditions and time interval as before. Plot ϕ(t) vs dϕ(t)
dt
.
What do you observe compared to the case with no friction?
(5 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.

You might also like