3469 - Assignment 1 Instructions Michaelmas 2015 Mike Peardon ()

advertisement
3469 - Assignment 1
Michaelmas 2015
Mike Peardon (mjp@maths.tcd.ie)
Instructions
Complete both parts of the assignment by Monday 26th October. You should submit the
C++ source files for all parts via tcd.blackboard.com. Do not submit executables. Marks
will be deducted for late submissions and any submission more than a week late will not be
marked.
1
Fourth-order Runge-Kutta
Find solutions to the following initial-value ordinary differential equations by writing C++
software that uses the fourth-order Runge-Kutta method. Your code should evaluate the
solutions to 4 significant figures.
1. Evaluate x(2) given
ẋ = −2x2 t with x(0) = 1
2. Evaluate x(20) given
...
x + t2 ẍ + 4x = 0 with x(0) = 1, ẋ(0) = 0, ẍ(0) = −1
2
Chaos and a strange attractor
Write C++ software to implement a fourth-order Runge-Kutta algorithm to compute x(50)
accurate to 3sf where x(t) obeys the chaotic third-order differential equation
...
x + αẍ − ẋ2 + x = 0
with the constant α = 2.017 and initial data
1. x(0) = 0.02, ẋ(0) = 0, ẍ(0) = 0
2. x(0) = 0.0205, ẋ(0) = 0, ẍ(0) = 0
Download