-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote.txt
35 lines (25 loc) · 2.55 KB
/
Note.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Project A - Dynamics of a single and a double pendulum.
By Son-Gyo Jung (00948246)
There are five py files in the zip file:
code file 1. Project A - singlev2.py
code file 2. Project A - Double.py
code file 3. Stability test - singlev2.py
code file 4. Stability test - Bisection for singlev2.py
code file 5. Stability test - Bisection for double.py
To examine the dynamics of the single pendulum and the variation of energy with time, run code file 1.
Note when running code file 1 and using the function energy(), it will ask you whether you want to predict using Euler forward for leapfrog. Please enter 'yes'.
FIGS. 3 and 4 can be generated by entering 'yes' to the global value and running the function called Energy() and enter yes to predicting using Euler Forward.
FIGS. 5 and 6 can be generated by entering 'no' to the global value and entering h=0.01 and D=0.2. subsequently, run the function called Energy().
FIGS. 7 and 8 can be generated by first adjusting the initial angle to 0.75 * np.pi on code line 39. Then run the code file and enter 'no' to the global value and enter h=0.01 or 0.3 with D=0.2. subsequently, run the function called ExactEuler().
To examine the dynamics of the double pendulum and the variation of energy with time, run code file 2.
FIGS. 9 and 10 can be generated by entering 'yes' to the global value and runing the functions called plotmotion() and plotenergy().
FIGS. 11 and 12 can be generated by entering 'no' to the global value and entering h=0.01 and G=1. subsequently, run the functions called plotmotion() and plotenergy().
Note. arbitrary parameter values could be chosen to test whether the statements made in the report is correct.
For the stability test for the single pendulum:
1. Run code 3. Choose D=0 and write the function Critical(method) where method is either EulerForward, EulerBackward, Leapfrog or RK4.
2. Bisection search method. Run code 4 and run the function bisectionsearch(). Enter the FDMs that you want examine followed by a initial guess that is much greater than 0.0001 (and greater than the critical step size if known).
The values of h and other parameters could be adjusted if necessary.
For the stability test for the double pendulum:
The results could be inferred from the energy plots. Bisection search method could be use by running code file 5 and following the steps mentioned below.
This was not used for this analysis but was created out of interest. Feel free to play around with it but can't guarantee it will yield any useful results.
Any problem please contact sgj14@ic.ac.uk