• Keine Ergebnisse gefunden

Worksheet 12: Solving differential equations July 2, 2014

N/A
N/A
Protected

Academic year: 2021

Aktie "Worksheet 12: Solving differential equations July 2, 2014"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

r

1

l2

2 1

m1

m2 l

ϕ ϕ y

x

g

Figure 1: Double Pendulum

Physik auf dem Computer SS 2014

Worksheet 12: Solving differential equations

July 2, 2014

General Remarks

• The deadline for the worksheets isWednesday, 9 July 2014, 10:00for the tutorial on Friday and Friday, 11 July 2014, 10:00for the tutorials on Tuesday and Wednesday.

• On this worksheet, you can achieve a maximum of 10 points.

• To hand in your solutions, send an email to

Johannes (zeman@icp.uni-stuttgart.de; Tuesday, 9:45–11:15) Tobias (richter@icp.uni-stuttgart.de; Wednesday, 15:45–17:15) Shervin (shervin@icp.uni-stuttgart.de; Friday, 11:30–13:00) Task 12.1: Double Pendulum (10 points)

In this task we consider a double pendulum with masses m1 = 1 and m2 = 1 attached by rigid massless wires of lengths l1= 1 and l2= 0.5 as it is shown in Fig. 1. Hereφ1 and φ2 are the angles between the wires and y-axis. The forces that act on the masses areF1 = −m1g and F2 =−m2g, respectively. For such a system the equation of motion can be written as a system of second order differential equations (1) that is derived from the Lagrangian equations. The trajectory of the mass m1 just falls on a circle, whereas the trajectory of the second mass m2 is chaotic. One can obtain the trajectories of both masses by solving the following system numerically:

M l1φ¨1+m2l2φ¨2cos(∆φ) +m2l2φ˙2

2sin(∆φ) +gMsinφ1 = 0 l2φ¨2+l1φ¨1cos(∆φ)−l1φ˙1

2sin(∆φ) +gsinφ2 = 0,

where M = (m1+m2) and ∆φ=φ1φ2. .

1

(2)

12.1.1(2 points) Convert the equation system to a system of four differential equations of first order which will be suitable for using a Runge-Kutta method, i.e. ˙y=F[t, y(t)], wherey is the 4-vector (φ1˙1, φ2˙2). Implement a function F(t,y)that takes a 4-vector ywith angles and velocities and returns a 4-vector with F(t,y).

12.1.2 (3 points) Implement a Python function solve_runge_kutta(F,tmax,y0,h) that solves the double pendulum for a total time of tmax using the 4-th order Runge-Kutta method and returns the angles φ1 and φ2. Herey0consists of initial anglesφ1(0), φ2(0) and corresponding initial angular velocities ˙φ1(0), ˙φ2(0).

12.1.3 (3 points) Implement solve_velocity_verlet(F,tmax,y0,h), a Python function that solves the double pendulum for a total time of tmax using the Velocity-Verlet method. The arguments of the function are the same as in the previous subtask.

12.1.4(2 points) Using both implemented functions, solve the equation system withh= 0.01, tmax = 100 at the following initial conditions: φ1(0) =π/2,φ2(0) =π/2, ˙φ1(0) = 0, ˙φ2(0) = 0, in order to get the trajectory of the second mass m2 and plot the trajectory in x, y axes.

Compare the results of both methods.

2

Abbildung

Figure 1: Double Pendulum

Referenzen

ÄHNLICHE DOKUMENTE

Analysis of Fractional Nonlinear Differential Equations Using the Homotopy Perturbation Method.. Mehmet Ali Balcı and

In this problem finding more it- erations of He’s variational iteration method is very time consuming, so modification of the initial guess can provide an accurate and

The discretized modified Korteweg- de Vries (mKdV) lattice equation and the discretized nonlinear Schr¨odinger equation are taken as examples to illustrate the validity and the

In the second section we follow [9] to nd the linear and nonlinear system of magnetoelastic equations for a thin plate of uniform thickness 2h.. It is assumed that the plate

The present paper follows the approach of [5], where a generalization of Zubov’s clas- sical method [21] has been developed in the framework of viscosity solutions for

An additional variable has been intro- duced in this function, namely the amount of voluntary savings which are'partially allocated by the consumers to the purchase of

Invariant manifolds in differential algebraic equations of index 3 and in their Runge-Kutta discretizations.

This paper is concerned with a boundary value problem defined over a bounded region of Euclidean space, and in particular it is devoted to the establishment of a priori estimates