diff --git a/README.md b/README.md
index 7f03ba6..8fb2830 100644
--- a/README.md
+++ b/README.md
@@ -8,4 +8,13 @@
create an animation of the link positions. [double_pendulum.ipynb](double_pendulum.ipynb)
shows the output of the code.
+### 2- Rotating Pendulum Equations of motion
+![Rotating pendulum diagram](./figures/rotating_pendulum.svg)
+
+A pendulum is fixed to a rotating L-bracket, the solution to the rotating system is given
+in [rotating pendulum solution](./rotating_pendulum.ipynb)
+
+![$\omega$=1 rad/s](./figures/animation_rotating_pendulum/w_1_anim.gif)
+
+![$\omega$=5 rad/s](./figures/animation_rotating_pendulum/w_5_anim.gif)
diff --git a/figures/animation_rotating_pendulum/frame001.png b/figures/animation_rotating_pendulum/frame001.png
new file mode 100644
index 0000000..9a4d28c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame001.png differ
diff --git a/figures/animation_rotating_pendulum/frame050.png b/figures/animation_rotating_pendulum/frame050.png
new file mode 100644
index 0000000..e2612e7
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame050.png differ
diff --git a/figures/animation_rotating_pendulum/frame099.png b/figures/animation_rotating_pendulum/frame099.png
new file mode 100644
index 0000000..34f58bc
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame099.png differ
diff --git a/figures/animation_rotating_pendulum/frame1030.png b/figures/animation_rotating_pendulum/frame1030.png
new file mode 100644
index 0000000..72ff1df
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1030.png differ
diff --git a/figures/animation_rotating_pendulum/frame1079.png b/figures/animation_rotating_pendulum/frame1079.png
new file mode 100644
index 0000000..d1fdbd2
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1079.png differ
diff --git a/figures/animation_rotating_pendulum/frame1128.png b/figures/animation_rotating_pendulum/frame1128.png
new file mode 100644
index 0000000..f30b60a
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1128.png differ
diff --git a/figures/animation_rotating_pendulum/frame1177.png b/figures/animation_rotating_pendulum/frame1177.png
new file mode 100644
index 0000000..e8b5185
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1177.png differ
diff --git a/figures/animation_rotating_pendulum/frame1226.png b/figures/animation_rotating_pendulum/frame1226.png
new file mode 100644
index 0000000..4a156f5
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1226.png differ
diff --git a/figures/animation_rotating_pendulum/frame1275.png b/figures/animation_rotating_pendulum/frame1275.png
new file mode 100644
index 0000000..d4aac89
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1275.png differ
diff --git a/figures/animation_rotating_pendulum/frame1324.png b/figures/animation_rotating_pendulum/frame1324.png
new file mode 100644
index 0000000..ace07c5
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1324.png differ
diff --git a/figures/animation_rotating_pendulum/frame1373.png b/figures/animation_rotating_pendulum/frame1373.png
new file mode 100644
index 0000000..a4d1f28
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1373.png differ
diff --git a/figures/animation_rotating_pendulum/frame1422.png b/figures/animation_rotating_pendulum/frame1422.png
new file mode 100644
index 0000000..14441a4
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1422.png differ
diff --git a/figures/animation_rotating_pendulum/frame1471.png b/figures/animation_rotating_pendulum/frame1471.png
new file mode 100644
index 0000000..4bfc225
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1471.png differ
diff --git a/figures/animation_rotating_pendulum/frame148.png b/figures/animation_rotating_pendulum/frame148.png
new file mode 100644
index 0000000..65fc735
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame148.png differ
diff --git a/figures/animation_rotating_pendulum/frame1520.png b/figures/animation_rotating_pendulum/frame1520.png
new file mode 100644
index 0000000..a50a162
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1520.png differ
diff --git a/figures/animation_rotating_pendulum/frame1569.png b/figures/animation_rotating_pendulum/frame1569.png
new file mode 100644
index 0000000..cbbfcc1
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1569.png differ
diff --git a/figures/animation_rotating_pendulum/frame1618.png b/figures/animation_rotating_pendulum/frame1618.png
new file mode 100644
index 0000000..e1847f0
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1618.png differ
diff --git a/figures/animation_rotating_pendulum/frame1667.png b/figures/animation_rotating_pendulum/frame1667.png
new file mode 100644
index 0000000..8fe8b1e
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1667.png differ
diff --git a/figures/animation_rotating_pendulum/frame1716.png b/figures/animation_rotating_pendulum/frame1716.png
new file mode 100644
index 0000000..c16b506
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1716.png differ
diff --git a/figures/animation_rotating_pendulum/frame1765.png b/figures/animation_rotating_pendulum/frame1765.png
new file mode 100644
index 0000000..15e9bd0
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1765.png differ
diff --git a/figures/animation_rotating_pendulum/frame1814.png b/figures/animation_rotating_pendulum/frame1814.png
new file mode 100644
index 0000000..ba87195
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1814.png differ
diff --git a/figures/animation_rotating_pendulum/frame1863.png b/figures/animation_rotating_pendulum/frame1863.png
new file mode 100644
index 0000000..f5c83ed
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1863.png differ
diff --git a/figures/animation_rotating_pendulum/frame1912.png b/figures/animation_rotating_pendulum/frame1912.png
new file mode 100644
index 0000000..c7f287e
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1912.png differ
diff --git a/figures/animation_rotating_pendulum/frame1961.png b/figures/animation_rotating_pendulum/frame1961.png
new file mode 100644
index 0000000..7f5655a
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame1961.png differ
diff --git a/figures/animation_rotating_pendulum/frame197.png b/figures/animation_rotating_pendulum/frame197.png
new file mode 100644
index 0000000..0b2465c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame197.png differ
diff --git a/figures/animation_rotating_pendulum/frame2010.png b/figures/animation_rotating_pendulum/frame2010.png
new file mode 100644
index 0000000..fe3db66
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2010.png differ
diff --git a/figures/animation_rotating_pendulum/frame2059.png b/figures/animation_rotating_pendulum/frame2059.png
new file mode 100644
index 0000000..4446624
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2059.png differ
diff --git a/figures/animation_rotating_pendulum/frame2108.png b/figures/animation_rotating_pendulum/frame2108.png
new file mode 100644
index 0000000..b26d3f0
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2108.png differ
diff --git a/figures/animation_rotating_pendulum/frame2157.png b/figures/animation_rotating_pendulum/frame2157.png
new file mode 100644
index 0000000..352e6db
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2157.png differ
diff --git a/figures/animation_rotating_pendulum/frame2206.png b/figures/animation_rotating_pendulum/frame2206.png
new file mode 100644
index 0000000..7e841cf
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2206.png differ
diff --git a/figures/animation_rotating_pendulum/frame2255.png b/figures/animation_rotating_pendulum/frame2255.png
new file mode 100644
index 0000000..e5dc1e4
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2255.png differ
diff --git a/figures/animation_rotating_pendulum/frame2304.png b/figures/animation_rotating_pendulum/frame2304.png
new file mode 100644
index 0000000..d4ed56b
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2304.png differ
diff --git a/figures/animation_rotating_pendulum/frame2353.png b/figures/animation_rotating_pendulum/frame2353.png
new file mode 100644
index 0000000..0e5f458
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2353.png differ
diff --git a/figures/animation_rotating_pendulum/frame2402.png b/figures/animation_rotating_pendulum/frame2402.png
new file mode 100644
index 0000000..46261bc
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2402.png differ
diff --git a/figures/animation_rotating_pendulum/frame2451.png b/figures/animation_rotating_pendulum/frame2451.png
new file mode 100644
index 0000000..7635489
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2451.png differ
diff --git a/figures/animation_rotating_pendulum/frame246.png b/figures/animation_rotating_pendulum/frame246.png
new file mode 100644
index 0000000..1ab2a99
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame246.png differ
diff --git a/figures/animation_rotating_pendulum/frame2500.png b/figures/animation_rotating_pendulum/frame2500.png
new file mode 100644
index 0000000..4ba4be3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2500.png differ
diff --git a/figures/animation_rotating_pendulum/frame2549.png b/figures/animation_rotating_pendulum/frame2549.png
new file mode 100644
index 0000000..ddb959e
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2549.png differ
diff --git a/figures/animation_rotating_pendulum/frame2598.png b/figures/animation_rotating_pendulum/frame2598.png
new file mode 100644
index 0000000..269d466
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2598.png differ
diff --git a/figures/animation_rotating_pendulum/frame2647.png b/figures/animation_rotating_pendulum/frame2647.png
new file mode 100644
index 0000000..d38afe9
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2647.png differ
diff --git a/figures/animation_rotating_pendulum/frame2696.png b/figures/animation_rotating_pendulum/frame2696.png
new file mode 100644
index 0000000..e4a31e3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2696.png differ
diff --git a/figures/animation_rotating_pendulum/frame2745.png b/figures/animation_rotating_pendulum/frame2745.png
new file mode 100644
index 0000000..a775d30
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2745.png differ
diff --git a/figures/animation_rotating_pendulum/frame2794.png b/figures/animation_rotating_pendulum/frame2794.png
new file mode 100644
index 0000000..eca87dc
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2794.png differ
diff --git a/figures/animation_rotating_pendulum/frame2843.png b/figures/animation_rotating_pendulum/frame2843.png
new file mode 100644
index 0000000..33c850a
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2843.png differ
diff --git a/figures/animation_rotating_pendulum/frame2892.png b/figures/animation_rotating_pendulum/frame2892.png
new file mode 100644
index 0000000..b9aefb3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2892.png differ
diff --git a/figures/animation_rotating_pendulum/frame2941.png b/figures/animation_rotating_pendulum/frame2941.png
new file mode 100644
index 0000000..7a74015
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2941.png differ
diff --git a/figures/animation_rotating_pendulum/frame295.png b/figures/animation_rotating_pendulum/frame295.png
new file mode 100644
index 0000000..675c2af
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame295.png differ
diff --git a/figures/animation_rotating_pendulum/frame2990.png b/figures/animation_rotating_pendulum/frame2990.png
new file mode 100644
index 0000000..7e15822
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame2990.png differ
diff --git a/figures/animation_rotating_pendulum/frame3039.png b/figures/animation_rotating_pendulum/frame3039.png
new file mode 100644
index 0000000..d0145bb
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3039.png differ
diff --git a/figures/animation_rotating_pendulum/frame3088.png b/figures/animation_rotating_pendulum/frame3088.png
new file mode 100644
index 0000000..1f69281
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3088.png differ
diff --git a/figures/animation_rotating_pendulum/frame3137.png b/figures/animation_rotating_pendulum/frame3137.png
new file mode 100644
index 0000000..f69c17c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3137.png differ
diff --git a/figures/animation_rotating_pendulum/frame3186.png b/figures/animation_rotating_pendulum/frame3186.png
new file mode 100644
index 0000000..8294028
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3186.png differ
diff --git a/figures/animation_rotating_pendulum/frame3235.png b/figures/animation_rotating_pendulum/frame3235.png
new file mode 100644
index 0000000..55a1c6d
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3235.png differ
diff --git a/figures/animation_rotating_pendulum/frame3284.png b/figures/animation_rotating_pendulum/frame3284.png
new file mode 100644
index 0000000..e98b748
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3284.png differ
diff --git a/figures/animation_rotating_pendulum/frame3333.png b/figures/animation_rotating_pendulum/frame3333.png
new file mode 100644
index 0000000..4cd0c38
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3333.png differ
diff --git a/figures/animation_rotating_pendulum/frame3382.png b/figures/animation_rotating_pendulum/frame3382.png
new file mode 100644
index 0000000..a1e383f
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3382.png differ
diff --git a/figures/animation_rotating_pendulum/frame3431.png b/figures/animation_rotating_pendulum/frame3431.png
new file mode 100644
index 0000000..5396ec2
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3431.png differ
diff --git a/figures/animation_rotating_pendulum/frame344.png b/figures/animation_rotating_pendulum/frame344.png
new file mode 100644
index 0000000..2080bd3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame344.png differ
diff --git a/figures/animation_rotating_pendulum/frame3480.png b/figures/animation_rotating_pendulum/frame3480.png
new file mode 100644
index 0000000..99eeb19
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3480.png differ
diff --git a/figures/animation_rotating_pendulum/frame3529.png b/figures/animation_rotating_pendulum/frame3529.png
new file mode 100644
index 0000000..c6b2091
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3529.png differ
diff --git a/figures/animation_rotating_pendulum/frame3578.png b/figures/animation_rotating_pendulum/frame3578.png
new file mode 100644
index 0000000..15fe3e8
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3578.png differ
diff --git a/figures/animation_rotating_pendulum/frame3627.png b/figures/animation_rotating_pendulum/frame3627.png
new file mode 100644
index 0000000..8516179
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3627.png differ
diff --git a/figures/animation_rotating_pendulum/frame3676.png b/figures/animation_rotating_pendulum/frame3676.png
new file mode 100644
index 0000000..a279e23
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3676.png differ
diff --git a/figures/animation_rotating_pendulum/frame3725.png b/figures/animation_rotating_pendulum/frame3725.png
new file mode 100644
index 0000000..d1ce7ae
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3725.png differ
diff --git a/figures/animation_rotating_pendulum/frame3774.png b/figures/animation_rotating_pendulum/frame3774.png
new file mode 100644
index 0000000..40f3bac
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3774.png differ
diff --git a/figures/animation_rotating_pendulum/frame3823.png b/figures/animation_rotating_pendulum/frame3823.png
new file mode 100644
index 0000000..040afdb
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3823.png differ
diff --git a/figures/animation_rotating_pendulum/frame3872.png b/figures/animation_rotating_pendulum/frame3872.png
new file mode 100644
index 0000000..a25ae65
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3872.png differ
diff --git a/figures/animation_rotating_pendulum/frame3921.png b/figures/animation_rotating_pendulum/frame3921.png
new file mode 100644
index 0000000..5496e63
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3921.png differ
diff --git a/figures/animation_rotating_pendulum/frame393.png b/figures/animation_rotating_pendulum/frame393.png
new file mode 100644
index 0000000..175e466
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame393.png differ
diff --git a/figures/animation_rotating_pendulum/frame3970.png b/figures/animation_rotating_pendulum/frame3970.png
new file mode 100644
index 0000000..66fcadd
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame3970.png differ
diff --git a/figures/animation_rotating_pendulum/frame4019.png b/figures/animation_rotating_pendulum/frame4019.png
new file mode 100644
index 0000000..0cd1505
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4019.png differ
diff --git a/figures/animation_rotating_pendulum/frame4068.png b/figures/animation_rotating_pendulum/frame4068.png
new file mode 100644
index 0000000..2c886cf
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4068.png differ
diff --git a/figures/animation_rotating_pendulum/frame4117.png b/figures/animation_rotating_pendulum/frame4117.png
new file mode 100644
index 0000000..4244bd6
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4117.png differ
diff --git a/figures/animation_rotating_pendulum/frame4166.png b/figures/animation_rotating_pendulum/frame4166.png
new file mode 100644
index 0000000..4d577e3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4166.png differ
diff --git a/figures/animation_rotating_pendulum/frame4215.png b/figures/animation_rotating_pendulum/frame4215.png
new file mode 100644
index 0000000..8373cab
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4215.png differ
diff --git a/figures/animation_rotating_pendulum/frame4264.png b/figures/animation_rotating_pendulum/frame4264.png
new file mode 100644
index 0000000..e415a3c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4264.png differ
diff --git a/figures/animation_rotating_pendulum/frame4313.png b/figures/animation_rotating_pendulum/frame4313.png
new file mode 100644
index 0000000..326290c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4313.png differ
diff --git a/figures/animation_rotating_pendulum/frame4362.png b/figures/animation_rotating_pendulum/frame4362.png
new file mode 100644
index 0000000..cb25783
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4362.png differ
diff --git a/figures/animation_rotating_pendulum/frame4411.png b/figures/animation_rotating_pendulum/frame4411.png
new file mode 100644
index 0000000..d26f9d3
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4411.png differ
diff --git a/figures/animation_rotating_pendulum/frame442.png b/figures/animation_rotating_pendulum/frame442.png
new file mode 100644
index 0000000..e85f4cf
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame442.png differ
diff --git a/figures/animation_rotating_pendulum/frame4460.png b/figures/animation_rotating_pendulum/frame4460.png
new file mode 100644
index 0000000..602dc36
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4460.png differ
diff --git a/figures/animation_rotating_pendulum/frame4509.png b/figures/animation_rotating_pendulum/frame4509.png
new file mode 100644
index 0000000..746c49b
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4509.png differ
diff --git a/figures/animation_rotating_pendulum/frame4558.png b/figures/animation_rotating_pendulum/frame4558.png
new file mode 100644
index 0000000..aed207c
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4558.png differ
diff --git a/figures/animation_rotating_pendulum/frame4607.png b/figures/animation_rotating_pendulum/frame4607.png
new file mode 100644
index 0000000..93c3a97
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4607.png differ
diff --git a/figures/animation_rotating_pendulum/frame4656.png b/figures/animation_rotating_pendulum/frame4656.png
new file mode 100644
index 0000000..ec447c6
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4656.png differ
diff --git a/figures/animation_rotating_pendulum/frame4705.png b/figures/animation_rotating_pendulum/frame4705.png
new file mode 100644
index 0000000..4345156
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4705.png differ
diff --git a/figures/animation_rotating_pendulum/frame4754.png b/figures/animation_rotating_pendulum/frame4754.png
new file mode 100644
index 0000000..4ed9908
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4754.png differ
diff --git a/figures/animation_rotating_pendulum/frame4803.png b/figures/animation_rotating_pendulum/frame4803.png
new file mode 100644
index 0000000..76ab351
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4803.png differ
diff --git a/figures/animation_rotating_pendulum/frame4852.png b/figures/animation_rotating_pendulum/frame4852.png
new file mode 100644
index 0000000..026fc52
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4852.png differ
diff --git a/figures/animation_rotating_pendulum/frame4901.png b/figures/animation_rotating_pendulum/frame4901.png
new file mode 100644
index 0000000..5144816
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame4901.png differ
diff --git a/figures/animation_rotating_pendulum/frame491.png b/figures/animation_rotating_pendulum/frame491.png
new file mode 100644
index 0000000..34d51b6
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame491.png differ
diff --git a/figures/animation_rotating_pendulum/frame540.png b/figures/animation_rotating_pendulum/frame540.png
new file mode 100644
index 0000000..effe69d
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame540.png differ
diff --git a/figures/animation_rotating_pendulum/frame589.png b/figures/animation_rotating_pendulum/frame589.png
new file mode 100644
index 0000000..65bb641
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame589.png differ
diff --git a/figures/animation_rotating_pendulum/frame638.png b/figures/animation_rotating_pendulum/frame638.png
new file mode 100644
index 0000000..8c23a6e
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame638.png differ
diff --git a/figures/animation_rotating_pendulum/frame687.png b/figures/animation_rotating_pendulum/frame687.png
new file mode 100644
index 0000000..114c0b1
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame687.png differ
diff --git a/figures/animation_rotating_pendulum/frame736.png b/figures/animation_rotating_pendulum/frame736.png
new file mode 100644
index 0000000..70c6b62
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame736.png differ
diff --git a/figures/animation_rotating_pendulum/frame785.png b/figures/animation_rotating_pendulum/frame785.png
new file mode 100644
index 0000000..578db5f
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame785.png differ
diff --git a/figures/animation_rotating_pendulum/frame834.png b/figures/animation_rotating_pendulum/frame834.png
new file mode 100644
index 0000000..86c873e
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame834.png differ
diff --git a/figures/animation_rotating_pendulum/frame883.png b/figures/animation_rotating_pendulum/frame883.png
new file mode 100644
index 0000000..e00513a
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame883.png differ
diff --git a/figures/animation_rotating_pendulum/frame932.png b/figures/animation_rotating_pendulum/frame932.png
new file mode 100644
index 0000000..50385c9
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame932.png differ
diff --git a/figures/animation_rotating_pendulum/frame981.png b/figures/animation_rotating_pendulum/frame981.png
new file mode 100644
index 0000000..2a4a875
Binary files /dev/null and b/figures/animation_rotating_pendulum/frame981.png differ
diff --git a/figures/animation_rotating_pendulum/w_1_anim.gif b/figures/animation_rotating_pendulum/w_1_anim.gif
new file mode 100644
index 0000000..8ca403a
Binary files /dev/null and b/figures/animation_rotating_pendulum/w_1_anim.gif differ
diff --git a/figures/animation_rotating_pendulum/w_5_anim.gif b/figures/animation_rotating_pendulum/w_5_anim.gif
new file mode 100644
index 0000000..adc97fd
Binary files /dev/null and b/figures/animation_rotating_pendulum/w_5_anim.gif differ
diff --git a/figures/rotating_pendulum.svg b/figures/rotating_pendulum.svg
new file mode 100644
index 0000000..12622bf
--- /dev/null
+++ b/figures/rotating_pendulum.svg
@@ -0,0 +1,343 @@
+
+
+
+
diff --git a/octave-workspace b/octave-workspace
index 2ee3267..14f8747 100644
Binary files a/octave-workspace and b/octave-workspace differ
diff --git a/rotating_pendulum.ipynb b/rotating_pendulum.ipynb
index c585767..ec659f3 100644
--- a/rotating_pendulum.ipynb
+++ b/rotating_pendulum.ipynb
@@ -50,7 +50,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 58,
"metadata": {
"collapsed": false
},
@@ -107,84 +107,137 @@
"\n",
"\n",
"\t\n",
- "\t\t\n",
+ "\t\t\n",
"\t\n",
"\n",
"\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
+ "\t\t-0.8\n",
+ "\t\n",
+ "\n",
+ "\n",
+ "\t\t\n",
+ "\t\t-0.6\n",
+ "\t\n",
+ "\n",
+ "\n",
+ "\t\t\n",
"\t\t-0.4\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t-0.2\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0.2\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0.4\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0.6\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0.8\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
+ "\t\t\n",
"\t\t0\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
- "\t\t0.5\n",
+ "\t\t\n",
+ "\t\t2\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
- "\t\t1\n",
+ "\t\t\n",
+ "\t\t4\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
- "\t\t1.5\n",
+ "\t\t\n",
+ "\t\t6\n",
"\t\n",
"\n",
"\n",
- "\t\t\n",
- "\t\t2\n",
+ "\t\t\n",
+ "\t\t8\n",
"\t\n",
"\n",
"\n",
+ "\t\t\n",
+ "\t\t10\n",
+ "\t\n",
"\n",
"\n",
- "\t\n",
+ "\t\t\n",
+ "\t\t12\n",
+ "\t\n",
+ "\n",
"\n",
+ "\t\t\n",
+ "\t\t14\n",
+ "\t\n",
"\n",
- "\tgnuplot_plot_1a\n",
+ "\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "\n",
+ "\t\n",
+ "\t\tangle (rad)\n",
+ "\t\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "\t\ttime (s)\n",
+ "\t\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "\tw=1 rad/s\n",
"\n",
"\n",
"\n",
- "\t\n",
+ "\t\n",
+ "\t\tw=1 rad/s\n",
"\t\n",
- "\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "\t\n",
+ "\tw=0 rad/s\n",
+ "\n",
+ "\t\n",
+ "\t\tw=0 rad/s\n",
+ "\t\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "\t\n",
+ "\n",
"\n",
"\n",
"\n",
@@ -208,63 +261,382 @@
"l=0.3;\n",
"a=1;\n",
"w=1;\n",
+ "g=9.81; \n",
"\n",
"my_ode=@(t,y) pend_rot(t,y,l,w,a)\n",
"\n",
- "[t,y]=ode23(my_ode,[0 2],[pi/6,0]);\n",
+ "[t,y]=ode23(my_ode,[0 4*pi/w],[pi/6,0]);\n",
"\n",
- "plot(t,y(:,1))\n"
+ "plot(t,y(:,1),t,pi/6*cos(sqrt(g/l)*t),'--')\n",
+ "legend('w=1 rad/s','w=0 rad/s')\n",
+ "xlabel('time (s)')\n",
+ "ylabel('angle (rad)')\n"
]
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 59,
"metadata": {
"collapsed": false
},
"outputs": [
{
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "error: A(I,J): column index out of bounds; value 4 out of bound 3\r\n"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\u001b[0;31muse_imwrite = 0\r\n",
- "use_imwrite = 0\r\n",
- "error: print: no axes object in figure to print\r\n",
- "error: called from\r\n",
- " print at line 304 column 5\r\n",
- " _make_figures>inner_print at line 68 column 5\r\n",
- " _make_figures>safe_print at line 59 column 5\r\n",
- " _make_figures at line 48 column 13\r\n",
- "\n",
- "\u001b[0m"
- ]
+ "data": {
+ "image/svg+xml": [
+ ""
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
}
],
"source": [
- "x=a*cos(w*t)+l*sin(y(:,1)); % x1-coordinate over time\n",
- "y=a*sin(w*t)+l*sin(y(:,1)); % y1-coordinate over time\n",
- "z=a-l*cos(y(:,1)); % z1-coordinate over time\n",
+ "x1=cos(w*t).*(a+l*sin(y(:,1))); % x1-coordinate over time\n",
+ "y1=sin(w*t).*(a+l*sin(y(:,1))); % y1-coordinate over time\n",
+ "z1=a-l*cos(y(:,1)); % z1-coordinate over time\n",
"linkx=[zeros(length(t),1),zeros(length(t),1),a*cos(w*t)];\n",
"linky=[zeros(length(t),1),zeros(length(t),1),a*sin(w*t)];\n",
"linkz=[zeros(length(t),1),a*ones(length(t),1),a*ones(length(t),1)];\n",
- "for i=1:length(t)\n",
+ "N=length(t);\n",
+ "nframes=100; \n",
+ "f=figure(1);\n",
+ "for i=1:floor(N/nframes):N\n",
" clf\n",
- " plot3(linkx(:,i),linky(:,i),linkz(:,i))\n",
+ " plot3(linkx(i,:),linky(i,:),linkz(i,:))\n",
" hold on\n",
- " plot3([linkx(3,i),x(i)],[linky(3,i),y(i)],[linkz(3,i),z(i)],'-o')\n",
+ " plot3([linkx(i,3),x1(i)],[linky(i,3),y1(i)],[linkz(i,3),z1(i)],'-o')\n",
+ " frameid=sprintf('./figures/animation_rotating_pendulum/frame%2.3i.png',i);\n",
+ " axis([-2 2 -2 2 0 1.5])\n",
+ " saveas(f,frameid)\n",
"end"
]
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": 52,
"metadata": {
"collapsed": false
},
@@ -275,29 +647,54 @@
"text": [
"ans =\n",
"\n",
- " 780 1\n",
+ " 4921 1\n",
"\n"
]
- },
+ }
+ ],
+ "source": [
+ "size(t)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i = 780\r\n"
+ ]
+ }
+ ],
+ "source": [
+ "i"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
{
- "name": "stderr",
+ "name": "stdout",
"output_type": "stream",
"text": [
- "\u001b[0;31muse_imwrite = 0\r\n",
- "use_imwrite = 0\r\n",
- "error: print: no axes object in figure to print\r\n",
- "error: called from\r\n",
- " print at line 304 column 5\r\n",
- " _make_figures>inner_print at line 68 column 5\r\n",
- " _make_figures>safe_print at line 59 column 5\r\n",
- " _make_figures at line 48 column 13\r\n",
+ "ans =\n",
"\n",
- "\u001b[0m"
+ " 1 3\n",
+ "\n"
]
}
],
"source": [
- "size(y)"
+ "size(linkx(3,:))"
]
},
{