summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus
diff options
context:
space:
mode:
Diffstat (limited to 'FSF-2020/calculus')
-rw-r--r--FSF-2020/calculus/intro-to-calculus/README.md8
-rw-r--r--FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md3
-rw-r--r--FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py72
-rw-r--r--FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md8
-rw-r--r--FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py65
-rw-r--r--FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py43
-rw-r--r--FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md8
-rw-r--r--FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py57
-rw-r--r--FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py111
-rw-r--r--FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py67
-rw-r--r--FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md8
-rw-r--r--FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py55
-rw-r--r--FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py78
-rw-r--r--FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py57
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/README.md18
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/Test1.py34
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/Test2.py26
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/limit1.py105
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/limit3.py95
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py76
-rw-r--r--FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py70
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md18
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py66
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py53
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py31
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py31
-rw-r--r--FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py31
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md20
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file1.gifbin0 -> 828501 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2a.gifbin0 -> 622617 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2b.gifbin0 -> 635274 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gifbin0 -> 955375 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file4.gifbin0 -> 660267 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file5.gifbin0 -> 177766 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file6.gifbin0 -> 955375 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file7.gifbin0 -> 793582 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py83
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py146
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py129
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py97
-rw-r--r--FSF-2020/calculus/series-and-transformations/Fourier Transform/video5_CoinsAnalogy.py225
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/README.md21
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/file1_laplaceTransformBasic.py67
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/file2_differentialEqSimplification.py78
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/file3_unitStepFunction.py168
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/file4_diracBasic.py61
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/file5_formationDiracDeltaFunction.py142
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunction.gifbin0 -> 60841 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunctionFormation.gifbin0 -> 315096 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformDiracFunction.gifbin0 -> 99703 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformUnitStepFunction.gifbin0 -> 151025 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/UnitStepFunctionExample.gifbin0 -> 192755 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/basicIntuition.gifbin0 -> 113203 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/solvingDEintuition.gifbin0 -> 196162 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/unitStepFunction.gifbin0 -> 56604 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/PowerSeriesQuestions.pdfbin112622 -> 118730 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/README.md14
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1_convergence_Intuition.gifbin0 -> 254804 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1a_convergence_Intuition.gifbin0 -> 123534 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file2_convergence_of_a_function.gifbin0 -> 503569 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file3_radius_and_intervalOfConvergence.gifbin0 -> 441251 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4_UniformConvergence.gifbin0 -> 261713 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4a_UniformConvergence.gifbin0 -> 476231 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/script1.py128
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/video1_convergence_Intuition.py (renamed from FSF-2020/calculus/series-and-transformations/Power Series/script2.py)37
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.py (renamed from FSF-2020/calculus/series-and-transformations/Power Series/script3.py)9
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py (renamed from FSF-2020/calculus/series-and-transformations/Power Series/script4.py)20
-rw-r--r--FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.py (renamed from FSF-2020/calculus/series-and-transformations/Power Series/script5.py)43
-rw-r--r--FSF-2020/calculus/series-and-transformations/README.md11
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/README.md11
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdfbin119804 -> 125254 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gifbin0 -> 667237 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gifbin0 -> 640160 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gifbin0 -> 640160 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gifbin0 -> 609653 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gifbin0 -> 400593 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py)83
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py)107
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py)22
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py)9
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/README.md9
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file1.gifbin0 -> 408025 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file2.gifbin0 -> 643692 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file3.gifbin0 -> 585127 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/video1_Sampling.py81
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/video2_ZTransformOfDelta.py121
-rw-r--r--FSF-2020/calculus/series-and-transformations/Z-Transform/video3_RegionOfConvergence.py144
87 files changed, 3120 insertions, 260 deletions
diff --git a/FSF-2020/calculus/intro-to-calculus/README.md b/FSF-2020/calculus/intro-to-calculus/README.md
index e69de29..a417361 100644
--- a/FSF-2020/calculus/intro-to-calculus/README.md
+++ b/FSF-2020/calculus/intro-to-calculus/README.md
@@ -0,0 +1,8 @@
+Contributor: Aryan Singh
+Subtopics covered
+ - When do limits exist?
+ - How Fast am I going?-An intro to derivatives
+ - Infinte sums in a nutshell(Riemann integrals)
+ - Fundamental Theorem of calculus
+ - Volume and surface area of Gabriel's Horn
+ - Infinite sequences and series
diff --git a/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md
new file mode 100644
index 0000000..c77d886
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md
@@ -0,0 +1,3 @@
+funda1
+![funda1](https://user-images.githubusercontent.com/61246381/87968966-e31b7780-cade-11ea-8b94-361460261a21.gif)
+
diff --git a/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py
new file mode 100644
index 0000000..fd40347
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py
@@ -0,0 +1,72 @@
+from manimlib.imports import *
+
+class funda1(GraphScene, MovingCameraScene):
+ def setup(self):
+ MovingCameraScene.setup(self)
+ GraphScene.setup(self)
+ CONFIG = {
+ "y_max": 5,
+ "x_max": 8,
+ "x_min": 0,
+ "y_min": 0,
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ "init_dx":0.5,
+ "x_axis_label":"$t$",
+ "y_axis_label":"$F(x)$",
+ "graph_origin": ORIGIN+2*DOWN+6*LEFT,
+ }
+ def construct(self):
+ self.setup_axes()
+ def func(x):
+ return 0.1*(x)*(x-3)*(x-7)+3
+
+ graph1 = self.get_graph(func, x_min = 0, x_max = 7)
+ graph2 = self.get_graph(func, x_min = 5, x_max = 6)
+ sqr = Square(side_length = 15.0).move_to(np.array([0.5,-1.5,0]))
+ line1 = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK)
+ line2 = self.get_vertical_line_to_graph(5,graph1,DashedLine, color = PINK)
+ line3 = self.get_vertical_line_to_graph(6,graph1,DashedLine, color = PINK)
+ line4 = self.get_vertical_line_to_graph(5.01,graph1,DashedLine, color = PINK)
+ t1 = TextMobject("a").next_to(line1, DOWN)
+ t2 = TextMobject("x").next_to(line2, DOWN)
+ t3 = TextMobject("x+h").next_to(line3, DOWN)
+ text1 = TexMobject(r"\int _{ a }^{ x+h }{ f(t)dt }").move_to(np.array([3,2,0])).scale(0.7)
+ text2 = TexMobject(r"\int _{ a }^{ x }{ f(t)dt }").move_to(np.array([1,2,0])).scale(0.7)
+ text3 = TexMobject(r"= \int _{ x }^{ x+h }{ f(t)dt }").move_to(np.array([3,2,0])).scale(0.7)
+ text4 = TexMobject(r"h \rightarrow 0").move_to(np.array([1,-1.5,0])).scale(0.8)
+ text5 = TexMobject(r"F^{ ' }\left( x \right)=\lim _{ h\rightarrow 0 }{ \frac { f(x).h }{ h } }").move_to(np.array([1,-1.5,0])).scale(0.2)
+ text6 = TexMobject(r"F^{ ' }\left( x \right)=f(x)").move_to(np.array([1,-1.5,0])).scale(0.2)
+ minus = TextMobject("-").move_to(np.array([0.2,2,0]))
+ group = VGroup(line1, line2, line3, t1, t2, t3)
+ brace1 = Brace(line2, LEFT).scale(0.35)
+ br1text = brace1.get_text(r"$f(x)$").next_to(brace1, 1.001*LEFT+1*RIGHT).scale(0.1)
+ brgrp = VGroup(brace1, br1text)
+ flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE))
+ riemann_rectangles_list3 = self.get_riemann_rectangles_list(graph1, 8, max_dx=self.init_dx, power_base=2, start_color = GREEN, end_color=GREEN, x_min =1, x_max = 6)
+ riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=BLUE_A,x_min = 1, x_max = 5)
+ riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=RED,end_color=RED,x_min = 5, x_max = 6)
+ riemann_rectangles_list4 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=RED,end_color=RED,x_min = 5, x_max = 5.01)
+
+ self.add(graph1)
+ self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list3[7]), ShowCreation(text1))
+ self.wait(3)
+ self.play(ShowCreation(group))
+ self.wait(1)
+ self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list2[7]), ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[7]))
+ self.play(FadeOut(riemann_rectangles_list3[7]))
+ self.wait(2)
+ self.play(ApplyMethod(text1.shift, 4*LEFT), ShowCreation(minus), ShowCreation(text2), ShowCreation(text3))
+ self.play(FadeOut(riemann_rectangles_list1[7]))
+ self.wait(3)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width,2.25,self.camera_frame.move_to,sqr,run_time = 2)
+ self.wait(2)
+ self.play(ReplacementTransform(riemann_rectangles_list2[7], riemann_rectangles_list4[7]), FadeOut(riemann_rectangles_list2[7]), ReplacementTransform(line3, line4), FadeOut(line3), ShowCreation(text4))
+ self.wait(2)
+ self.play(ShowCreation(brgrp))
+ self.wait(2)
+ self.play(ReplacementTransform(text4, text5))
+ self.wait(2)
+ self.play(ReplacementTransform(text5, text6))
+ self.wait(5) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md
new file mode 100644
index 0000000..ed548cb
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md
@@ -0,0 +1,8 @@
+horn
+![horn](https://user-images.githubusercontent.com/61246381/87972654-e9145700-cae4-11ea-80d8-06fde63b2a41.gif)
+
+volume
+![volume](https://user-images.githubusercontent.com/61246381/87972967-722b8e00-cae5-11ea-86eb-99ef7acd21b3.gif)
+
+surface area
+![surface](https://user-images.githubusercontent.com/61246381/87970986-4064f800-cae2-11ea-89b0-632864285e4b.gif)
diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py
new file mode 100644
index 0000000..16aeba9
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py
@@ -0,0 +1,65 @@
+from manimlib.imports import *
+class sphere(GraphScene, ThreeDScene):
+ CONFIG = {
+ 'x_min': 0,
+ 'x_max': 10,
+ 'y_min': -3,
+ 'y_max': 3,
+ 'graph_origin': ORIGIN,
+ "x_axis_width": 10,
+ "y_axis_height": 10,
+ "default_graph_style": {
+ "stroke_width": 2,
+ "stroke_color": WHITE,
+ }
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max- self.x_min)
+ YTD = self.y_axis_height/(self.y_max- self.y_min)
+
+ text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0]))
+ text1a = TexMobject(r"y=\frac { 1 }{ x }, x \ge 1").move_to(np.array([3,2,0]))
+ text2 = TexMobject(r"y=\frac { 1 }{ x }", r"\text{ is rotated in 3-dimensions}").to_corner(UL)
+ text3 = TextMobject("For calculating volume, consider a disc as shown").to_corner(UL)
+ text4 = TextMobject("Imagine the disc to move along the length of the horn").to_corner(UL)
+ text5 = TextMobject("In this way complete volume is covered").to_corner(UL)
+ arrow = Vector(np.array([0, np.sin(60*DEGREES), np.cos(60*DEGREES)])).shift(1*RIGHT)
+ text6 = TexMobject(r"\text{Area of circle is }", r"\pi {r}^{2}").to_corner(UL)
+ text7 = TextMobject("The disc moves along the length of hyperbolic curve").to_corner(UL)
+
+ axes = ThreeDAxes(**self.CONFIG)
+ self.setup_axes()
+ graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10)
+ graph2 = self.get_graph(lambda x : 1/x, x_min = 0.1, x_max = 10)
+ self.play(FadeIn(self.axes))
+ self.play(ShowCreation(graph2), FadeIn(text1))
+ self.wait(3)
+ self.play(Transform(graph2, graph1), ReplacementTransform(text1, text1a))
+ axes = ThreeDAxes(**self.CONFIG)
+ self.move_camera(phi = 90*DEGREES, theta=0*DEGREES,distance = 200, run_time=5)
+ horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1)
+ self.play(Transform(graph2, horn2), FadeOut(text1), FadeOut(graph2), ShowCreation(text2), FadeOut(text1a))
+ self.wait(2)
+ self.play(FadeOut(text2))
+ self.add_fixed_in_frame_mobjects(text3)
+ self.wait(1)
+ disc = ParametricSurface(lambda u, v : np.array([0, 1*v*np.sin(TAU*u), 1*v*np.cos(TAU*u)]), fill_opacity = 1, fill_color = PINK).shift(1*RIGHT)
+ self.play(ShowCreation(disc), ShowCreation(arrow))
+ self.play(FadeOut(text3))
+ self.add_fixed_in_frame_mobjects(text6)
+ self.wait(3)
+ self.play(FadeOut(text6))
+ self.add_fixed_in_frame_mobjects(text7)
+ self.wait(2)
+ self.move_camera(phi = 60*DEGREES, theta= -45*DEGREES, distance = 200, run_time=5)
+ k=0
+ while k<9:
+ disc1 = ParametricSurface(lambda u, v : np.array([0, (1/(1+k))*v*np.sin(TAU*u), (1/(1+k))*v*np.cos(TAU*u)]), fill_opacity = 0.5, fill_color = PINK).shift((1+k)*RIGHT)
+ self.play(FadeIn(disc1), run_time = 0.1)
+ k = k+0.1
+ self.play(FadeOut(text7))
+ self.add_fixed_in_frame_mobjects(text5)
+ self.wait(2)
+ self.begin_ambient_camera_rotation(rate = 0.4)
+ self.wait(10)
+ self.stop_ambient_camera_rotation() \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py
new file mode 100644
index 0000000..1e2a820
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py
@@ -0,0 +1,43 @@
+from manimlib.imports import *
+class surface(GraphScene, ThreeDScene):
+ CONFIG = {
+ 'x_min': 0,
+ 'x_max': 10,
+ 'y_min': -3,
+ 'y_max': 3,
+ 'graph_origin': ORIGIN,
+ "x_axis_width": 10,
+ "y_axis_height": 10,
+ "default_graph_style": {
+ "stroke_width": 2,
+ "stroke_color": RED,
+ }
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max- self.x_min)
+ YTD = self.y_axis_height/(self.y_max- self.y_min)
+
+ self.setup_axes()
+ text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0]))
+ text2 = TexMobject(r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx }", r"\text{ diverges}").to_corner(UL)
+ text3 = TexMobject(r"\text{Hence }", r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx=\infty }").to_corner(UL)
+ text4 = TextMobject("Which means surface area is infinity").to_corner(UL)
+ graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10)
+ self.play(FadeIn(self.axes))
+ self.play(ShowCreation(graph1), FadeIn(text1))
+ self.wait(5)
+ axes = ThreeDAxes(**self.CONFIG)
+ self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,distance = 200, run_time=5)
+ horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1)
+ horn3 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 1)
+ self.play(Transform(graph1, horn2))
+ self.play(FadeOut(text1))
+ self.add_fixed_in_frame_mobjects(text2)
+ self.wait(3)
+ self.play(FadeOut(text2))
+ self.add_fixed_in_frame_mobjects(text3)
+ self.wait(3)
+ self.play(ShowCreation(horn3))
+ self.play(FadeOut(text3))
+ self.add_fixed_in_frame_mobjects(text4)
+ self.wait(5) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md
new file mode 100644
index 0000000..1a735f9
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md
@@ -0,0 +1,8 @@
+convergence
+![convergence](https://user-images.githubusercontent.com/61246381/87969916-9cc71800-cae0-11ea-8792-fd44b5823279.gif)
+
+divergence
+![divergence](https://user-images.githubusercontent.com/61246381/87970033-cbdd8980-cae0-11ea-9ba6-47f48898dab2.gif)
+
+taylor series
+![taylor](https://user-images.githubusercontent.com/61246381/87970112-e9125800-cae0-11ea-9a19-edcaaf91d7b6.gif)
diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py
new file mode 100644
index 0000000..fcbcfb4
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py
@@ -0,0 +1,57 @@
+from manimlib.imports import *
+def GetCenters(width,center,n):
+ d = width / 4
+ list = [center + [0,d,0]]
+ if n > 1:
+ list.append(center + [-d,-d,0])
+ if n > 2:
+ list.extend(GetCenters(width / 2, center + [d,-d,0],n-2))
+ return list
+END_CENTERS = [ORIGIN]
+END_CENTERS.extend(GetCenters(3, 3 * RIGHT, 24))
+color_list = ['#00931F','#A93226','#D68910','#17A589','#2471A3','#884EA0','#E74C3C','#D4AC0D']
+COLORS = [color_list[i % len(color_list)] for i in range(50)]
+class RectangleFromSequence(Rectangle):
+ CONFIG = {
+ "sequence_number": 0,
+ "center": ORIGIN
+ }
+ def __init__(self, **kwargs):
+ digest_config(self, kwargs)
+ Rectangle.__init__(self,height = 3 * (1/2) ** ((self.sequence_number + 1) // 2),width = 3 * (1/2) ** ((self.sequence_number) // 2),**kwargs)
+ if self.sequence_number < 6:
+ if self.sequence_number == 0:
+ label = TexMobject("1")
+ else:
+ label = TexMobject("1/",str(2 ** self.sequence_number))
+ label.scale(0.8 ** self.sequence_number)
+ self.add(label)
+ self.label = label
+ self.set_fill(COLORS[self.sequence_number],1)
+ self.set_stroke(width = 1)
+ self.move_to(self.center)
+equation = TexMobject("\\sum_{n=0}^\\infty \\frac{1}{2^n} =","1","+","\\frac{1}{2}","+","\\frac{1}{4}","+","\\frac{1}{8}","+","\\frac{1}{16}","+ \\ldots","= 2")
+class Proof1(Scene):
+ def construct(self):
+ equation.to_edge(UL)
+ self.play(Write(equation[0:-1]))
+ rects = VGroup(*[RectangleFromSequence(sequence_number = i)for i in range(25)])
+ rects.arrange(RIGHT, buff=0.5)
+ left_center = 5*LEFT
+ rects.shift(left_center-rects[0].get_center())
+ for rect in rects:
+ rect.shift(DOWN*rect.get_top()+UP*3 / 2)
+ for i in range(25):
+ rects[i].generate_target()
+ rects[i].target.move_to(left_center+END_CENTERS[i])
+ self.wait()
+ for i in range(5):
+ self.play(GrowFromPoint(rects[i] , equation[2*i+1].get_center()))
+ self.play(*[GrowFromPoint(rects[i] , equation[-2].get_center())for i in range(5,25)])
+ self.wait()
+ for i in range(1,8):
+ self.play(MoveToTarget(rects[i]))
+ self.play(*[MoveToTarget(rects[i]) for i in range(8,25)])
+ self.wait(0.5)
+ self.play(Write(equation[-1]))
+ self.wait(3) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py
new file mode 100644
index 0000000..4f4bf7c
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py
@@ -0,0 +1,111 @@
+from manimlib.imports import *
+class divergence(GraphScene):
+ CONFIG = {
+ "y_max" : 2,
+ "y_min" : -2,
+ "x_max" : 20,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000,
+ "graph_origin" : ORIGIN+6*LEFT,
+ "x_labeled_nums": None,
+ "y_labeled_nums": [-2,-1,1,2],
+ "x_axis_label":r"${(-1)}^{n}$",
+ "y_axis_label":"$Sum$",
+ "x_axis_width": 10,
+ "y_axis_height": 4,
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max - self.x_min)
+ YTD = self.y_axis_height/(self.y_max - self.y_min)
+ text1 = TextMobject("Consider the series 1-1+1-1+1-1+1-......")
+ self.add(text1)
+ self.wait(3)
+ self.play(FadeOut(text1))
+ self.setup_axes()
+ rangeo = (20)//self.x_axis_width
+ for i in range(0,2):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.5*RIGHT)
+ self.add(texta)
+ for i in range(2,4):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.65*RIGHT)
+ self.add(texta)
+ for i in range(4,6):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.8*RIGHT)
+ self.add(texta)
+ for i in range(6,8):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.95*RIGHT)
+ self.add(texta)
+ for i in range(8,10):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.1*RIGHT)
+ self.add(texta)
+ for i in range(10,12):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.35*RIGHT)
+ self.add(texta)
+ for i in range(12,14):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.5*RIGHT)
+ self.add(texta)
+ for i in range(14,16):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.65*RIGHT)
+ self.add(texta)
+ for i in range(16,18):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.8*RIGHT)
+ self.add(texta)
+ for i in range(18,20):
+ texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.95*RIGHT)
+ self.add(texta)
+
+ text2 = TextMobject("Number of purple lines denotes the number of terms added").move_to(1*UP).scale(0.8)
+ self.play(ShowCreation(text2))
+ self.wait(4)
+ self.play(FadeOut(text2))
+ for i in range(0,2):
+ horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK)
+ verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0])))
+ botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK)
+ upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0])))
+ self.play(ShowCreation(botline), run_time = 0.2)
+ self.play(ShowCreation(upline), run_time = 0.2)
+ self.play(ShowCreation(horline), run_time = 0.2)
+ self.play(ShowCreation(verline), run_time = 0.2)
+
+ text3 = TextMobject("For even number of terms, sum is 0").move_to(1*UP).scale(0.8)
+ self.play(FadeIn(text3))
+ self.wait(4)
+ self.play(FadeOut(text3))
+ for i in range(2,4):
+ horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK)
+ verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0])))
+ botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK)
+ upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0])))
+ self.play(ShowCreation(botline), run_time = 0.2)
+ self.play(ShowCreation(upline), run_time = 0.2)
+ self.play(ShowCreation(horline), run_time = 0.2)
+ self.play(ShowCreation(verline), run_time = 0.2)
+ botline = Line(np.array([-6+4,0,0]), np.array([-5.5+4,0,0]), color = PINK)
+ upline = DashedVMobject(Line(np.array([-5.5+4,0,0]), np.array([-5.5+4,1,0])))
+ self.play(ShowCreation(botline))
+ self.play(ShowCreation(upline))
+ text4 = TextMobject("For odd number of terms, sum is 1").move_to(1.5*UP).scale(0.8)
+ self.play(FadeIn(text4))
+ self.wait(3)
+ for i in range(4,10):
+ horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK)
+ verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0])))
+ botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK)
+ upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0])))
+ self.play(ShowCreation(botline), run_time = 0.2)
+ self.play(ShowCreation(upline), run_time = 0.2)
+ self.play(ShowCreation(horline), run_time = 0.2)
+ self.play(ShowCreation(verline), run_time = 0.2)
+ text5 = TextMobject("The sum is oscillating between 1 and 0").move_to(1.5*UP).scale(0.8)
+ self.play(ReplacementTransform(text4, text5))
+ self.wait(4)
+ text6 = TextMobject("It does not coerce to a particular finite value").move_to(1.5*UP).scale(0.8)
+ self.play(ReplacementTransform(text5, text6))
+ self.wait(4)
+ text7 = TextMobject("Hence it diverges").move_to(1.5*UP).scale(0.8)
+ self.play(ReplacementTransform(text6, text7))
+ self.wait(3) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py
new file mode 100644
index 0000000..2e9d423
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py
@@ -0,0 +1,67 @@
+from manimlib.imports import *
+class conv(GraphScene):
+ CONFIG = {
+ "y_max" : 10,
+ "y_min" : 0,
+ "x_max" : 5,
+ "x_min" : -1,
+ "y_tick_frequency" : 5,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000,
+ "graph_origin" : ORIGIN+2*DOWN+6*LEFT,
+ "x_labeled_nums": list(range(0,6)),
+ "y_labeled_nums": list(range(0,11))[::1],
+ "x_axis_label":"x",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 9,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max - self.x_min)
+ YTD = self.y_axis_height/(self.y_max - self.y_min)
+ texta = TexMobject(r"\text{Expressing }", r"{e}^{x}", r"\text{ as its Taylor series}")
+ self.play(FadeIn(texta))
+ self.wait(3)
+ self.play(FadeOut(texta))
+ self.setup_axes()
+ graph1 = self.get_graph(lambda x : (np.e)**x, x_min = -1, x_max = 5, color = PINK)
+ graph2 = self.get_graph(lambda x : 1+x, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph3 = self.get_graph(lambda x : 1+(x)+(x**2)/2, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph4 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph5 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph6 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph7 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120+(x**6)/720, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ graph8 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120+(x**6)/720+(x**7)/5040, x_min = -1, x_max = 5, color = GREEN_SCREEN)
+ texta = TexMobject(r"{e}^{x}").move_to(self.graph_origin+ 1*RIGHT+2*UP)
+ textb = TexMobject(r"\therefore {e}^{x}=").move_to(3.5*LEFT+0.5*DOWN)
+ text1 = TexMobject(r"1+x").move_to(4*RIGHT)
+ text2 = TexMobject(r"+\frac{{x}^{2}}{2!}").move_to(4*RIGHT)
+ text3 = TexMobject(r"+\frac{{x}^{3}}{3!}").move_to(4*RIGHT)
+ text4 = TexMobject(r"+\frac{{x}^{4}}{4!}").move_to(4*RIGHT)
+ text5 = TexMobject(r"+\frac{{x}^{5}}{5!}").move_to(4*RIGHT)
+ text6 = TexMobject(r"+\frac{{x}^{6}}{6!}").move_to(4*RIGHT)
+ text7 = TexMobject(r"+\frac{{x}^{7}}{7!}+...").move_to(4.5*RIGHT)
+
+ self.play(ShowCreation(texta))
+ self.play(ShowCreation(graph1))
+ self.wait(3)
+ self.play(FadeOut(texta))
+ self.play(ShowCreation(graph2))
+ self.play(ShowCreation(text1))
+ self.wait(3)
+ self.play(ReplacementTransform(graph2, graph3), ApplyMethod(text1.shift, 1*LEFT), ShowCreation(text2))
+ self.wait(3)
+ self.play(ReplacementTransform(graph3, graph4), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ShowCreation(text3))
+ self.wait(3)
+ self.play(ReplacementTransform(graph4, graph5), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ShowCreation(text4))
+ self.wait(3)
+ self.play(ReplacementTransform(graph5, graph6), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ShowCreation(text5))
+ self.wait(3)
+ self.play(ReplacementTransform(graph6, graph7), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ApplyMethod(text5.shift, 1*LEFT), ShowCreation(text6))
+ self.wait(3)
+ self.play(ReplacementTransform(graph7, graph8),ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ApplyMethod(text5.shift, 1*LEFT), ApplyMethod(text6.shift, 1*LEFT), ShowCreation(text7))
+ self.wait(3)
+ grp = VGroup(text1, text2, text3, text4, text5, text6, text7)
+ self.play(ApplyMethod(grp.shift, 0.5*DOWN), FadeIn(textb))
+ self.wait(5) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md
new file mode 100644
index 0000000..294f716
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md
@@ -0,0 +1,8 @@
+derivative1
+![derivative1](https://user-images.githubusercontent.com/61246381/87973783-aeabb980-cae6-11ea-8b7a-e0dd089ebf09.gif)
+
+derivative2
+![derivative2](https://user-images.githubusercontent.com/61246381/87973861-c5eaa700-cae6-11ea-87e7-4915d68ab04f.gif)
+
+derivative3
+![derivative3](https://user-images.githubusercontent.com/61246381/87973900-d69b1d00-cae6-11ea-9459-c51564dbc35d.gif)
diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py
new file mode 100644
index 0000000..79a6fc6
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py
@@ -0,0 +1,55 @@
+from manimlib.imports import *
+class derivative1(GraphScene, Scene):
+ def setup(self):
+ GraphScene.setup(self)
+ CONFIG = {
+ "y_max" : 4,
+ "y_min" : -2,
+ "x_max" : 4,
+ "x_min" : -2,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+2*DOWN+4*LEFT,
+ "x_labeled_nums": list(range(-2,5)),
+ "y_labeled_nums": list(range(-2,5)),
+ "x_axis_label":"$x$",
+ "y_axis_label":r"$f(x)=y= 3-\frac { 3 }{ 2 } x$",
+ "x_axis_width": 5,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ #XTD = self.x_axis_width/(self.x_max - self.x_min)
+ #YTD = self.y_axis_height/(self.y_max - self.y_min)
+
+ text1 = TextMobject("")
+ text2 = TexMobject("{y}_{2}-{y}_{1}")
+ text2 = TexMobject("{x}_{2}-{x}_{1}")
+ text3 = TexMobject(r"m\quad =\frac { { y }_{ 2 }-{ y }_{ 1 } }{ { x }_{ 2 }-{ x }_{ 1 } }").move_to(np.array([3,0,0]))
+ text4 = TexMobject(r"m\quad =\frac { 3 }{ -2 }").move_to(np.array([3,0,0]))
+ text5 = TexMobject(r"m\quad =\quad -1.5").move_to(np.array([3,0,0]))
+ self.setup_axes()
+ graph_1 = self.get_graph(lambda x : 3-1.5*x, color = GREEN_SCREEN, x_min = -1, x_max = 3)
+ graph_2 = self.get_graph(lambda x : 3.1-1.5*x, color = ORANGE, x_min = 0, x_max = 2)
+ dot1 = Dot()
+ dot2 = SmallDot(self.graph_origin+1.7*RIGHT, color = PINK)
+ dot3 = SmallDot(self.graph_origin+2.5*UP, color = RED_B)
+ vec1 = Vector(2.5*DOWN, color = PINK).shift(self.graph_origin+2.5*UP)
+ vec2 = Vector(1.7*RIGHT, color = RED_B).shift(self.graph_origin)
+ brace1 = Brace(vec1, LEFT)
+ brace2 = Brace(vec2, DOWN)
+ br1text = brace1.get_text(r"${y}_{2}-{y}_{1}$").next_to(brace1, LEFT)
+ br2text = brace2.get_text(r"${x}_{2}-{x}_{1}$").next_to(brace2, DOWN)
+ self.play(ShowCreation(graph_1), ShowCreation(dot2), ShowCreation(dot3))
+ self.play(MoveAlongPath(dot1, graph_2), ShowCreation(vec1), ShowCreation(vec2), run_time = 3)
+ self.wait(1)
+ self.play(ShowCreation(brace1), ShowCreation(brace2))
+ self.play(ShowCreation(br1text), ShowCreation(br2text))
+ self.wait(2)
+ self.play(GrowFromCenter(text3))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text3, text4))
+ self.wait(2)
+ self.play(ReplacementTransform(text4, text5))
+ self.wait(2)
diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py
new file mode 100644
index 0000000..d6aab15
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py
@@ -0,0 +1,78 @@
+from manimlib.imports import *
+class derivative2(GraphScene, MovingCameraScene):
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+ CONFIG = {
+ "y_max" : 100,
+ "y_min" : 0,
+ "x_max" : 10,
+ "x_min" : 0,
+ "y_tick_frequency" : 100,
+ "x_tick_frequency" : 10,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN,
+ "x_labeled_nums": None,#list(range(0,11)),
+ "y_labeled_nums": None,#list(range(0,101))[::10],
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 5,
+ "y_axis_height": 5,
+ "start_x" : 2,
+ "start_dx" : 6,
+ "df_color" : YELLOW,
+ "dx_color" : GREEN,
+ "secant_line_color" : MAROON_B,
+ "zoomed_camera_frame_starting_position": ORIGIN+2*DOWN+6*LEFT,
+ }
+ def construct(self):
+ self.setup()
+ self.camera_frame.save_state()
+ self.graph_origin = ORIGIN+2*DOWN+6*LEFT
+ self.setup_axes()
+ graph23 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 0, x_max = 10)
+ graph24 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 8, x_max = 2.01)
+ line_1 = DashedVMobject(Line(np.array([-5,-2,0]), np.array([-5,-1.42,0])))
+ textdef = TextMobject("")
+ text1 = TexMobject("{ x }_{ 0 }").move_to(np.array([-5,-2.2,0]))
+ text2 = TextMobject("The line becomes tangential to the curve").move_to(self.graph_origin+RIGHT+0.5*UP).scale(0.01)
+ text3 = TexMobject(r"\frac { df }{ dx } =\frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h-0 }").move_to(2*RIGHT)
+ text4 = TexMobject(r"\frac { df }{ dx } =\lim _{ h\rightarrow 0 }{ \frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h } }").move_to(2*RIGHT)
+ squareobj = Square(side_length = 15).move_to(self.graph_origin+RIGHT+0.53*UP)
+ ss_group = self.get_secant_slope_group(
+ self.start_x, graph23,
+ dx = self.start_dx,
+ dx_label = "h",
+ df_label = "df",
+ df_line_color = self.df_color,
+ dx_line_color = self.dx_color,
+ secant_line_color = self.secant_line_color,
+ dot_df_top = True,
+ dot_dx_start = True,
+ dot_df_top_label = "Q",
+ dot_dx_start_label = "P",
+ secant_line_length = 8
+ )
+ self.play(ShowCreation(graph23))
+ self.wait()
+ self.play(ShowCreation(ss_group.secant_line))
+ self.add(text1)
+ self.play(ShowCreation(line_1))
+ self.wait(3)
+ self.play(ShowCreation(ss_group.dx_line))
+ self.play(ShowCreation(ss_group.dx_label))
+ self.play(ShowCreation(ss_group.df_line))
+ self.play(Write(ss_group.df_label))
+ self.play(ShowCreation(ss_group.dot_df_top), ShowCreation(ss_group.dot_dx_start))
+ self.play(ShowCreation(ss_group.dot_df_top_label), ShowCreation(ss_group.dot_dx_start_label))
+ self.wait()
+ self.play(ShowCreation(text3))
+ self.wait(2)
+ self.play(ReplacementTransform(text3, text4))
+ self.animate_secant_slope_group_change(ss_group, target_dx = 0.01, run_time = 5)
+ self.wait(2)
+ self.play(self.camera_frame.set_width,0.2,self.camera_frame.move_to,squareobj,run_time = 2)
+ self.wait()
+ self.play(ShowCreation(text2))
+ self.wait(3)
diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py
new file mode 100644
index 0000000..ebbacb1
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py
@@ -0,0 +1,57 @@
+from manimlib.imports import *
+class derivative3(GraphScene, Scene):
+ def setup(self):
+ Scene.setup(self)
+ #ZoomedScene.setup(self)
+ CONFIG = {
+ "y_max" : 8,
+ "y_min" : 0,
+ "x_max" : 11,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+3*DOWN+6.5*LEFT,
+ "x_labeled_nums": list(range(0,12))[::1],
+ "y_labeled_nums": list(range(0,9))[::1],
+ "x_axis_label":"$t$",
+ "y_axis_label":"$s$",
+ "x_axis_width": 5,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max - self.x_min)
+ YTD = self.y_axis_height/(self.y_max - self.y_min)
+
+ self.setup_axes()
+ graph_1 = self.get_graph(lambda x : -(x-2)**2+4, color = GOLD_A, x_min = 0, x_max = 1.5)
+ graph_2 = self.get_graph(lambda x : 1*x+2.25, color = GOLD_A, x_min = 1.5, x_max = 5)
+ graph_3 = self.get_graph(lambda x : 7.25, color = GOLD_A, x_min = 5, x_max = 8)
+ graph_4 = self.get_graph(lambda x : -3.625*x + 36.25, color = GOLD_A, x_min = 8, x_max = 10)
+
+ self.y_max = 5
+ self.x_max = 10
+ self.x_min = 0
+ self.y_min = -5
+ self.x_labeled_nums = list(range(0,11))
+ self.y_labeled_nums = list(range(-5,6))[::1]
+ self.x_axis_label = r"$t$"
+ self.y_axis_label = r"$v$"
+ self.y_tick_frequency = 1
+ self.x_tick_frequency = 1
+ self.graph_origin = ORIGIN+1*RIGHT
+ self.setup_axes()
+ graph_5 = self.get_graph(lambda x : 2*(x-2)+4, color = GREEN_SCREEN, x_min = 0, x_max = 1.5)
+ graph_6 = self.get_graph(lambda x : 3, color = GREEN_SCREEN, x_min = 1.5, x_max = 5)
+ graph_7 = self.get_graph(lambda x : 0, color = GREEN_SCREEN, x_min = 5, x_max = 8)
+ graph_8 = self.get_graph(lambda x : -3.625, color = GREEN_SCREEN, x_min = 8, x_max = 10)
+ line1 = DashedVMobject(Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.5*RIGHT+1.5*UP))
+ line2 = DashedVMobject(Line(self.graph_origin+4*RIGHT, self.graph_origin+4*RIGHT+1.835*DOWN))
+ self.play(ShowCreation(graph_1), ShowCreation(graph_5), run_time = 3)
+ self.play(ShowCreation(graph_2), ShowCreation(graph_6), run_time = 3)
+ self.add(line1)
+ self.play(ShowCreation(graph_3), ShowCreation(graph_7), run_time = 3)
+ self.add(line2)
+ self.play(ShowCreation(graph_4), ShowCreation(graph_8), run_time = 3)
+ self.wait(3)
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/README.md b/FSF-2020/calculus/intro-to-calculus/limit/README.md
new file mode 100644
index 0000000..d56950e
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/README.md
@@ -0,0 +1,18 @@
+Test1
+![Test1](https://user-images.githubusercontent.com/61246381/87964777-57065180-cad8-11ea-8938-8758481ea38f.gif)
+
+Test2
+![Test2](https://user-images.githubusercontent.com/61246381/87964839-6daca880-cad8-11ea-9b8e-9b60b3d162ae.gif)
+
+limit1
+![limit1](https://user-images.githubusercontent.com/61246381/87966913-9b472100-cadb-11ea-8d9b-ce469f8d1379.gif)
+
+limit3
+![limit3](https://user-images.githubusercontent.com/61246381/87967364-51ab0600-cadc-11ea-9e1e-fd89f6db8f9d.gif)
+
+limitfin1
+![limitfin1](https://user-images.githubusercontent.com/61246381/87964053-46091080-cad7-11ea-8bae-7affe799ffbf.gif)
+
+limitfin2
+![limitfin2](https://user-images.githubusercontent.com/61246381/87964169-7355be80-cad7-11ea-8682-2e8cdd403426.gif)
+
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/Test1.py b/FSF-2020/calculus/intro-to-calculus/limit/Test1.py
new file mode 100644
index 0000000..bd7d2a6
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/Test1.py
@@ -0,0 +1,34 @@
+from manimlib.imports import *
+class Test1(GraphScene):
+ CONFIG = {
+ "y_max" : 5,
+ "y_min" : -5,
+ "x_max" : 5,
+ "x_min" : -5,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : BLUE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN,
+ "x_labeled_nums": list(range(-5,6)),
+ "y_labeled_nums": list(range(-5,6)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"${ f }_{ 1 }(x)$"
+ }
+ def construct(self):
+ self.setup_axes()
+ cir1 = Circle(radius = 0.1, color = BLUE)
+ graph_1 = self.get_graph(lambda x : x+2,
+ color = GREEN,
+ x_min = -5, # Domain 1
+ x_max = +1.9
+ )
+ graph_2 =self.get_graph(lambda x : x+2,
+ color = GREEN,
+ x_min = 2.1, # Domain 2
+ x_max = 5
+ )
+ cir1.move_to(np.array([1,2,0]))
+ self.play(ShowCreation(graph_1))
+ self.play(ShowCreation(cir1))
+ self.play(ShowCreation(graph_2))
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/Test2.py b/FSF-2020/calculus/intro-to-calculus/limit/Test2.py
new file mode 100644
index 0000000..0efb565
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/Test2.py
@@ -0,0 +1,26 @@
+from manimlib.imports import *
+class Test2(GraphScene):
+ CONFIG = {
+ "y_max" : 5,
+ "y_min" : -5,
+ "x_max" : 5,
+ "x_min" : -5,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : BLUE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN,
+ "x_labeled_nums": list(range(-5,6)),
+ "y_labeled_nums": list(range(-5,6)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"${ f }_{ 1 }(x)$"
+ }
+ def construct(self):
+ self.setup_axes()
+ graph_1 = self.get_graph(lambda x : x+2,
+ color = GREEN,
+ x_min = -5, # Domain 1
+ x_max = +5
+ )
+ self.play(ShowCreation(graph_1))
+ self.wait()
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limit1.py b/FSF-2020/calculus/intro-to-calculus/limit/limit1.py
new file mode 100644
index 0000000..fe5cb1e
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/limit1.py
@@ -0,0 +1,105 @@
+from manimlib.imports import *
+class limit1(GraphScene,MovingCameraScene):
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+ CONFIG = {
+ "y_max" : 1,
+ "y_min" : 0,
+ "x_max" : 1,
+ "x_min" : -1,
+ "y_tick_frequency" : 0.2,
+ "x_tick_frequency" : 0.2,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+3*DOWN,
+ "x_labeled_nums": list(range(-1,2)),
+ "y_labeled_nums": list(range(0,2)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max - self.x_min)
+ YTD = self.y_axis_height/(self.y_max - self.y_min)
+
+ dot1 = SmallDot(np.array([0.025,-2.975,0]))
+ dot2 = SmallDot(np.array([-0.025,-2.975,0]))
+ sqr = Square(side_length = 15.0).move_to(np.array([0,-3,0]))
+ brline1 = DashedVMobject(Line(np.array([0.15,-3,0]), np.array([0.15,-2.85,0])))
+ brline2 = DashedVMobject(Line(np.array([0.025,-3,0]), np.array([0.025,-2.975,0])))
+ brline3 = DashedVMobject(Line(np.array([-0.15,-3,0]), np.array([-0.15,-2.85,0])))
+ brline4 = DashedVMobject(Line(np.array([-0.025,-3,0]), np.array([-0.025,-2.975,0])))
+ textdef = TextMobject("")
+ text003 = TextMobject("0.03").move_to(np.array([0.15,-3.05,0])).scale(0.1)
+ textazero1 = TexMobject(r"\approx 0").move_to(np.array([0.04,-3.05,0])).scale(0.1)
+ textazero2 = TexMobject(r"\approx 0").move_to(np.array([-0.04,-3.05,0])).scale(0.1)
+ textm003 = TextMobject("-0.03").move_to(np.array([-0.15,-3.05,0])).scale(0.1)
+ text2 = TextMobject("Let f(x) = |x|. We'll check neighbourhood of origin")
+ text3 = TextMobject("h has to be a very small number greater than 0").move_to(np.array([0,-3.3,0])).scale(0.2)
+ text4 = TextMobject("The point travels through range of neighbourhood").move_to(np.array([0,-3.3,0])).scale(0.19)
+ text5 = TextMobject("let h be equal to 0.03").move_to(np.array([0,-3.3,0])).scale(0.25)
+ text6 = TextMobject("Notice how the point never touches the origin").move_to(np.array([0,-3.3,0])).scale(0.2)
+ text7 = TextMobject("Green line shows the Right hand neighbourhood of origin").move_to(np.array([0,-3.3,0])).scale(0.17)
+ text8 = TextMobject("The point is approaching (0,0) for the values of x which are positive").move_to(np.array([0,-3.3,0])).scale(0.1)
+ text9 = TextMobject("Values of x are tending to 0 from positive side").move_to(np.array([0,-3.3,0])).scale(0.19)
+ text10 = TexMobject(r"\text {Notation for this is }",r"x\rightarrow { 0 }^{ + }").move_to(np.array([0,-3.3,0])).scale(0.25)
+ text11 = TextMobject("Similar case can be made for negative values of x").move_to(np.array([0,-3.3,0])).scale(0.19)
+ text12 = TextMobject("The point is approaching (0,0) for the values of x which are negative").move_to(np.array([0,-3.3,0])).scale(0.1)
+ text13 = TextMobject("Values of x are tending to 0 from negative side").move_to(np.array([0,-3.3,0])).scale(0.19)
+ text14 = TexMobject(r"\text {Notation for this is }",r"x\rightarrow { 0 }^{ - }").move_to(np.array([0,-3.3,0])).scale(0.25)
+
+
+ self.play(FadeIn(text2), run_time = 1.5)
+ self.wait(2.5)
+ self.setup_axes()
+ graph_1 = self.get_graph(lambda x : x, color = RED, x_min = 0, x_max = 1)
+ graph_2 = self.get_graph(lambda x : -x, color = RED, x_min = 0, x_max = -1)
+ graph_3 = self.get_graph(lambda x : x,color = RED, x_min = 0.005, x_max = 0.03)
+ graph_4 = self.get_graph(lambda x : x,color = GREEN_SCREEN, x_min = 0.03, x_max = 0.005)
+ graph_5 = self.get_graph(lambda x : -x,color = GREEN_SCREEN, x_min = -0.03, x_max = -0.005)
+ grp1 = VGroup(graph_1,graph_2)
+ grp2 = VGroup(brline2, textazero1)
+ grp3 = VGroup(textazero2, textm003, brline3, brline4)
+ self.play(ShowCreation(grp1))
+ self.add(sqr)
+ self.play(ReplacementTransform(text2, text3))
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width,2.25,self.camera_frame.move_to,sqr,run_time = 2)
+ self.wait(2.5)
+ self.play(ReplacementTransform(text3, text4), ShowCreation(dot1))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text4, text5), ShowCreation(brline1), ShowCreation(text003))
+ self.wait(2.5)
+ for i in range(0,3):
+ self.play(MoveAlongPath(dot1,graph_3), run_time = 0.5)
+ self.play(MoveAlongPath(dot1,graph_4), run_time = 0.5)
+ self.play(ReplacementTransform(text5, text6), ShowCreation(grp2))
+ self.wait(2)
+ self.play(FadeOut(dot1))
+ self.add(graph_4)
+ self.play(ReplacementTransform(text6, text7))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text7,text8))
+ for i in range(0,3):
+ self.play(MoveAlongPath(dot1,graph_4), run_time = 0.7)
+ self.play(ReplacementTransform(text8, text9))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text9, text10))
+ self.wait(2.5)
+ self.play(ShowCreation(grp3), ReplacementTransform(text10, text11), FadeOut(dot1))
+ self.add(graph_5)
+ for i in range(0,3):
+ self.play(MoveAlongPath(dot2, graph_5), run_time = 0.7)
+ self.play(ReplacementTransform(text11, text12))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text12, text13))
+ self.wait(2.5)
+ self.play(ReplacementTransform(text13, text14))
+ self.wait(2)
+ self.play(FadeOut(dot2), ReplacementTransform(text14, textdef))
+ self.wait(2)
+ self.play(Restore(self.camera_frame))
+
+ self.wait(2.5)
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limit3.py b/FSF-2020/calculus/intro-to-calculus/limit/limit3.py
new file mode 100644
index 0000000..a4f07d7
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/limit3.py
@@ -0,0 +1,95 @@
+from manimlib.imports import *
+class limit3(GraphScene, MovingCameraScene):
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+ CONFIG = {
+ "y_max" : 10,
+ "y_min" : 0,
+ "x_max" : 100,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 10,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+3*DOWN+4*LEFT,
+ "x_labeled_nums": list(range(0,101))[::10],
+ "y_labeled_nums": list(range(0,11)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ XTD = self.x_axis_width/(self.x_max - self.x_min)
+ YTD = self.y_axis_height/(self.y_max - self.y_min)
+ sqr1 = Square(side_length = 15).move_to(np.array([1,0.5,0]))
+ sqr2 = Square(side_length = 15).move_to(np.array([-4,-3,0]))
+
+ textdef = TextMobject("")
+ text20 = TextMobject("f(x) is not defined at x=50").move_to(np.array([1,0.3,0])).scale(0.2)
+ text21 = TexMobject(r"\text {f(x) is not defined in interval }",r" (-\infty ,\quad 1]").move_to(np.array([-4,-3.2,0])).scale(0.18)
+ text22 = TextMobject("1").move_to(np.array([-3.9,-3.05,0])).scale(0.2)
+ text1 = TexMobject(r"\text {Let }" ,r"f\left( x \right) =\begin{cases} \sqrt { x-1 } ,x\in \quad (1,\infty )-50 \end{cases}")
+ text2 = TextMobject("Graph of f(x) is ")
+ text3 = TextMobject("Right hand neighbour of 50 will approximately be 50.000001").move_to(np.array([1,0.3,0])).scale(0.15)
+ text4 = TextMobject("Left hand neighbour of 50 will approximately be 49.999999").move_to(np.array([1,0.3,0])).scale(0.15)
+ text5 = TexMobject(r"\text {Hence R.H.L }", r"=\lim _{ x\rightarrow { 50 }^{ + } }{ \sqrt { 50.000001 - 1 } } \approx 7.000000071").move_to(np.array([1,0.3,0])).scale(0.13)
+ text6 = TexMobject(r"\text{Hence L.H.L }", r" = \lim _{ x\rightarrow { 50 }^{ - } }{ \sqrt { 49.999999-1 } }\approx 6.999999929").move_to(np.array([1,0.3,0])).scale(0.13)
+ text7 = TextMobject("7.000000071").move_to(np.array([1.9,0.25,0])).scale(0.1)
+ text8 = TextMobject("6.999999929").move_to(np.array([0.1,0.25,0])).scale(0.1)
+ text9 = TexMobject(r"6.999999929\quad \approx \quad 7.000000071 \quad \approx 7").move_to(np.array([1,0.25,0])).scale(0.2)
+ text10 = TexMobject(r"\text{Because LHL }" ,r"\approx" ,r"\text{ RHL, Limit exists at x=50 and equals 7").move_to(np.array([1,0.25,0])).scale(0.13)
+ text11 = TextMobject("There is no Left hand neighbour of x=1").move_to(np.array([-4,-3.2,0])).scale(0.22)
+ text12 = TexMobject(r"\therefore\quad \lim _{ x\rightarrow 0 }{ f(x) } \quad =\quad \lim _{ x\rightarrow { 0 }^{ + } }{ f(x) } ").move_to(np.array([-4,-3.2,0])).scale(0.25)
+ text13 = TexMobject(r"\text {R.H.L =}",r" \lim _{ x\rightarrow { 0 }^{ + } }{ \sqrt { 1.000000000001-1 } } \quad \approx 0").move_to(np.array([-4,-3.2,0])).scale(0.13)
+ text14 = TexMobject(r"\therefore \quad \lim _{ x\rightarrow 0 }{ f(x)\quad =\quad 0 }").move_to(np.array([-4,-3.2,0])).scale(0.13)
+ self.camera_frame.save_state()
+ self.play(ShowCreation(text1))
+ self.wait(3)
+ self.play(ReplacementTransform(text1, text2))
+ self.wait()
+ self.play(ReplacementTransform(text2, textdef))
+ self.setup_axes()
+ self.setup()
+ graph_1 = self.get_graph(lambda x : (x-1)**(1/2),color = PINK, x_min = 1, x_max = 49.9)
+ graph_2 = self.get_graph(lambda x : (x-1)**(1/2),color = PINK, x_min = 50.1, x_max = 100)
+ graph_3 = self.get_graph(lambda x : (x-1)**(1/2),color = PINK, x_min = 1.05, x_max = 1.001)
+ dot1 = SmallDot(color = PURPLE_A)
+ cir = Circle(radius = 0.01, color = GREEN_SCREEN).move_to(np.array([1,0.5,0]))
+ grp1 = VGroup(graph_1, graph_2, cir)
+ grp2 = VGroup(text7, text8)
+ self.play(ShowCreation(grp1))
+ self.wait(2)
+ self.play(self.camera_frame.set_width,2.25,self.camera_frame.move_to,sqr1,run_time = 2)
+ self.wait(1)
+ self.play(ShowCreation(text20))
+ self.wait(2)
+ self.play(ReplacementTransform(text20, text3))
+ self.wait(3)
+ self.play(ReplacementTransform(text3, text5))
+ self.wait(3)
+ self.play(ReplacementTransform(text5, text7), ShowCreation(text4))
+ self.wait(4)
+ self.play(ReplacementTransform(text4, text6))
+ self.wait(3)
+ self.play(ReplacementTransform(text6, text8))
+ self.wait(1.5)
+ self.play(ReplacementTransform(grp2, text9))
+ self.wait(1.5)
+ self.play(ReplacementTransform(text9, text10))
+ self.wait(3)
+ self.play(self.camera_frame.set_width,2.25,self.camera_frame.move_to,sqr2,run_time = 2)
+ self.play(ShowCreation(text21), ShowCreation(text22))
+ self.play(MoveAlongPath(dot1, graph_3), run_time = 3)
+ self.wait(3)
+ self.play(ReplacementTransform(text21, text11))
+ self.wait(3)
+ self.play(ReplacementTransform(text11, text12))
+ self.wait(3)
+ self.play(ReplacementTransform(text12, text13))
+ self.wait(2)
+ self.play(ReplacementTransform(text13, text14))
+ self.wait(3)
+ self.play(ReplacementTransform(text14, textdef))
+ self.wait(2)
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py b/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py
new file mode 100644
index 0000000..ba57a15
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py
@@ -0,0 +1,76 @@
+from manimlib.imports import *
+class limitfin1(GraphScene):
+ CONFIG = {
+ "x_min" : -8,
+ "x_max" : 8,
+ "x_labeled_nums" : list(range(-8, 10, 3)),
+ "x_axis_width" : FRAME_WIDTH - LARGE_BUFF,
+ "y_min" : -4,
+ "y_max" : 4,
+ "y_labeled_nums" : None,
+ "y_axis_height" : FRAME_HEIGHT+2*LARGE_BUFF,
+ "graph_origin" : DOWN,
+ "graph_color" : BLUE,
+ "x_axis_width":20,
+ "y_axis_height":10,
+ }
+ def construct(self):
+ self.setup_axes()
+ XTD = 10/(8 - (-8))
+ YTD = 10/(4 - (-4))
+ graph1 = self.get_graph(lambda x: x**3 +1.5, x_min = self.x_min, x_max = -0.1)
+ graph2 = self.get_graph(lambda x: x**3 +1.5, x_min = 0.1, x_max = self.x_max, color = self.graph_color)
+ dot2 = Circle(radius = 0.1).move_to(self.graph_origin+1.5*UP*YTD)
+ text0 = TextMobject("Let L be the value of f(x) at point denoted by circle").move_to(self.graph_origin+2*DOWN)
+ text1 = TexMobject(r"\text{As }", r"\delta",r"\text{ tends to zero }" ,r"\epsilon" r"\text{ tends to zero}").move_to(self.graph_origin+2*DOWN)
+ text2 = TexMobject(r"\text{For all values in }", r"(-\delta, +\delta)",r"\text{ you will always find a real and finite value of f(x) in }",r"(L-\epsilon, L+\epsilon)").move_to(self.graph_origin+2*DOWN).scale(0.6)
+ self.play(ShowCreation(graph1), ShowCreation(graph2), ShowCreation(text0), FadeIn(dot2))
+ line1 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*LEFT*XTD, self.graph_origin+4*UP*YTD+1*LEFT*XTD), num_dashes = 50).set_color(PINK)
+ line2 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*RIGHT*XTD, self.graph_origin+4*UP*YTD+1*RIGHT*XTD), num_dashes = 50).set_color(PINK)
+ line3 = DashedVMobject(Line(self.graph_origin+1.5*UP*YTD+5*LEFT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ line4 = DashedVMobject(Line(self.graph_origin+0.5*UP*YTD+5*LEFT*XTD, self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ line5 = DashedVMobject(Line(self.graph_origin+2.5*UP*YTD+5*LEFT*XTD, self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ self.play(ShowCreation(line1), ShowCreation(line2))
+ vec1 = Line(self.graph_origin, self.graph_origin+1*RIGHT*XTD)
+ vec2 = Line(self.graph_origin, self.graph_origin+1*LEFT*XTD)
+ vec5 = Line(self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ vec6 = Line(self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ brace1 = Brace(vec1, DOWN)
+ brace2 = Brace(vec2, DOWN)
+ br1text = brace1.get_text(r"$\delta$").next_to(brace1, DOWN)
+ br2text = brace2.get_text(r"$\delta$").next_to(brace2, DOWN)
+ brace5 = Brace(vec5, RIGHT)
+ brace6 = Brace(vec6, RIGHT)
+ br5text = brace5.get_text(r"$\epsilon$").next_to(brace5, RIGHT)
+ br6text = brace6.get_text(r"$\epsilon$").next_to(brace6, RIGHT)
+ self.wait(3)
+ self.play(ShowCreation(brace1), ShowCreation(brace2), ShowCreation(br1text), ShowCreation(br2text))
+ self.wait(3)
+ self.play(ReplacementTransform(text0, text1))
+ self.play(ShowCreation(line3), ShowCreation(line4), ShowCreation(line5), ShowCreation(brace5), ShowCreation(brace6), ShowCreation(br5text), ShowCreation(br6text))
+ vec3 = Line(self.graph_origin, self.graph_origin+0.1*RIGHT*XTD)
+ vec4 = Line(self.graph_origin, self.graph_origin+0.11*LEFT*XTD)
+ brace3 = Brace(vec3, DOWN)
+ brace4 = Brace(vec4, DOWN)
+ vec7 = Line(self.graph_origin+1.6*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ vec8 = Line(self.graph_origin+1.4*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ brace7 = Brace(vec7, RIGHT)
+ brace8 = Brace(vec8, RIGHT)
+ self.play(Transform(brace1, brace3), Transform(brace2, brace4), ApplyMethod(line2.shift, 0.8*LEFT*XTD),
+ ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3),
+ Transform(brace5, brace7), Transform(brace6, brace8), ApplyMethod(line4.shift, 1.8*UP*XTD),
+ ApplyMethod(line5.shift, 1.8*DOWN*XTD))
+ self.wait(3)
+ self.play(ReplacementTransform(text1, text2))
+ self.play(FadeOut(brace5), FadeOut(brace6), FadeOut(brace1), FadeOut(brace2))
+ self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3),
+ ApplyMethod(line5.shift, 1.8*UP*XTD), ApplyMethod(line4.shift, 1.8*DOWN*XTD))
+ for i in range(0,3):
+ self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3),
+ ApplyMethod(line5.shift, 1.8*DOWN*XTD), ApplyMethod(line4.shift, 1.8*UP*XTD), ApplyMethod(br5text.scale, 0.3), ApplyMethod(br6text.scale, 0.3), run_time = 0.5)
+ self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3),
+ ApplyMethod(line5.shift, 1.8*UP*XTD), ApplyMethod(line4.shift, 1.8*DOWN*XTD), ApplyMethod(br5text.scale, 10/3), ApplyMethod(br6text.scale ,10/3), run_time = 0.5)
+ self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3),
+ ApplyMethod(line5.shift, 1.8*DOWN*XTD), ApplyMethod(line4.shift, 1.8*UP*XTD),ApplyMethod(br5text.scale, 0.3), ApplyMethod(br6text.scale, 0.3), run_time = 0.5)
+
+ self.wait(5) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py b/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py
new file mode 100644
index 0000000..36ca388
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py
@@ -0,0 +1,70 @@
+from manimlib.imports import *
+class limitfin2(GraphScene):
+ CONFIG = {
+ "x_min" : -8,
+ "x_max" : 8,
+ "x_labeled_nums" : list(range(-8, 10, 3)),
+ "x_axis_width" : FRAME_WIDTH - LARGE_BUFF,
+ "y_min" : -4,
+ "y_max" : 4,
+ "y_labeled_nums" : None,#list(range(3,,)),
+ "y_axis_height" : FRAME_HEIGHT+2*LARGE_BUFF,
+ "graph_origin" : DOWN,
+ "graph_color" : BLUE,
+ "x_axis_width":20,
+ "y_axis_height":10,
+ }
+ def construct(self):
+ self.setup_axes()
+ XTD = 10/(8 - (-8))
+ YTD = 10/(4 - (-4))
+ graph1 = self.get_graph(lambda x: -(-(0.25*x**2)-1), x_min = self.x_min, x_max = -0.1)
+ graph2 = self.get_graph(lambda x: ((0.25*x**2)+2), x_min = 0.1, x_max = self.x_max, color = self.graph_color)
+ dot1 = Circle(radius = 0.1).move_to(self.graph_origin+1*UP*YTD)
+ dot2 = Circle(radius = 0.1).move_to(self.graph_origin+2*UP*YTD)
+ text1 = TexMobject(r"\text{It doesn't matter how small }", r"\delta",r"\text{ gets, }" r"\epsilon" r"\text{ does not tend to zero}").move_to(self.graph_origin+2*DOWN)
+ self.play(ShowCreation(graph1), ShowCreation(graph2), ShowCreation(text1), FadeIn(dot1), FadeIn(dot2))
+ line1 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*LEFT*XTD, self.graph_origin+4*UP*YTD+1*LEFT*XTD), num_dashes = 50).set_color(PINK)
+ line2 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*RIGHT*XTD, self.graph_origin+4*UP*YTD+1*RIGHT*XTD), num_dashes = 50).set_color(PINK)
+ line3 = DashedVMobject(Line(self.graph_origin+1.5*UP*YTD+5*LEFT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ line4 = DashedVMobject(Line(self.graph_origin+0.5*UP*YTD+5*LEFT*XTD, self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ line5 = DashedVMobject(Line(self.graph_origin+2.5*UP*YTD+5*LEFT*XTD, self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD)
+ self.play(ShowCreation(line1), ShowCreation(line2))
+ vec1 = Line(self.graph_origin, self.graph_origin+1*RIGHT*XTD)
+ vec2 = Line(self.graph_origin, self.graph_origin+1*LEFT*XTD)
+ vec5 = Line(self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ vec6 = Line(self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ brace1 = Brace(vec1, DOWN)
+ brace2 = Brace(vec2, DOWN)
+ br1text = brace1.get_text(r"$\delta$").next_to(brace1, DOWN)
+ br2text = brace2.get_text(r"$\delta$").next_to(brace2, DOWN)
+ brace5 = Brace(vec5, RIGHT)
+ brace6 = Brace(vec6, RIGHT)
+ br5text = brace5.get_text(r"$\epsilon$").next_to(brace5, RIGHT)
+ br6text = brace6.get_text(r"$\epsilon$").next_to(brace6, RIGHT)
+ self.wait(3)
+ self.play(ShowCreation(brace1), ShowCreation(brace2), ShowCreation(br1text), ShowCreation(br2text))
+ self.wait(3)
+ self.play(ShowCreation(line3), ShowCreation(line4), ShowCreation(line5), ShowCreation(brace5), ShowCreation(brace6), ShowCreation(br5text), ShowCreation(br6text))
+ vec3 = Line(self.graph_origin, self.graph_origin+0.1*RIGHT*XTD)
+ vec4 = Line(self.graph_origin, self.graph_origin+0.11*LEFT*XTD)
+ brace3 = Brace(vec3, DOWN)
+ brace4 = Brace(vec4, DOWN)
+ vec7 = Line(self.graph_origin+2.1*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ vec8 = Line(self.graph_origin+0.9*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD)
+ brace7 = Brace(vec7, RIGHT)
+ brace8 = Brace(vec8, RIGHT)
+ self.play(Transform(brace1, brace3), Transform(brace2, brace4), ApplyMethod(line2.shift, 0.8*LEFT*XTD),
+ ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3),
+ Transform(brace5, brace7), Transform(brace6, brace8), ApplyMethod(line4.shift, 0.8*UP*XTD),
+ ApplyMethod(line5.shift, 0.8*DOWN*XTD))
+
+ self.play(FadeOut(brace3), FadeOut(brace4), FadeOut(brace1), FadeOut(brace2))
+ self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3))
+ for i in range(0,3):
+ self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), run_time = 0.5)
+ self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3), run_time = 0.5)
+
+ self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), run_time = 0.5)
+
+ self.wait(5) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md
new file mode 100644
index 0000000..de6df0f
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md
@@ -0,0 +1,18 @@
+rierect1.gif
+![rierect1](https://user-images.githubusercontent.com/61246381/87141790-3ad90800-c2c1-11ea-86e4-af05cb93fa2d.gif)
+
+
+rierect2.gif
+![rierect2](https://user-images.githubusercontent.com/61246381/87141870-5ba15d80-c2c1-11ea-9307-40acc2884d77.gif)
+
+
+rierect3.gif
+![rierect3](https://user-images.githubusercontent.com/61246381/87141949-6e1b9700-c2c1-11ea-9433-4f6be752aa55.gif)
+
+
+RiemannRectanglesAnimation.gif
+![RiemannRectanglesAnimation](https://user-images.githubusercontent.com/61246381/87952202-2c5fcd00-cac7-11ea-8b14-a0c522886714.gif)
+
+
+mimi.gif
+![mimi](https://user-images.githubusercontent.com/61246381/87142127-b3d85f80-c2c1-11ea-864e-627e41d87ea2.gif)
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py
new file mode 100644
index 0000000..1757231
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py
@@ -0,0 +1,66 @@
+from manimlib.imports import *
+class RiemannRectanglesAnimation(GraphScene):
+ CONFIG = {
+ "y_max": 5,
+ "x_max": 6,
+ "x_min": 0,
+ "y_min": 0,
+ "x_axis_width": 5,
+ "y_axis_height": 5,
+ "init_dx":0.5,
+ "graph_origin": ORIGIN+2*DOWN+6*LEFT,
+ }
+ def construct(self):
+ self.setup_axes()
+ def func(x):
+ return 0.1*(x)*(x-3)*(x-7)+3
+
+ graph1=self.get_graph(func,x_min=0,x_max=6)
+ kwargs = {
+ "x_min" : 1.5,
+ "x_max" : 5.5,
+ "fill_opacity" : 0.75,
+ "stroke_width" : 0.25,
+ "input_sample_type": "right",
+ }
+ flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs)
+ riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs)
+ self.add(graph1)
+ self.graph_origin = ORIGIN+2*DOWN+1*RIGHT
+ self.setup_axes()
+ graph2=self.get_graph(func,x_min=0,x_max=6)
+ kwargs = {
+ "x_min" : 1.5,
+ "x_max" : 5.5,
+ "fill_opacity" : 0.75,
+ "stroke_width" : 0.25,
+ "input_sample_type": "left",
+ }
+ flat_rectangles2 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs)
+ riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph2,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs)
+ self.add(graph2)
+ text1 = TextMobject("Left Riemann sum").move_to(np.array([-3,-2.5,0]))
+ text2 = TextMobject("Right Riemann sum").move_to(np.array([4,-2.5,0]))
+ grp1 = VGroup(text1, text2)
+ text3 = TexMobject(r"n \rightarrow \infty").move_to(np.array([0, -3, 0]))
+ text4 = TextMobject("Left and Right Riemann sums are equal").move_to(np.array([0, -3, 0]))
+ text5 = TextMobject("Hence function is Riemann integrable and value of integral equals area covered").move_to(np.array([0, -3, 0])).scale(0.6)
+ grp2 = VGroup(text1, text2, text3)
+ # Show Riemann rectangles
+ self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[0]), ReplacementTransform(flat_rectangles2, riemann_rectangles_list2[0]))
+ self.wait()
+ self.play(ShowCreation(grp1))
+ for r in range(1,len(riemann_rectangles_list1)-3):
+ self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,)
+ self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,)
+ self.play(ShowCreation(text3))
+ for r in range(len(riemann_rectangles_list1)-3,len(riemann_rectangles_list1)):
+ self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,)
+ self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,)
+ self.wait(2)
+ grp3 = VGroup(graph1, riemann_rectangles_list1[5])
+ grp4 = VGroup(graph2, riemann_rectangles_list2[5])
+ self.play(ReplacementTransform(grp2, text4))
+ self.wait(2)
+ self.play(ReplacementTransform(text4, text5), ApplyMethod(grp4.shift, 7*LEFT), ApplyMethod(self.axes.shift, 7*LEFT), )
+ self.wait(4) \ No newline at end of file
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py
new file mode 100644
index 0000000..2471c87
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py
@@ -0,0 +1,53 @@
+class mimi(GraphScene):
+ CONFIG = {
+ "y_max": 5,
+ "x_max": 6,
+ "x_min": 0,
+ "y_min": 0,
+ "x_axis_width": 5,
+ "y_axis_height": 5,
+ "init_dx":0.5,
+ "graph_origin": ORIGIN+2*DOWN+6*LEFT,
+ }
+ def construct(self):
+ self.setup_axes()
+ def func(x):
+ return 0.1*(x)*(x-3)*(x-7)+3
+
+ graph=self.get_graph(func,x_min=0,x_max=6)
+ kwargs = {
+ "x_min" : 1.5,
+ "x_max" : 5.5,
+ "fill_opacity" : 0.5,
+ "stroke_width" : 0.25,
+ }
+ flat_rectangles = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,**kwargs)
+ riemann_rectangles_list = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right")
+ riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left")
+ self.add(graph)
+ self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0]))
+ #self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0]))
+ self.wait(2)
+ kwargs = {
+ "x_min" : 3,
+ "x_max" : 3.5,
+ "fill_opacity" : 0.5,
+ "stroke_width" : 0.25,
+ }
+ riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right")
+ riemann_rectangles_list3 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left")
+ #self.play(FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0]))
+ self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list2[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list3[0]), FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0]))
+ minlim = self.get_vertical_line_to_graph(3,graph,DashedLine)
+ maxlim = self.get_vertical_line_to_graph(3.5,graph,DashedLine)
+ line2 = Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.9*RIGHT)
+ brace1 = Brace(minlim, LEFT)
+ brace2 = Brace(line2, DOWN)
+ brace3 = Brace(maxlim, RIGHT)
+ br1text = brace1.get_text(r"${M}_{i}$").next_to(brace1, LEFT)
+ br2text = brace2.get_text(r"$\Delta x$").next_to(brace2, DOWN)
+ br3text = brace3.get_text(r"${m}_{i}$").next_to(brace3, RIGHT)
+ text1 = TexMobject(r"\Delta x=(b-a)/n").shift(2*RIGHT)
+ grp3 = VGroup(br1text, br2text, br3text, brace1, brace2, brace3, text1)
+ self.play(ShowCreation(grp3))
+ self.wait(5)
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py
new file mode 100644
index 0000000..748d766
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py
@@ -0,0 +1,31 @@
+from manimlib.imports import *
+class rierect1(GraphScene):
+ CONFIG = {
+ "y_max" : 6,
+ "y_min" : 0,
+ "x_max" : 4,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+2*DOWN+4*LEFT,
+ "x_labeled_nums": None,#list(range(-1,2)),
+ "y_labeled_nums": None,#list(range(0,2)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ self.setup_axes()
+ graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4)
+ minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK)
+ maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK)
+ x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN)
+ x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN)
+ rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.4, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW)
+ #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK)
+ group = VGroup(graph1, minlim, maxlim, x1, x2, rie1)
+ self.play(ShowCreation(group))
+ self.wait(1.5)
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py
new file mode 100644
index 0000000..e300250
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py
@@ -0,0 +1,31 @@
+from manimlib.imports import *
+class rierect2(GraphScene):
+ CONFIG = {
+ "y_max" : 6,
+ "y_min" : 0,
+ "x_max" : 4,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+2*DOWN+4*LEFT,
+ "x_labeled_nums": None,#list(range(-1,2)),
+ "y_labeled_nums": None,#list(range(0,2)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ self.setup_axes()
+ graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4)
+ minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK)
+ maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK)
+ x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN)
+ x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN)
+ rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.1, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW)
+ #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK)
+ group = VGroup(graph1, minlim, maxlim, x1, x2, rie1)
+ self.play(ShowCreation(group))
+ self.wait(1.5)
diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py
new file mode 100644
index 0000000..3542358
--- /dev/null
+++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py
@@ -0,0 +1,31 @@
+from manimlib.imports import *
+class rierect3(GraphScene):
+ CONFIG = {
+ "y_max" : 6,
+ "y_min" : 0,
+ "x_max" : 4,
+ "x_min" : 0,
+ "y_tick_frequency" : 1,
+ "x_tick_frequency" : 1,
+ "axes_color" : WHITE,
+ "num_graph_anchor_points": 3000, #this is the number of points that graph manim
+ "graph_origin" : ORIGIN+2*DOWN+4*LEFT,
+ "x_labeled_nums": None,#list(range(-1,2)),
+ "y_labeled_nums": None,#list(range(0,2)),
+ "x_axis_label":"$x$",
+ "y_axis_label":"$f(x)$",
+ "x_axis_width": 10,
+ "y_axis_height": 5,
+ }
+ def construct(self):
+ self.setup_axes()
+ graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4)
+ minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK)
+ maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK)
+ x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN)
+ x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN)
+ rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW)
+ #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK)
+ group = VGroup(graph1, minlim, maxlim, x1, x2, rie1)
+ self.play(ShowCreation(group))
+ self.wait(1.5)
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md b/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md
new file mode 100644
index 0000000..2fa4e04
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md
@@ -0,0 +1,20 @@
+### Dividing a tone into its constituents
+![GIF1](gifs/file1.gif)
+
+### Colors Analogy
+![GIF2](gifs/file2a.gif)
+
+### Applying the same on Graphs
+![GIF3](gifs/file2b.gif)
+
+### Fourier series for non-periodic functions-a
+![GIF4](gifs/file3.gif)
+
+### Fourier series for non-periodic functions-b
+![GIF4a](gifs/file7.gif)
+
+### Fourier Series of Square pulse
+![GIF5](gifs/file4.gif)
+
+### Coins Analogy
+![GIF6](gifs/file5.gif)
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file1.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file1.gif
new file mode 100644
index 0000000..d4dc9d7
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file1.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2a.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2a.gif
new file mode 100644
index 0000000..8f83bc4
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2a.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2b.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2b.gif
new file mode 100644
index 0000000..d68c405
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file2b.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gif
new file mode 100644
index 0000000..de94810
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file4.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file4.gif
new file mode 100644
index 0000000..36cd61b
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file4.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file5.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file5.gif
new file mode 100644
index 0000000..9757bd6
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file5.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file6.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file6.gif
new file mode 100644
index 0000000..de94810
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file6.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file7.gif b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file7.gif
new file mode 100644
index 0000000..ab4eed8
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file7.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py
new file mode 100644
index 0000000..fdb8719
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py
@@ -0,0 +1,83 @@
+from manimlib.imports import*
+import numpy as np
+
+class intro(GraphScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 3,
+ "x_axis_width": 6,
+ "y_min": -5,
+ "y_max": 5,
+ "graph_origin": 10.5*LEFT,
+ "axes_color": BLUE,
+ "exclude_zero_label": True,
+ "x_labeled_nums": range(-2, 3, 1),
+ }
+ def func(self,t,n1,n2):
+ s=0
+ for i in range(n1,n2+1):
+ s+=((-2/(i*np.pi))*((-1)**i)*np.sin(2*np.pi*i*t))
+ return s
+
+ def construct(self):
+ image=ImageMobject('image.png').shift(5.5*LEFT+2.5*UP).scale(1.5)
+ self.play(ShowCreation(image))
+
+ self.setup_axes(scalee=1)
+
+ mainGraphs=[
+ self.get_graph(lambda x:self.func(x,2,7),x_max=2,x_min=-2).shift(9.3*RIGHT+3*UP).set_color([ORANGE,GREEN_B,RED_E,YELLOW_E,RED_D,YELLOW_D]).scale(1.4),
+ self.get_graph(lambda x:self.func(x,3,7),x_max=2,x_min=-2).shift(10.8*RIGHT+3*UP).set_color([GREEN_B,ORANGE,RED_D,YELLOW_E,YELLOW_D]).scale(1.4),
+ self.get_graph(lambda x:self.func(x,4,7),x_max=2,x_min=-2).shift(10.8*RIGHT+3*UP).set_color([GREEN_B,YELLOW_E,ORANGE,YELLOW_D]).scale(1.4),
+ self.get_graph(lambda x:self.func(x,5,7),x_max=2,x_min=-2).shift(10.8*RIGHT+3*UP).set_color([YELLOW_E,GREEN_B,YELLOW_D]).scale(1.4),
+ self.get_graph(lambda x:self.func(x,6,7),x_max=2,x_min=-2).shift(10.8*RIGHT+3*UP).set_color([YELLOW_D,GREEN_B]).scale(1.4),
+ self.get_graph(lambda x:self.func(x,7,7),x_max=2,x_min=-2,color=GREEN_B).shift(10.8*RIGHT+3*UP).scale(1.4),
+ ]
+ self.play(ApplyMethod(mainGraphs[0].shift,1.5*RIGHT))
+
+ graph1=self.get_graph(lambda x:self.func(x,2,2),x_max=2,x_min=-2,color=RED_E).shift(10.8*RIGHT+3*UP).scale(1.5)
+ graph2=self.get_graph(lambda x:self.func(x,3,3),x_max=2,x_min=-2,color=RED_D).shift(10.8*RIGHT+3*UP).scale(1.5)
+ graph3=self.get_graph(lambda x:self.func(x,4,4),x_max=2,x_min=-2,color=ORANGE).shift(10.8*RIGHT+3*UP).scale(1.5)
+ graph4=self.get_graph(lambda x:self.func(x,5,5),x_max=2,x_min=-2,color=YELLOW_E).shift(10.8*RIGHT+3*UP).scale(1.5)
+ graph5=self.get_graph(lambda x:self.func(x,6,6),x_max=2,x_min=-2,color=YELLOW_D).shift(10.8*RIGHT+3*UP).scale(1.5)
+
+ coeff=[
+ TextMobject("$\\frac { -1 }{ \pi } sin(4\pi t)$").scale(0.5).shift(DOWN+4.6*RIGHT+3*UP).set_color(RED_E),
+ TextMobject("$\\frac { 2 }{ 3\pi } sin(6\pi t)$").scale(0.5).shift(2*DOWN+4.6*RIGHT+3*UP).set_color(RED_D),
+ TextMobject("$\\frac { -1 }{ 2\pi } sin(8\pi t)$").scale(0.5).shift(3*DOWN+4.6*RIGHT+3*UP).set_color(ORANGE),
+ TextMobject("$\\frac { 2 }{ 5\pi } sin(10\pi t)$").scale(0.5).shift(4*DOWN+4.6*RIGHT+3*UP).set_color(YELLOW_E),
+ TextMobject("$\\frac { -1 }{ 3\pi } sin(12\pi t)$").scale(0.5).shift(5*DOWN+4.6*RIGHT+3*UP).set_color(YELLOW_D),
+ TextMobject("$\\frac { 2 }{ 7\pi } sin(14\pi t)$").scale(0.5).shift(6*DOWN+4.6*RIGHT+3*UP).set_color(GREEN_B)
+ ]
+
+ self.wait(0.6)
+ self.play(ApplyMethod(graph1.shift,1*DOWN),ReplacementTransform(mainGraphs[0],mainGraphs[1]))
+ self.play(Write(coeff[0]))
+ self.play(ApplyMethod(graph2.shift,2*DOWN),ReplacementTransform(mainGraphs[1],mainGraphs[2]))
+ self.play(Write(coeff[1]))
+ self.play(ApplyMethod(graph3.shift,3*DOWN),ReplacementTransform(mainGraphs[2],mainGraphs[3]))
+ self.play(Write(coeff[2]))
+ self.play(ApplyMethod(graph4.shift,4*DOWN),ReplacementTransform(mainGraphs[3],mainGraphs[4]))
+ self.play(Write(coeff[3]))
+ self.play(ApplyMethod(graph5.shift,5*DOWN),ReplacementTransform(mainGraphs[4],mainGraphs[5]))
+ self.play(Write(coeff[4]))
+ self.play(ApplyMethod(mainGraphs[5].shift,6*DOWN))
+ self.play(Write(coeff[5]))
+
+ pluses=[TextMobject("+"),TextMobject("+"),TextMobject("+"),TextMobject("+"),TextMobject("+")]
+ for t in pluses:
+ t.scale(0.5).shift((2.2-1.5*pluses.index(t))*LEFT)
+
+ finalGraph=self.get_graph(lambda x:self.func(x,2,7),x_max=2,x_min=-2).shift(10.8*RIGHT+3*UP)
+ finalGraph.set_color([GREEN_B,YELLOW_D,YELLOW_E,ORANGE,RED_D,RED_E])
+ finalGroup=VGroup(graph1,graph2,graph3,graph4,graph5,mainGraphs[5])
+ self.play(ReplacementTransform(finalGroup,finalGraph))
+ self.play(ApplyMethod(coeff[0].scale,0.7),ApplyMethod(coeff[1].scale,0.7),ApplyMethod(coeff[2].scale,0.7),ApplyMethod(coeff[3].scale,0.7),ApplyMethod(coeff[4].scale,0.7),ApplyMethod(coeff[5].scale,0.7))
+ #self.play(ApplyMethod(coeff[0].shift,7*LEFT+1.6*DOWN),ApplyMethod(coeff[1].shift,5.5*LEFT+0.8*DOWN),ApplyMethod(coeff[2].shift,4*LEFT),ApplyMethod(coeff[3].shift,2.5*LEFT+0.8*UP),ApplyMethod(coeff[4].shift,LEFT+1.6*UP),ApplyMethod(coeff[5].shift,0.5*RIGHT+2.4*DOWN))
+ self.play(ApplyMethod(coeff[0].shift,7.6*LEFT+2*DOWN),ApplyMethod(coeff[1].shift,6.1*LEFT+DOWN),ApplyMethod(coeff[2].shift,4.6*LEFT),ApplyMethod(coeff[3].shift,3.1*LEFT+UP),ApplyMethod(coeff[4].shift,1.6*LEFT+2*UP),ApplyMethod(coeff[5].shift,0.1*LEFT+3*UP))
+ equal=TextMobject("=").scale(1.5).shift(1.5*UP)
+ self.play(Write(equal))
+ self.play(Write(pluses[0]),Write(pluses[1]),Write(pluses[2]),Write(pluses[3]),Write(pluses[4]))
+ group=VGroup(pluses[0],pluses[1],pluses[2],pluses[3],pluses[4],coeff[0],coeff[1],coeff[2],coeff[3],coeff[4],coeff[5])
+ self.play(ApplyMethod(group.scale,1.5))
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py
new file mode 100644
index 0000000..c87e58e
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py
@@ -0,0 +1,146 @@
+from manimlib.imports import*
+import numpy as np
+
+def func(t,n1,n2):
+ s=0
+ for i in range(n1,n2+1):
+ s+=((-2/(i*np.pi))*((-1)**i)*np.sin(2*np.pi*i*t))
+ return s
+
+class divideColors(GraphScene):
+ CONFIG = {
+ "x_min": -2,
+ "x_max": 2,
+ "y_min": -1,
+ "y_max": 1,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$y$",
+ "x_labeled_nums": range(-1, 2, 1),
+ "x_axis_width": 3,
+ "y_axis_height": 2
+ }
+ def construct(self):
+ text1a=TextMobject("Consider dividing a","mixture of colors")
+ text1b=TextMobject("into its","components")
+ text1a.scale(0.8)
+ text1b.scale(0.8)
+ text1a.shift(UP)
+ text1b.shift(0.3*UP)
+ text1a.set_color_by_tex_to_color_map({"mixture of colors":[GREEN,RED,BLUE,YELLOW]})
+ text1b.set_color_by_tex_to_color_map({"components":GREEN})
+ self.play(Write(text1a))
+ self.play(FadeIn(text1b))
+ self.wait(0.8)
+
+ self.play(FadeOut(text1a),FadeOut(text1b))
+
+ mainCircle=Circle(radius=1.4,color=BLACK,fill_color=[PURPLE_E,PURPLE_D,RED_B,ORANGE,YELLOW_B,YELLOW_D,GREEN_A,GREEN_C],fill_opacity=0.8)
+ self.play(ShowCreation(mainCircle))
+ self.wait(1)
+ mainCirclea=Circle(radius=1.4,color=BLACK,fill_color=[RED_B,ORANGE,YELLOW_B,YELLOW_D,GREEN_A,GREEN_C],fill_opacity=0.8)
+ mainCircleb=Circle(radius=1.4,color=BLACK,fill_color=[YELLOW_B,YELLOW_D,GREEN_A,GREEN_C],fill_opacity=0.8)
+ mainCirclec=Circle(radius=1.4,color=BLACK,fill_color=[GREEN_A,GREEN_C],fill_opacity=0.8)
+ mainCircled=Circle(radius=1.4,color=BLACK,fill_color=[],fill_opacity=0.8)
+
+ c1=Circle(radius=0.5,color=PURPLE_E,fill_color=PURPLE_E,fill_opacity=0.8)
+ c2=Circle(radius=0.5,color=PURPLE_D,fill_color=PURPLE_D,fill_opacity=0.8)
+ c3=Circle(radius=0.5,color=RED_D,fill_color=RED_B,fill_opacity=0.8)
+ c4=Circle(radius=0.5,color=ORANGE,fill_color=ORANGE,fill_opacity=0.8)
+ c5=Circle(radius=0.5,color=YELLOW_B,fill_color=YELLOW_B,fill_opacity=0.8)
+ c6=Circle(radius=0.5,color=YELLOW_D,fill_color=YELLOW_D,fill_opacity=0.8)
+ c7=Circle(radius=0.5,color=GREEN_A,fill_color=GREEN_A,fill_opacity=0.8)
+ c8=Circle(radius=0.5,color=GREEN_C,fill_color=GREEN_C,fill_opacity=0.8)
+
+ self.play(ApplyMethod(c1.shift,3*UP+LEFT),ApplyMethod(c2.shift,3*UP+RIGHT),ReplacementTransform(mainCircle,mainCirclea))
+ self.wait(0.8)
+
+ self.play(ApplyMethod(c3.shift,UP+3*LEFT),ApplyMethod(c4.shift,DOWN+3*LEFT),ReplacementTransform(mainCirclea,mainCircleb))
+ self.wait(0.8)
+
+ self.play(ApplyMethod(c5.shift,3*DOWN+LEFT),ApplyMethod(c6.shift,3*DOWN+RIGHT),ReplacementTransform(mainCircleb,mainCirclec))
+ self.wait(0.8)
+
+ self.play(ApplyMethod(c7.shift,3*RIGHT+UP),ApplyMethod(c8.shift,3*RIGHT+DOWN),ReplacementTransform(mainCirclec,mainCircled))
+ self.wait(1)
+
+ text2=TextMobject("Similarly,").scale(0.8).shift(UP).set_color(RED)
+
+ self.play(FadeOut(c1),FadeOut(c2),FadeOut(c3),FadeOut(c4),FadeOut(c5),FadeOut(c6),FadeOut(c7),FadeOut(c8))
+ self.play(Write(text2))
+ self.wait(0.8)
+ self.play(FadeOut(text2))
+
+
+ coeff=[
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=1 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { 2 }{ \pi } sin(2\pi t)$").scale(0.3).shift(RIGHT+UP+4*LEFT+UP),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=2 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { -1 }{ \pi } sin(4\pi t)$").scale(0.3).shift(RIGHT+UP+4*RIGHT+UP),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=3 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { 2 }{ 3\pi } sin(6\pi t)$").scale(0.3).shift(RIGHT+UP+4*LEFT+2*DOWN),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=4 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { -1 }{ 2\pi } sin(8\pi t)$").scale(0.3).shift(RIGHT+UP+4*RIGHT+2*DOWN),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=5 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { 2 }{ 5\pi } sin(10\pi t)$").scale(0.3).shift(RIGHT+UP+2.5*UP),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=6 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ TextMobject("$\\frac { -1 }{ 3\pi } sin(12\pi t)$").scale(0.3).shift(RIGHT+UP+2.5*DOWN),
+ TextMobject("$\\frac { -2 }{ \pi } \sum _{ n=7 }^{ 24 }{ \\frac { { -1 }^{ n } }{ n } sin(2\pi nt) }$").scale(0.2).shift(RIGHT+UP),
+ ]
+
+ axes=[]
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graphs=[self.get_graph(lambda x:func(x,1,24),x_min=-1,x_max=1).set_color([DARK_BROWN,GREEN_E,GREEN_C,GOLD_E,GOLD_C,ORANGE,RED_C]),
+ self.get_graph(lambda x:func(x,2,24),x_min=-1,x_max=1).set_color([DARK_BROWN,GREEN_C,GOLD_E,GOLD_C,ORANGE,RED_C]),
+ self.get_graph(lambda x:func(x,3,24),x_min=-1,x_max=1).set_color([DARK_BROWN,GOLD_E,GOLD_C,ORANGE,RED_C]),
+ self.get_graph(lambda x:func(x,4,24),x_min=-1,x_max=1).set_color([DARK_BROWN,GOLD_C,ORANGE,RED_C]),
+ self.get_graph(lambda x:func(x,5,24),x_min=-1,x_max=1).set_color([DARK_BROWN,ORANGE,RED_C]),
+ self.get_graph(lambda x:func(x,6,24),x_min=-1,x_max=1).set_color([DARK_BROWN,RED_C]),
+ self.get_graph(lambda x:func(x,7,24),x_min=-1,x_max=1).set_color(DARK_BROWN)
+ ]
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph1=self.get_graph(lambda x:func(x,1,1),x_min=-1,x_max=1,color=GREEN_E)
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph2=self.get_graph(lambda x:func(x,2,2),x_min=-1,x_max=1,color=GREEN_C)
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph3=self.get_graph(lambda x:func(x,3,3),x_min=-1,x_max=1,color=GOLD_E)
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph4=self.get_graph(lambda x:func(x,4,4),x_min=-1,x_max=1,color=GOLD_C)
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph5=self.get_graph(lambda x:func(x,5,5),x_min=-1,x_max=1,color=ORANGE)
+
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ graph6=self.get_graph(lambda x:func(x,6,6),x_min=-1,x_max=1,color=RED_C)
+
+ groups=[VGroup(axes[1],graph1),VGroup(axes[2],graph2),VGroup(axes[3],graph3),VGroup(axes[4],graph4),
+ VGroup(axes[5],graph5),VGroup(axes[6],graph6)]
+
+ self.play(ShowCreation(graphs[0]))
+ self.play(Write(coeff[0]))
+ self.wait(1)
+
+ self.play(ReplacementTransform(graphs[0],graphs[1]),ApplyMethod(groups[0].shift,4*LEFT+UP),ReplacementTransform(coeff[0],coeff[2]),FadeIn(coeff[1]))
+ self.play(ReplacementTransform(graphs[1],graphs[2]),ApplyMethod(groups[1].shift,4*RIGHT+UP),ReplacementTransform(coeff[2],coeff[4]),FadeIn(coeff[3]))
+ self.play(ReplacementTransform(graphs[2],graphs[3]),ApplyMethod(groups[2].shift,4*LEFT+2*DOWN),ReplacementTransform(coeff[4],coeff[6]),FadeIn(coeff[5]))
+ self.play(ReplacementTransform(graphs[3],graphs[4]),ApplyMethod(groups[3].shift,4*RIGHT+2*DOWN),ReplacementTransform(coeff[6],coeff[8]),FadeIn(coeff[7]))
+ self.play(ReplacementTransform(graphs[4],graphs[5]),ApplyMethod(groups[4].shift,2.5*UP),ReplacementTransform(coeff[8],coeff[10]),FadeIn(coeff[9]))
+ self.play(ReplacementTransform(graphs[5],graphs[6]),ApplyMethod(groups[5].shift,2.5*DOWN),ReplacementTransform(coeff[10],coeff[12]),FadeIn(coeff[11]))
+
+
+
+ self.wait(2)
+
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py
new file mode 100644
index 0000000..d35f8bf
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py
@@ -0,0 +1,129 @@
+from manimlib.imports import *
+import numpy as np
+
+class compare(GraphScene,MovingCameraScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 3,
+ "x_axis_width": 6,
+ "y_min": -5,
+ "y_max": 5,
+ "y_axis_label":"$\\frac { { x }^{ 2 } }{ 2 } $",
+ "graph_origin": ORIGIN,
+ "axes_color": BLUE,
+ "exclude_zero_label": True,
+ "x_labeled_nums": range(-2, 3, 1),
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+ def returnPairLines(self,left,right,y_each_unit):
+ lineLeft=DashedLine(start=(0,5*y_each_unit,0),end=(0,-5*y_each_unit,0)).shift(left)
+ lineRight=DashedLine(start=(0,5*y_each_unit,0),end=(0,-5*y_each_unit,0)).shift(right)
+ return lineLeft,lineRight
+
+ def resultFunc(self,x,n,l):
+ s=(l**2)/6
+ for n in range(1,n+1):
+ s+=(2*((-1)**n))*((l**2)*np.cos(n*np.pi*x/l))*(1/((np.pi**2)*(n**2)))
+ return s
+
+ def returnPartFunction(self,left,right):
+ return self.get_graph(lambda x:(x**2)/2,x_min=left,x_max=right,color=RED)
+
+ def returnPartResult(self,l,n):
+ return self.get_graph(lambda x:self.resultFunc(x,n,l),x_min=-3,x_max=3,color=RED)
+
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ axes=[]
+ self.setup_axes(animate=True,scalee=1)
+ axes.append(self.axes)
+ partFunction1=self.returnPartFunction(-1,1).shift(4*LEFT)
+ partFunction2=self.returnPartFunction(-2,2).shift(4*LEFT)
+ functionText=TextMobject("$\\frac { { x }^{ 2 } }{ 2 } $")
+ function=self.get_graph(lambda x:(x**2)/2,x_min=-3,x_max=3,color=GREEN)
+ text1=TextMobject("Non-Periodic function").scale(0.5).shift(3*DOWN+3*RIGHT).set_color(RED)
+ self.play(ShowCreation(function))
+ self.play(FadeIn(text1))
+ self.wait(1)
+ self.play(FadeOut(text1))
+ self.play(ApplyMethod(axes[0].shift,4*LEFT),ApplyMethod(function.shift,4*LEFT))
+ text2=TextMobject("For a","given","interval of $x$,").scale(0.5).shift(2.5*RIGHT+UP).set_color_by_tex_to_color_map({"given":YELLOW,"interval of $x$,":BLUE})
+ text3=TextMobject("We can get the","Fourier Series","of that","particular part!").scale(0.4).shift(2.5*RIGHT+0.5*UP).set_color_by_tex_to_color_map({"particular part!":YELLOW,"Fourier Series":RED})
+ self.play(Write(text2))
+ left,right=self.returnPairLines((4+x_each_unit)*LEFT,(4-x_each_unit)*LEFT,y_each_unit)
+ self.play(ShowCreation(left),ShowCreation(right))
+ self.play(Write(text3))
+ self.wait(0.5)
+ self.play(FadeOut(text2),FadeOut(text3))
+ self.graph_origin=3.5*RIGHT
+ self.y_axis_label="$\\frac { { l }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ \infty }{ \\frac { 2{ (-1) }^{ n }{ l }^{ 2 }cos(\\frac { n\pi x }{ l } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$"
+ self.setup_axes(animate=True,scalee=1)
+ axes.append(self.axes)
+ coeffResult=[
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 1 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 3 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 5 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 7 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 9 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 11 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 1 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 13 }{ \\frac { 2{ (-1) }^{ n }{ 1 }^{ 2 }cos(\\frac { n\pi x }{ 1 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$").scale(0.3).shift(4.5*RIGHT+UP).set_color(YELLOW)
+ ]
+ result1a=self.returnPartResult(1,1)
+ result1b=self.returnPartResult(1,3)
+ result1c=self.returnPartResult(1,5)
+ result1d=self.returnPartResult(1,7)
+ result1e=self.returnPartResult(1,9)
+ result1f=self.returnPartResult(1,11)
+ result1g=self.returnPartResult(1,13)
+ self.play(ApplyMethod(partFunction1.shift,0.2*UP))
+ self.wait(0.5)
+
+ self.play(ReplacementTransform(partFunction1,result1a),Write(coeffResult[0]))
+ self.play(FadeOut(axes[0]),FadeOut(left),FadeOut(right),FadeOut(function))
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 5,self.camera_frame.move_to, 3.5*RIGHT)
+
+
+ self.play(ReplacementTransform(result1a,result1b),ReplacementTransform(coeffResult[0],coeffResult[1]))
+ self.play(ReplacementTransform(result1b,result1c),ReplacementTransform(coeffResult[1],coeffResult[2]))
+ self.play(ReplacementTransform(result1c,result1d),ReplacementTransform(coeffResult[2],coeffResult[3]))
+ self.play(ReplacementTransform(result1d,result1e),ReplacementTransform(coeffResult[3],coeffResult[4]))
+ self.play(ReplacementTransform(result1e,result1f),ReplacementTransform(coeffResult[4],coeffResult[5]))
+ self.play(ReplacementTransform(result1f,result1g),ReplacementTransform(coeffResult[5],coeffResult[6]))
+
+ self.wait(0.5)
+ self.play(self.camera_frame.set_width, 14,self.camera_frame.move_to, 0)
+
+ text4=TextMobject("Here the","obtained function","will always be","periodic","with period equal to the chosen interval").scale(0.4).shift(3.3*DOWN).set_color_by_tex_to_color_map({"obtained function":YELLOW,"periodic":RED})
+ self.play(Write(text4))
+
+ self.wait(0.8)
+
+ self.play(FadeOut(text4))
+ text5=TextMobject("As we","increase","the","interval of $x$,").scale(0.5).shift(3*DOWN).set_color_by_tex_to_color_map({"increase":RED,"interval of $x$,":YELLOW})
+ text6=TextMobject("We get","approximation","for","higher intervals!").scale(0.5).shift(3.5*DOWN).set_color_by_tex_to_color_map({"approximation":GREEN,"higher intervals!":YELLOW})
+ self.play(FadeIn(axes[0]),FadeIn(left),FadeIn(right),FadeIn(function))
+ self.play(Write(text5))
+ self.play(Write(text6))
+ result2=self.returnPartResult(1.5,20)
+ result3=self.returnPartResult(2,20)
+ result4=self.returnPartResult(2.5,20)
+ result5=self.returnPartResult(3,20)
+ finalCoeff=coeffResult[6]
+ coeffResult=[
+ TextMobject("$\\frac { { 1.5 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 20 }{ \\frac { 2{ (-1) }^{ n }{ 1.5 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$").scale(0.4).shift(5*RIGHT+1.5*UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 20 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.4).shift(5*RIGHT+1.5*UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 2.5 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 20 }{ \\frac { 2{ (-1) }^{ n }{ 2.5 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.4).shift(5*RIGHT+2.2*UP).set_color(YELLOW),
+ TextMobject("$\\frac { { 3 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 20 }{ \\frac { 2{ (-1) }^{ n }{ 3 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.4).shift(5*RIGHT+2.2*UP).set_color(YELLOW),
+ ]
+ self.play(ApplyMethod(left.shift,LEFT*x_each_unit*0.5),ApplyMethod(right.shift,RIGHT*x_each_unit*0.5),ReplacementTransform(result1g,result2),ReplacementTransform(finalCoeff,coeffResult[0]))
+ self.play(ApplyMethod(left.shift,LEFT*x_each_unit*0.5),ApplyMethod(right.shift,RIGHT*x_each_unit*0.5),ReplacementTransform(result2,result3),ReplacementTransform(coeffResult[0],coeffResult[1]))
+ self.play(ApplyMethod(left.shift,LEFT*x_each_unit*0.5),ApplyMethod(right.shift,RIGHT*x_each_unit*0.5),ReplacementTransform(result3,result4),ReplacementTransform(coeffResult[1],coeffResult[2]))
+ self.play(ApplyMethod(left.shift,LEFT*x_each_unit*0.5),ApplyMethod(right.shift,RIGHT*x_each_unit*0.5),ReplacementTransform(result4,result5),ReplacementTransform(coeffResult[2],coeffResult[3]))
+
+
+
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py
new file mode 100644
index 0000000..fdf4bb3
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py
@@ -0,0 +1,97 @@
+from manimlib.imports import *
+import numpy as np
+
+def returnSum(k,x):
+ summ=0
+ for i in range(1,k+1,2):
+ summ+=((np.sin(2*np.pi*i*x))/i)
+ return summ
+
+def returnFunc(self,k):
+ graph=self.get_graph(lambda x:(4/np.pi)*returnSum(k,x),color=WHITE,x_max=1,x_min=-1)
+ return graph
+
+class fourierSeries(GraphScene,MovingCameraScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 3,
+ "x_axis_width": 13,
+ "y_min": -3,
+ "y_max": 3,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$x$",
+ "y_axis_label": "$y$",
+ "exclude_zero_label": True,
+ "x_labeled_nums": range(-2, 3, 1),
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ equation=TextMobject("$f(x)=\\frac { 4 }{ \pi } \sum _{ k=1,3,5.. }^{ \infty }{ \\frac { 1 }{ k } \sin { 2\pi kx } }$").shift(5*RIGHT+3*UP).set_color(RED).scale(0.5)
+ self.add(equation)
+ self.setup_axes(animate=True,scalee=1)
+ line1=Line(start=(-x_each_unit,y_each_unit,0),end=(-(1/2)*x_each_unit,y_each_unit,0),color=RED)
+ line2=Line(start=(-(1/2)*x_each_unit,y_each_unit,0),end=(-(1/2)*x_each_unit,-y_each_unit,0),color=RED)
+ line3=Line(start=(-(1/2)*x_each_unit,-y_each_unit,0),end=(0,-y_each_unit,0),color=RED)
+ line4=Line(start=(0,-y_each_unit,0),end=(0,y_each_unit,0),color=RED)
+ line5=Line(start=(0,y_each_unit,0),end=((1/2)*x_each_unit,y_each_unit,0),color=RED)
+ line6=Line(start=((1/2)*x_each_unit,y_each_unit,0),end=((1/2)*x_each_unit,-y_each_unit,0),color=RED)
+ line7=Line(start=((1/2)*x_each_unit,-y_each_unit,0),end=(x_each_unit,-y_each_unit,0),color=RED)
+ self.play(ShowCreation(line1))
+ self.play(ShowCreation(line2))
+ self.play(ShowCreation(line3))
+ self.play(ShowCreation(line4))
+ self.play(ShowCreation(line5))
+ self.play(ShowCreation(line6))
+ self.play(ShowCreation(line7))
+ self.wait(0.5)
+
+ labels=[
+ TextMobject("$f_{ k=1 }(x)$"),
+ TextMobject("$f_{ k=3 }(x)$"),
+ TextMobject("$f_{ k=5 }(x)$"),
+ TextMobject("$f_{ k=7 }(x)$"),
+ TextMobject("$f_{ k=9 }(x)$"),
+ TextMobject("$f_{ k=11 }(x)$"),
+ TextMobject("$f_{ k=13 }(x)$"),
+ TextMobject("$f_{ k=15 }(x)$"),
+ TextMobject("$f_{ k=17 }(x)$"),
+ TextMobject("$f_{ k=19 }(x)$"),
+ TextMobject("$f_{ k=85 }(x)$")
+ ]
+ p=0
+ for i in range(1,20,2):
+ if(i==1):
+ graphInitial=returnFunc(self,1)
+ label=labels[p].scale(0.5).shift(y_each_unit*1.5*UP+RIGHT*x_each_unit*0.3)
+ self.play(ShowCreation(graphInitial),Write(labels[0]))
+ old=graphInitial
+ oldLabel=label
+ else:
+ graph=returnFunc(self,i)
+ graphLabel=labels[p].scale(0.5).shift(y_each_unit*1.5*UP+RIGHT*x_each_unit*0.3)
+ self.play(ReplacementTransform(old,graph),ReplacementTransform(oldLabel,graphLabel))
+ old=graph
+ oldLabel=graphLabel
+ p+=1
+ graphFinal=returnFunc(self,85)
+ labelFinal=labels[10].scale(0.5).shift(y_each_unit*1.5*UP+RIGHT*x_each_unit*0.3)
+ self.play(FadeOut(old),FadeOut(oldLabel))
+ self.play(ShowCreation(graphFinal),Write(labelFinal))
+ self.wait(1)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 2.25,self.camera_frame.move_to, y_each_unit*UP+RIGHT*x_each_unit*0.3)
+ circleMark=Circle(radius=0.1,color=GREEN).shift(x_each_unit*RIGHT*0.47+UP*y_each_unit*1.1)
+ text=TextMobject("Gibbs","phenomenon").set_color_by_tex_to_color_map({"Gibbs":BLUE,"phenomenon":YELLOW}).scale(0.1).shift(RIGHT*x_each_unit*0.65+UP*y_each_unit*1.1)
+ self.wait(0.7)
+ self.play(ShowCreation(circleMark))
+ self.play(Write(text))
+ self.wait(0.5)
+ self.play(self.camera_frame.set_width,14,self.camera_frame.move_to,0,FadeOut(circleMark),FadeOut(text))
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video5_CoinsAnalogy.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video5_CoinsAnalogy.py
new file mode 100644
index 0000000..10ee889
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video5_CoinsAnalogy.py
@@ -0,0 +1,225 @@
+from manimlib.imports import*
+import math
+import numpy as np
+
+class coinsAnalogy(Scene):
+ def construct(self):
+ text1=TextMobject("Consider we have","Rs 39").shift(2*UP).scale(0.75).set_color_by_tex_to_color_map({"Rs 39":[YELLOW,PURPLE]})
+ text2=TextMobject("and we want to represent them only in terms of","Rs 2","and","Rs 5").shift(UP).scale(0.6).set_color_by_tex_to_color_map({"Rs 2":YELLOW,"Rs 5":PURPLE})
+ text3=TextMobject("How many","Rs 2 coins","and","Rs 5 coins","do","we need?").scale(0.8).set_color_by_tex_to_color_map({"Rs 2 coins":YELLOW,"Rs 5 coins":PURPLE,"we need?":RED})
+ text4=TextMobject("We","perform","the following!").scale(0.75).shift(DOWN).set_color_by_tex_to_color_map({"perform":GREEN})
+
+ self.play(FadeIn(text1))
+ self.wait(0.6)
+ self.play(Write(text2))
+ self.wait(0.5)
+ self.play(Write(text3))
+ self.wait(0.7)
+ self.play(FadeIn(text4))
+ self.wait(1)
+ self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3),FadeOut(text4))
+
+ g1=self.group("Rs 39")
+ g1.shift(3*LEFT+0.75*UP)
+ l1=self.line()
+ l1.shift(4*LEFT)
+ f1=self.fiveGroup()
+ t1=self.twoGroup()
+ f1.shift(3.5*LEFT+0.7*DOWN)
+ andT=TextMobject("and").next_to(f1,buff=-0.1).scale(0.3)
+ t1.next_to(andT,buff=0.2)
+ equal1=TextMobject("$=$")
+ equal1.next_to(l1,buff=0.2)
+
+ self.play(ShowCreation(g1))
+ self.play(ShowCreation(l1))
+ self.play(ShowCreation(f1),Write(andT),ShowCreation(t1))
+ self.play(ShowCreation(equal1))
+ self.wait(0.6)
+
+ f2=self.fiveGroup().next_to(equal1,buff=0.4)
+ multiple1=TextMobject("$X7$","$\quad +$").next_to(f2,buff=0.2).set_color_by_tex_to_color_map({"$X7$":PURPLE})
+ l2=self.line().next_to(multiple1,buff=0.4)
+ g2=self.group("Rs 4").shift(2.75*RIGHT+0.75*UP)
+ t2=self.twoGroup().shift(2.75*RIGHT+0.7*DOWN)
+
+ self.play(ShowCreation(f2))
+ self.play(ShowCreation(multiple1))
+ self.play(ShowCreation(g2))
+ self.play(ShowCreation(l2))
+ self.play(ShowCreation(t2))
+ self.wait(1)
+
+ tempGrup=VGroup(g2,l2,t2)
+
+ t3=self.twoGroup().next_to(multiple1,buff=0.4)
+ multiple2=TextMobject("$X2$").next_to(t3,buff=0.2).set_color_by_tex_to_color_map({"$X2$":YELLOW})
+
+ self.play(ReplacementTransform(tempGrup,t3))
+ self.play(Write(multiple2))
+ self.wait(2)
+
+ def line(self):
+ l=Line(start=[0,0,0],end=[2,0,0])
+ return l
+
+ def twoGroup(self):
+ two=Circle(radius=0.25,color=BLACK,fill_color=YELLOW,fill_opacity=0.7)
+ twoText=TextMobject("Rs 2").scale(0.25).set_color(BLACK)
+ twoGrup=VGroup(two,twoText)
+ return twoGrup
+
+ def fiveGroup(self):
+ five=Circle(radius=0.35,color=BLACK,fill_color=PURPLE,fill_opacity=0.7)
+ fiveText=TextMobject("Rs 5").scale(0.3).set_color(BLACK)
+ fiveGrup=VGroup(five,fiveText)
+ return fiveGrup
+
+ def group(self,money):
+ coins=[
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.75),
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.8),
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.7),
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.75),
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.8),
+ Circle(radius=0.35,color=GREY,fill_color=GREY,fill_opacity=0.7)
+ ]
+ coinsText=TextMobject(money).set_color(BLACK)
+ coinsText.scale(0.35)
+
+ coins[1].shift(0.2*RIGHT+0.2*UP)
+ coins[2].shift(0.2*RIGHT+0.1*DOWN)
+ coins[3].shift(0.2*DOWN)
+ coins[4].shift(0.2*UP+0.2*LEFT)
+ coins[5].shift(0.2*LEFT+0.1*LEFT)
+
+ coinsGrup=VGroup(coins[0],coins[1],coins[2],coins[3],coins[4],coins[5],coinsText)
+ return coinsGrup
+
+class divideFunction(GraphScene):
+ CONFIG = {
+ "x_min": -6,
+ "x_max": 6,
+ "y_min": -300,
+ "y_max": 300,
+ "x_tick_frequency": 2,
+ "y_tick_frequency": 300,
+ "graph_origin": 3*LEFT+1.5*UP+6*LEFT,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$y$",
+ "x_labeled_nums": [-6,0,6],
+ "y_labeled_nums": [-300,0,300],
+ "x_axis_width": 1.5,
+ "y_axis_height": 1
+ }
+ def line(self):
+ l=Line(start=[0,0,0],end=[2,0,0])
+ return l
+ def construct(self):
+ text1=TextMobject("Similarly,").scale(0.8).shift(UP).set_color(RED)
+ text2=TextMobject("To find the amount of","each frequency","present in","$f(x)$").scale(0.6).set_color_by_tex_to_color_map({"each frequency":[YELLOW,RED],"$f(x)$":RED})
+ text3=TextMobject("We","perform","the following!").scale(0.7).shift(DOWN).set_color_by_tex_to_color_map({"perform":GREEN})
+
+ self.play(FadeIn(text1))
+ self.wait(0.6)
+ self.play(Write(text2))
+ self.wait(0.7)
+ self.play(FadeIn(text3))
+
+ self.wait(1)
+ self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3))
+
+ boxUP=Square(side_length=1.7,fill_color=BLUE_C,fill_opacity=0.5,color=BLACK).shift(3*LEFT+UP)
+ boxDOWN=Square(side_length=1.7,fill_color=BLUE_C,fill_opacity=0.5,color=BLACK).shift(3*LEFT+DOWN)
+
+ axes=[]
+ self.graph_origin=10*LEFT+1.5*UP
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ fx=self.get_graph(lambda x:math.pow(x,3)-math.pow(x,2)+x-2,x_min=-2*math.pi,x_max=2*math.pi,color=RED).shift(7*RIGHT+0.5*DOWN)
+
+ l=self.line().shift(4*LEFT)
+
+ self.graph_origin=10*LEFT+1.5*DOWN
+ self.y_min=-2
+ self.y_max=1
+ self.y_tick_frequency=1
+ self.y_labeled_nums=[-1,0,1]
+ self.setup_axes(scalee=1)
+ axes.append(self.axes)
+ sinx=self.get_graph(lambda x:np.sin(x),x_min=-2*math.pi,x_max=2*math.pi,color=PURPLE_C).shift(7*RIGHT+0.5*UP)
+
+ equal=TextMobject("$=$").next_to(l,buff=0.3)
+ result1=TextMobject("Amount of").scale(0.6).next_to(equal,buff=0.3)
+ boxRIGHT=Square(side_length=1.7,fill_color=GOLD_B,fill_opacity=0.5,color=BLACK).next_to(result1,buff=0.2)
+ self.graph_origin=10*LEFT
+ sinxResult=self.get_graph(lambda x:np.sin(x),color=PURPLE_C).next_to(result1,buff=0.3)
+ axes.append(self.axes)
+ result2=TextMobject("in","$f(x)$").scale(0.6).next_to(sinxResult,buff=0.2).set_color_by_tex_to_color_map({"$f(x)$":RED})
+
+ self.play(FadeIn(boxUP))
+ self.play(ShowCreation(fx))
+ self.play(ShowCreation(l))
+ self.play(FadeIn(boxDOWN))
+ self.play(ShowCreation(sinx))
+ self.wait(0.4)
+ self.play(Write(equal))
+ self.play(Write(result1))
+ self.play(FadeIn(boxRIGHT))
+ self.play(ShowCreation(sinxResult))
+ self.play(Write(result2))
+ aText1=TextMobject("and").scale(0.65).shift(4*RIGHT+2*DOWN).set_color(GREEN)
+ self.play(Write(aText1))
+ self.wait(0.7)
+
+ self.graph_origin=10*LEFT
+ cos4x=self.get_graph(lambda x:np.cos(4*x),color=PURPLE_A).shift(7*RIGHT+0.5*UP)
+ axes.append(self.axes)
+ self.graph_origin=10*LEFT
+ cos4xResult=self.get_graph(lambda x:np.cos(4*x),color=PURPLE_A).next_to(result1,buff=0.3)
+ axes.append(self.axes)
+ self.play(ReplacementTransform(sinx,cos4x),ReplacementTransform(sinxResult,cos4xResult))
+ self.wait(0.7)
+
+ soText=TextMobject("And so on..!").scale(0.65).shift(4*RIGHT+2*DOWN).set_color(GREEN)
+ self.play(ReplacementTransform(aText1,soText))
+
+ self.graph_origin=10*LEFT
+ cosx=self.get_graph(lambda x:np.cos(x),color=GREEN_E).shift(7*RIGHT+0.5*UP)
+ axes.append(self.axes)
+ self.graph_origin=10*LEFT
+ cosxResult=self.get_graph(lambda x:np.cos(x),color=GREEN_E).next_to(result1,buff=0.3)
+ axes.append(self.axes)
+ self.play(ReplacementTransform(cos4x,cosx),ReplacementTransform(cos4xResult,cosxResult))
+
+ self.graph_origin=10*LEFT
+ cos3x=self.get_graph(lambda x:np.cos(3*x),color=GREEN_C).shift(7*RIGHT+0.5*UP)
+ axes.append(self.axes)
+ self.graph_origin=10*LEFT
+ cos3xResult=self.get_graph(lambda x:np.cos(3*x),color=GREEN_C).next_to(result1,buff=0.3)
+ axes.append(self.axes)
+ self.play(ReplacementTransform(cosx,cos3x),ReplacementTransform(cosxResult,cos3xResult))
+
+ self.graph_origin=10*LEFT
+ const=self.get_graph(lambda x:1,color=YELLOW_B).shift(7*RIGHT+0.5*UP)
+ axes.append(self.axes)
+ self.graph_origin=10*LEFT
+ constResult=self.get_graph(lambda x:1,color=YELLOW_B).next_to(result1,buff=0.3)
+ axes.append(self.axes)
+ self.play(ReplacementTransform(cos3x,const),ReplacementTransform(cos3xResult,constResult))
+
+ self.wait(1)
+
+ self.play(FadeOut(soText),FadeOut(const),FadeOut(constResult),FadeOut(l),FadeOut(equal),FadeOut(result1),FadeOut(result2),FadeOut(fx),FadeOut(boxRIGHT),FadeOut(boxUP),FadeOut(boxDOWN))
+
+ finalFormula1=TexMobject(r"Therefore,",r"F(s)",r"=",r"\int _{ -\infty }^{ \infty }",r"{f(t)",r"\over",r"sines",r"\enspace and \enspace",r"cosines}",r"dt }").scale(0.7).set_color_by_tex_to_color_map({"F(s)":RED,"sines":BLUE,"cosines}":YELLOW,"{f(t)":GREEN})
+ finalFormula2=TexMobject(r"F(s)",r"=",r"\int _{ -\infty }^{ \infty }",r"{f(t)",r"\over",r"{ e }^",r"{ i\theta }}",r"dt }").set_color_by_tex_to_color_map({"F(s)":RED,"{f(t)":GREEN})
+ subFinalFormula=TextMobject("where","$\\theta =2\pi st$").scale(0.5).shift(DOWN+2*RIGHT).set_color_by_tex_to_color_map({"$\\theta =2\pi st$":RED})
+
+ self.play(Write(finalFormula1))
+ self.wait(1)
+ self.play(ReplacementTransform(finalFormula1,finalFormula2))
+ self.play(Write(subFinalFormula))
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/README.md b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/README.md
new file mode 100644
index 0000000..d4cd8bc
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/README.md
@@ -0,0 +1,21 @@
+### Basic Intuition
+![GIF1](gifs/basicIntuition.gif)
+
+### Solving D.E.intuition
+![GIF2](gifs/solvingDEintuition.gif)
+
+### Unit Step Function
+#### Part1
+![GIF3](gifs/unitStepFunction.gif)
+#### Part2
+![GIF4](gifs/UnitStepFunctionExample.gif)
+#### Part3
+![GIF5](gifs/LtransformUnitStepFunction.gif)
+
+### Dirac Delta Function
+#### Part1
+![GIF6](gifs/DiracFunction.gif)
+#### Part2
+![GIF7](gifs/DiracFunctionFormation.gif)
+#### Part3
+![GIF8](gifs/LtransformDiracFunction.gif)
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file1_laplaceTransformBasic.py b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file1_laplaceTransformBasic.py
new file mode 100644
index 0000000..7a37ae8
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file1_laplaceTransformBasic.py
@@ -0,0 +1,67 @@
+from manimlib.imports import *
+import pylatex
+
+class depict(Scene):
+ def construct(self):
+ square=Square(side_length=2,fill_color=GREEN,fill_opacity=0.7)
+ inputText=TextMobject("$t$")
+ squareText=TextMobject("$f$")
+ outputText=TextMobject("$f($","$t$","$)$")
+
+ inputText.scale(0.8)
+ outputText.scale(0.8)
+ inputText.shift(2.1*LEFT)
+ outputText.shift(1.5*RIGHT)
+ squareText.scale(1.2)
+
+ outputText.set_color_by_tex_to_color_map({"$t$":RED})
+
+ self.play(ShowCreation(square))
+ self.play(FadeIn(squareText))
+ self.add(inputText)
+ self.wait(0.5)
+ self.play(ApplyMethod(inputText.shift,0.9*RIGHT))
+ self.play(FadeOut(inputText),FadeIn(outputText))
+ self.play(ApplyMethod(outputText.shift,1.5*RIGHT))
+ self.wait(1)
+
+ fOutGroup=VGroup(outputText,square,squareText)
+ self.play(ApplyMethod(fOutGroup.scale,0.6))
+ self.play(ApplyMethod(fOutGroup.shift,5*LEFT))
+ self.wait(0.8)
+ laplaceSquare=Square(side_length=3,fill_color=BLUE,fill_opacity=0.6)
+ laplaceText=TextMobject("$\mathscr{L}$")
+ outText=TextMobject("$F($","$s$","$)$")
+ outText.scale(0.8)
+ outText.set_color_by_tex_to_color_map({"$s$":RED})
+ laplaceText.scale(1.5)
+ outText.shift(2*RIGHT)
+ self.play(ShowCreation(laplaceSquare))
+ self.play(FadeIn(laplaceText))
+ self.wait(0.5)
+ self.play(ApplyMethod(outputText.shift,RIGHT))
+ self.play(FadeOut(outputText),FadeIn(outText))
+ self.play(ApplyMethod(outText.shift,2*RIGHT))
+ self.wait(1)
+
+ updatedOutputText=TextMobject("$f($","$t$","$)$")
+ updatedOutputText.shift(2.5*LEFT)
+ updatedOutputText.set_color_by_tex_to_color_map({"$t$":RED})
+ updatedInputText=TextMobject("$t$")
+ updatedInputText.shift(6*LEFT)
+ updatedInputText.scale(0.7)
+ updatedOutputText.scale(0.7)
+
+ self.play(FadeIn(updatedInputText),FadeIn(updatedOutputText))
+ self.wait(0.5)
+
+ timeText=TextMobject("Time Domain")
+ frequencyText=TextMobject("Frequency Domain")
+ timeText.set_color(RED)
+ frequencyText.set_color(RED)
+ timeText.scale(0.35)
+ frequencyText.scale(0.35)
+ timeText.shift(2.5*LEFT+0.5*DOWN)
+ frequencyText.shift(4*RIGHT+0.5*DOWN)
+ self.play(Write(frequencyText),Write(timeText))
+ self.wait(2) \ No newline at end of file
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file2_differentialEqSimplification.py b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file2_differentialEqSimplification.py
new file mode 100644
index 0000000..33e9173
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file2_differentialEqSimplification.py
@@ -0,0 +1,78 @@
+from manimlib.imports import *
+import pylatex
+
+class scene(Scene):
+ def construct(self):
+ normalSq=Square(side_length=2,fill_color=BLUE,fill_opacity=0.6)
+ normalSqText=TextMobject("$\mathscr{L}$")
+ inputText=TextMobject("$f($","$y'(t)$","$)$")
+ outputText=TextMobject("$F($","$s$","$)$")
+
+ inputText.scale(0.7)
+ outputText.scale(0.7)
+ inputText.shift(2.5*LEFT)
+ outputText.shift(1.7*RIGHT)
+ normalSq.scale(1.2)
+
+ inputText.set_color_by_tex_to_color_map({"$y'(t)$":RED})
+ outputText.set_color_by_tex_to_color_map({"$s$":RED})
+
+ self.play(ShowCreation(normalSq))
+ self.play(FadeIn(normalSqText))
+ self.add(inputText)
+ self.wait(0.5)
+ self.play(ApplyMethod(inputText.shift,0.7*RIGHT))
+ self.play(FadeOut(inputText),FadeIn(outputText))
+ self.play(ApplyMethod(outputText.shift,RIGHT))
+ self.wait(1)
+
+ group1=VGroup(outputText,normalSq,normalSqText)
+ self.play(ApplyMethod(group1.scale,0.6))
+ self.play(ApplyMethod(group1.shift,4.7*LEFT))
+ self.wait(0.6)
+
+ inverseSq=Square(side_length=3,fill_color=GREEN,fill_opacity=0.6)
+ inverseSqText=TextMobject("$\mathscr{L}^{ -1 }$")
+ outText=TextMobject("$f($","$y(t)$","$)$")
+ inverseSqText.scale(0.7)
+ outText.scale(0.7)
+ outText.set_color_by_tex_to_color_map({"$y(t)$":RED})
+ self.play(ShowCreation(inverseSq))
+ self.play(FadeIn(inverseSqText))
+ self.wait(0.5)
+ outText.shift(2*RIGHT)
+ self.play(ApplyMethod(outputText.shift,RIGHT))
+ self.play(FadeOut(outputText),FadeIn(outText))
+ self.play(ApplyMethod(outText.shift,2*RIGHT))
+ self.wait(1)
+
+ updatedOutputText=TextMobject("$F($","$s$","$)$")
+ updatedOutputText.shift(2.5*LEFT)
+ updatedInputText=TextMobject("$f($","$y'(t)$","$)$")
+ updatedInputText.shift(6*LEFT)
+ updatedInputText.scale(0.7)
+ updatedOutputText.scale(0.7)
+ updatedOutputText.set_color_by_tex_to_color_map({"$s$":RED})
+ updatedInputText.set_color_by_tex_to_color_map({"$y'(t)$":RED})
+
+ self.play(FadeIn(updatedInputText),FadeIn(updatedOutputText))
+ self.wait(0.5)
+
+ deText=TextMobject("Differential Equation")
+ deinterTexta=TextMobject("Transformed D.E")
+ deinterTextb=TextMobject("(Easy to simplify)!")
+ deOutText=TextMobject("Solution of D.E")
+ deText.set_color(RED)
+ deinterTexta.set_color(RED)
+ deOutText.set_color(RED)
+ deinterTextb.set_color(PURPLE_C)
+ deText.scale(0.35)
+ deinterTexta.scale(0.35)
+ deinterTextb.scale(0.35)
+ deOutText.scale(0.35)
+ deText.shift(6*LEFT+0.5*DOWN)
+ deinterTexta.shift(2.6*LEFT+0.5*DOWN)
+ deinterTextb.shift(2.6*LEFT+0.8*DOWN)
+ deOutText.shift(4*RIGHT+0.5*DOWN)
+ self.play(Write(deText),Write(deinterTexta),Write(deinterTextb),Write(deOutText))
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file3_unitStepFunction.py b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file3_unitStepFunction.py
new file mode 100644
index 0000000..53c5f14
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file3_unitStepFunction.py
@@ -0,0 +1,168 @@
+from manimlib.imports import *
+import math
+import pylatex
+
+class intro(GraphScene,Scene):
+ CONFIG = {
+ "x_min": -8,
+ "x_max": 8,
+ "y_min": -5,
+ "y_max": 5,
+ "graph_origin": ORIGIN+DOWN,
+ "function_color": RED,
+ "axes_color": GREEN,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$\mu_{c}(t)$",
+ "exclude_zero_label": True,
+ "y_axis_height":4,
+ "x_axis_width":7
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ Scene.setup(self)
+ def construct(self):
+ introText=TextMobject("Unit","Step","Function")
+ introText.set_color_by_tex_to_color_map({"Unit":BLUE,"Step":YELLOW})
+ introText.scale(0.8)
+ self.play(Write(introText))
+ self.wait(0.5)
+ self.play(ApplyMethod(introText.shift,3*UP))
+ formulaa=TextMobject("$\mu _{ c }(t)=0\quad$","$t<c$")
+ formulab=TextMobject("$\mu _{ c }(t)=1\quad$","$t\ge c$")
+ formulaa.set_color_by_tex_to_color_map({"$t<c$":RED})
+ formulab.set_color_by_tex_to_color_map({"$t\ge c$":RED})
+ formulaa.scale(0.8)
+ formulab.scale(0.8)
+ formulab.shift(0.5*DOWN)
+ self.play(FadeIn(formulaa),FadeIn(formulab))
+ self.wait(1)
+
+ self.play(FadeOut(formulaa),FadeOut(formulab))
+
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ self.setup_axes(animate=True)
+ self.wait(0.8)
+
+ c=TextMobject("c")
+ c.scale(0.5)
+ c.set_color(RED)
+ c.shift(self.graph_origin+3*x_each_unit*RIGHT+y_each_unit*0.4*DOWN)
+ self.play(Write(c))
+ smallCircle=Circle(radius=0.03,fill_color=WHITE,color=WHITE)
+ smallCircle.shift(self.graph_origin+3*x_each_unit*RIGHT)
+ downLine=Line(start=self.graph_origin,end=self.graph_origin+RIGHT*3*x_each_unit,color=BLUE)
+ upLine=Line(start=self.graph_origin+3*x_each_unit*RIGHT+y_each_unit*UP,end=self.graph_origin+8*x_each_unit*RIGHT+y_each_unit*UP,color=BLUE)
+
+ self.play(Write(downLine))
+ self.play(Write(smallCircle))
+ self.play(Write(upLine))
+ self.wait(1.5)
+ self.play(FadeOut(self.axes),FadeOut(smallCircle),FadeOut(c),FadeOut(upLine),FadeOut(downLine),FadeOut(introText))
+ self.wait(0.5)
+
+
+class example(GraphScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 8,
+ "y_min": -4,
+ "y_max": 5,
+ "graph_origin": ORIGIN+LEFT+DOWN,
+ "function_color": RED,
+ "axes_color": GREEN,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$y$",
+ "exclude_zero_label": True,
+ "y_axis_height":4,
+ "x_axis_width":6
+ }
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ text1=TextMobject("Consider the","formation","of","following graph!"," (a part of $f(t))$")
+ text1.set_color_by_tex_to_color_map({"following graph!":BLUE,"formation":YELLOW})
+ text1.scale(0.6)
+ ft=TextMobject("$f(t)$")
+ ftminusc=TextMobject("$f(t-c)$")
+ final=TextMobject("$\mu_{c}(t)f(t-c)$")
+ ft.set_color(PURPLE_C)
+ ftminusc.set_color(PURPLE_C)
+ final.set_color(PURPLE_C)
+ c=TextMobject("c")
+ c.scale(0.5)
+ c.set_color(RED)
+ c.shift(self.graph_origin+RIGHT*x_each_unit*3+DOWN*y_each_unit*0.5)
+ ft.scale(0.5)
+ ftminusc.scale(0.5)
+ final.scale(0.5)
+
+ self.play(Write(text1))
+ self.play(ApplyMethod(text1.shift,3*UP))
+
+ self.setup_axes(animate=True)
+ y=self.get_graph(lambda x:(math.pow((x-3),3)/3)-math.pow((x-3),2)-(x-3)+3,x_min=3,x_max=7,color=RED)
+ f=self.get_graph(lambda x:(math.pow(x,3)/3)-math.pow(x,2)-x+3,x_min=-2,x_max=4,color=RED)
+ yFull=self.get_graph(lambda x:(math.pow((x-3),3)/3)-math.pow((x-3),2)-(x-3)+3,x_min=1,x_max=7,color=RED)
+
+ self.play(Write(c))
+ self.play(ShowCreation(y))
+ self.wait(1)
+ self.play(FadeOut(self.axes),FadeOut(y),FadeOut(c))
+
+ belowText1=TextMobject("Consider its","normal form",", $f(t)$")
+ belowText1.set_color_by_tex_to_color_map({"normal form":BLUE})
+ belowText2=TextMobject("Shift it to","x=c")
+ belowText2.set_color_by_tex_to_color_map({"x=c":RED})
+ belowText3a=TextMobject("Now to remove the","left part","of","$c$,")
+ belowText3a.set_color_by_tex_to_color_map({"left part":YELLOW,"$c$,":YELLOW})
+ belowText3b=TextMobject("multiply it with the","unit step function",", $\mu_{c}(t)$")
+ belowText3b.set_color_by_tex_to_color_map({"unit step function":BLUE})
+ belowText1.scale(0.4)
+ belowText2.scale(0.4)
+ belowText3a.scale(0.4)
+ belowText3b.scale(0.4)
+ belowText1.shift(2.7*DOWN+4*RIGHT)
+ belowText2.shift(2.7*DOWN+4*RIGHT)
+ belowText3a.shift(2.7*DOWN+4*RIGHT)
+ belowText3b.shift(3.1*DOWN+4*RIGHT)
+ self.setup_axes(animate=True)
+ self.play(Write(belowText1))
+ self.play(ShowCreation(f))
+ ft.shift(1.5*RIGHT+UP*0.8)
+ self.play(FadeIn(ft))
+ self.play(ReplacementTransform(belowText1,belowText2))
+ ftminusc.shift(3.5*RIGHT+UP*0.8)
+ self.play(ReplacementTransform(f,yFull),ReplacementTransform(ft,ftminusc),Write(c))
+ self.wait(1)
+
+ self.play(ReplacementTransform(belowText2,belowText3a))
+ self.play(Write(belowText3b))
+ final.shift(3.7*RIGHT+UP*0.8)
+ self.play(ReplacementTransform(ftminusc,final),ReplacementTransform(yFull,y))
+
+ finalText=TextMobject("We got our required Graph!")
+ finalText.scale(0.55)
+ finalText.shift(2.7*DOWN+4*RIGHT)
+ self.play(FadeOut(belowText3b),ReplacementTransform(belowText3a,finalText))
+ self.wait(1.5)
+
+ self.play(FadeOut(finalText),FadeOut(text1))
+
+ graphGrup=VGroup(self.axes,c,final,y)
+ self.play(ApplyMethod(graphGrup.scale,0.45))
+ box=Square(side_length=2,fill_color=BLUE,fill_opacity=0.7)
+ boxtext=TextMobject("$\mathscr{L}$")
+ boxtext.scale(0.8)
+ self.play(ApplyMethod(graphGrup.shift,5.5*LEFT+UP))
+ self.play(ShowCreation(box),Write(boxtext))
+ outText=TextMobject("${ e }^{ -cs }F(s)$")
+ outText.set_color(GREEN)
+ outText.scale(0.65)
+ outText.shift(2*RIGHT)
+ self.play(ApplyMethod(graphGrup.shift,2*RIGHT))
+ self.play(FadeOut(graphGrup),FadeIn(outText))
+ self.play(ApplyMethod(outText.shift,RIGHT))
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file4_diracBasic.py b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file4_diracBasic.py
new file mode 100644
index 0000000..0c7f8e4
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file4_diracBasic.py
@@ -0,0 +1,61 @@
+from manimlib.imports import *
+import math
+import pylatex
+
+class intro(GraphScene,Scene):
+ CONFIG = {
+ "x_min": -9,
+ "x_max": 9,
+ "y_min": -5,
+ "y_max": 5,
+ "graph_origin": ORIGIN+DOWN,
+ "function_color": RED,
+ "axes_color": GREEN,
+ "x_axis_label": "$x$",
+ "y_axis_label": "$\delta (x)$",
+ "y_axis_height":4,
+ "x_axis_width":7
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ Scene.setup(self)
+ def construct(self):
+ introText=TextMobject("Dirac","Delta","Function")
+ introText.set_color_by_tex_to_color_map({"Dirac":BLUE,"Delta":YELLOW})
+ introText.scale(0.8)
+ self.play(Write(introText))
+ self.wait(0.5)
+ self.play(ApplyMethod(introText.shift,3*UP))
+ formulaa=TextMobject("$\delta (x)=\infty$","$x=0$")
+ formulab=TextMobject("$\delta (x)=0$","$x\\neq 0$")
+ formulaa.set_color_by_tex_to_color_map({"$x=0$":RED})
+ formulab.set_color_by_tex_to_color_map({"$x\\neq 0$":RED})
+ formulaa.scale(0.8)
+ formulab.scale(0.8)
+ formulab.shift(0.5*DOWN)
+ self.play(FadeIn(formulaa),FadeIn(formulab))
+ self.wait(1)
+
+ self.play(FadeOut(formulaa),FadeOut(formulab))
+
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ self.setup_axes(animate=True)
+ self.wait(0.8)
+
+ functionUpLine=Line(start=self.graph_origin,end=self.graph_origin+UP*y_each_unit*5,color=RED)
+ functionDownLine=Line(start=self.graph_origin+UP*y_each_unit*5,end=self.graph_origin,color=RED)
+ functinLeftLine=Line(start=self.graph_origin+LEFT*x_each_unit*9,end=self.graph_origin,color=RED)
+ functionRightLine=Line(start=self.graph_origin,end=self.graph_origin+RIGHT*x_each_unit*9,color=RED)
+ functionUpLine.shift(0.02*LEFT)
+ functionRightLine.shift(0.02*RIGHT)
+
+ self.play(ShowCreation(functinLeftLine))
+ self.play(ShowCreation(functionUpLine))
+ self.play(ShowCreation(functionDownLine))
+ self.play(ShowCreation(functionRightLine))
+ self.wait(1.5)
+
+ self.play(FadeOut(self.axes),FadeOut(introText),FadeOut(functinLeftLine),FadeOut(functionRightLine),FadeOut(functionUpLine),FadeOut(functionDownLine))
+ self.wait(0.5)
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file5_formationDiracDeltaFunction.py b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file5_formationDiracDeltaFunction.py
new file mode 100644
index 0000000..565a7cb
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file5_formationDiracDeltaFunction.py
@@ -0,0 +1,142 @@
+from manimlib.imports import *
+import math
+import pylatex
+
+def func(x,t):
+ if(x>-t and x<t):
+ return 1/(2*t)
+ else:
+ return 0
+
+
+class formation(GraphScene):
+ CONFIG = {
+ "x_min": -7,
+ "x_max": 7,
+ "y_min": -2,
+ "y_max": 2,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": GREEN,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$y$",
+ "y_labeled_nums":range(-2,3),
+ "y_axis_height":4,
+ "x_axis_width":7
+ }
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ text1=TextMobject("Consider the","following function's graph!")
+ text1.set_color_by_tex_to_color_map({"following function's graph!":BLUE})
+ text1.scale(0.6)
+
+ equation1=TextMobject("$\delta _{ \\tau }(t)=\\frac { 1 }{ 2\\tau } \quad$","$-\\tau <t<\\tau$")
+ equation2=TextMobject("$\delta _{ \\tau }(t)=0\quad \quad$","$t\in (-\infty ,-\\tau ]\cup [\\tau ,\infty )$")
+ equation1.scale(0.7)
+ equation2.scale(0.7)
+ equation1.shift(0.2*UP)
+ equation2.shift(0.4*DOWN+RIGHT*0.8)
+ equation1.set_color_by_tex_to_color_map({"$-\\tau <t<\\tau$":RED})
+ equation2.set_color_by_tex_to_color_map({"$t\in (-\infty ,-\\tau ]\cup [\\tau ,\infty )$":RED})
+
+ self.play(Write(text1))
+ self.play(ApplyMethod(text1.shift,3*UP))
+ self.play(Write(equation1))
+ self.play(Write(equation2))
+ self.wait(1)
+
+ self.play(FadeOut(equation1),FadeOut(equation2))
+ self.wait(0.5)
+
+ pointes1=TextMobject("$-\\tau$")
+ pointes2=TextMobject("$\\tau$")
+ pointes1.set_color(RED)
+ pointes2.set_color(RED)
+ pointes1.scale(0.65)
+ pointes2.scale(0.65)
+
+ bottomText1=TextMobject("Here","$\int _{ -\infty }^{ \infty }{ \delta _{ \\tau }(t)dt }$","=","$1$")
+ bottomText2=TextMobject("Now as","$\\tau \\rightarrow 0$")
+ bottomText3=TextMobject("We get our","Dirac Function!")
+ bottomText4=TextMobject("i.e.","$\lim _{ \\tau \\rightarrow 0 }{ \delta _{ \\tau }(t)}$","$=$","$\delta (t)$")
+ textFinal=TextMobject("Area=1")
+ bottomText1.set_color_by_tex_to_color_map({"$\int _{ -\infty }^{ \infty }{ \delta _{ \\tau }(t)dt }$":BLUE,"$1$":YELLOW})
+ textFinal.set_color(PURPLE_B)
+ bottomText2.set_color_by_tex_to_color_map({"$\\tau \\rightarrow 0$":YELLOW})
+ bottomText3.set_color_by_tex_to_color_map({"Dirac Function!":RED})
+ bottomText4.set_color_by_tex_to_color_map({"$\lim _{ \\tau \\rightarrow 0 }{ \delta _{ \\tau }(t)}$":BLUE,"$\delta (t)$":YELLOW})
+
+ bottomText1.scale(0.6)
+ bottomText2.scale(0.6)
+ bottomText3.scale(0.6)
+ bottomText4.scale(0.6)
+ textFinal.scale(0.9)
+
+ bottomText1.shift(4*RIGHT+3*DOWN)
+ bottomText2.shift(4*RIGHT+3*DOWN)
+ bottomText3.shift(4*RIGHT+3*DOWN)
+ bottomText4.shift(4*RIGHT+3*DOWN)
+ textFinal.shift(5*RIGHT+2*UP)
+
+ self.setup_axes(animate=True)
+
+ graphs=[
+ self.get_graph(lambda x:func(x,3),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,2),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,1),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,0.5),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,0.3),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,0.15),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,0.05),x_min=-7,x_max=7,color=RED),
+ self.get_graph(lambda x:func(x,0.01),x_min=-7,x_max=7,color=RED)
+ ]
+ pointes1.shift(self.graph_origin+3*LEFT*x_each_unit+0.4*DOWN*y_each_unit)
+ pointes2.shift(self.graph_origin+3*RIGHT*x_each_unit+0.4*DOWN*y_each_unit)
+
+ functionUpLine=Line(start=self.graph_origin,end=self.graph_origin+UP*y_each_unit*2,color=RED)
+ functionDownLine=Line(start=self.graph_origin+UP*y_each_unit*2,end=self.graph_origin,color=RED)
+ functinLeftLine=Line(start=self.graph_origin+LEFT*x_each_unit*7,end=self.graph_origin,color=RED)
+ functionRightLine=Line(start=self.graph_origin,end=self.graph_origin+RIGHT*x_each_unit*7,color=RED)
+ functionUpLine.shift(0.02*LEFT)
+ functionRightLine.shift(0.02*RIGHT)
+
+ self.play(Write(pointes1),Write(pointes2),ShowCreation(graphs[0]))
+ self.play(Write(bottomText1))
+ self.wait(0.7)
+
+ self.play(ReplacementTransform(bottomText1,bottomText2),Write(textFinal))
+ self.wait(0.5)
+ self.play(ReplacementTransform(graphs[0],graphs[1]),ApplyMethod(pointes2.shift,LEFT*x_each_unit),ApplyMethod(pointes1.shift,RIGHT*x_each_unit))
+ self.play(ReplacementTransform(graphs[1],graphs[2]),ApplyMethod(pointes2.shift,LEFT*x_each_unit),ApplyMethod(pointes1.shift,RIGHT*x_each_unit))
+ self.wait(0.5)
+ self.play(ReplacementTransform(graphs[2],graphs[3]),FadeOut(pointes1),FadeOut(pointes2))
+ self.play(ReplacementTransform(graphs[3],graphs[4]))
+ self.wait(1)
+ self.play(ReplacementTransform(bottomText2,bottomText3))
+ self.wait(1)
+ self.play(FadeOut(graphs[4]),ReplacementTransform(bottomText3,bottomText4))
+ self.wait(0.5)
+ self.play(ShowCreation(functinLeftLine))
+ self.play(ShowCreation(functionUpLine))
+ self.play(ShowCreation(functionDownLine))
+ self.play(ShowCreation(functionRightLine))
+ self.wait(2)
+
+ self.play(FadeOut(bottomText4),FadeOut(textFinal))
+ graphGrup=VGroup(self.axes,functinLeftLine,functionDownLine,functionRightLine,functionUpLine)
+ self.play(ApplyMethod(graphGrup.scale,0.5))
+ box=Square(side_length=2,fill_color=BLUE,fill_opacity=0.6)
+ boxtext=TextMobject("$\mathscr{L}$")
+ boxtext.scale(0.8)
+ self.play(ApplyMethod(graphGrup.shift,4.9*LEFT))
+ self.play(ShowCreation(box),Write(boxtext))
+ outText=TextMobject("$f(0)$")
+ outText.set_color(GREEN)
+ outText.scale(0.65)
+ outText.shift(1.5*RIGHT)
+ self.play(ApplyMethod(graphGrup.shift,2*RIGHT))
+ self.play(FadeOut(graphGrup),FadeIn(outText))
+ self.play(ApplyMethod(outText.shift,RIGHT))
+ self.wait(2) \ No newline at end of file
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunction.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunction.gif
new file mode 100644
index 0000000..cb62ed2
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunction.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunctionFormation.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunctionFormation.gif
new file mode 100644
index 0000000..23acbe9
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/DiracFunctionFormation.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformDiracFunction.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformDiracFunction.gif
new file mode 100644
index 0000000..b1d50b5
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformDiracFunction.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformUnitStepFunction.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformUnitStepFunction.gif
new file mode 100644
index 0000000..ccbd791
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/LtransformUnitStepFunction.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/UnitStepFunctionExample.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/UnitStepFunctionExample.gif
new file mode 100644
index 0000000..2b1c38f
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/UnitStepFunctionExample.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/basicIntuition.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/basicIntuition.gif
new file mode 100644
index 0000000..3b974bb
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/basicIntuition.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/solvingDEintuition.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/solvingDEintuition.gif
new file mode 100644
index 0000000..9883a8c
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/solvingDEintuition.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/unitStepFunction.gif b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/unitStepFunction.gif
new file mode 100644
index 0000000..16757e1
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Laplace Transformations/gifs/unitStepFunction.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/PowerSeriesQuestions.pdf b/FSF-2020/calculus/series-and-transformations/Power Series/PowerSeriesQuestions.pdf
index 04ed6d5..9fc409b 100644
--- a/FSF-2020/calculus/series-and-transformations/Power Series/PowerSeriesQuestions.pdf
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/PowerSeriesQuestions.pdf
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/README.md b/FSF-2020/calculus/series-and-transformations/Power Series/README.md
new file mode 100644
index 0000000..2fd400d
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/README.md
@@ -0,0 +1,14 @@
+#### Convergence Intuition
+![GIF1a](gifs/file1_convergence_Intuition.gif)
+
+#### Convergence Intuition
+![GIF1b](gifs/file1a_convergence_Intuition.gif)
+
+#### Convergence of a function
+![GIF2](gifs/file2_convergence_of_a_function.gif)
+
+#### Radius and IntervalOfConvergence
+![GIF3](gifs/file3_radius_and_intervalOfConvergence.gif)
+
+#### Uniform Convergence
+![GIF4](gifs/file4a_UniformConvergence.gif)
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1_convergence_Intuition.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1_convergence_Intuition.gif
new file mode 100644
index 0000000..292d19d
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1_convergence_Intuition.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1a_convergence_Intuition.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1a_convergence_Intuition.gif
new file mode 100644
index 0000000..287cbd1
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file1a_convergence_Intuition.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file2_convergence_of_a_function.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file2_convergence_of_a_function.gif
new file mode 100644
index 0000000..78d6014
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file2_convergence_of_a_function.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file3_radius_and_intervalOfConvergence.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file3_radius_and_intervalOfConvergence.gif
new file mode 100644
index 0000000..a45c75e
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file3_radius_and_intervalOfConvergence.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4_UniformConvergence.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4_UniformConvergence.gif
new file mode 100644
index 0000000..7b635d7
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4_UniformConvergence.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4a_UniformConvergence.gif b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4a_UniformConvergence.gif
new file mode 100644
index 0000000..e284b83
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4a_UniformConvergence.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/script1.py b/FSF-2020/calculus/series-and-transformations/Power Series/script1.py
deleted file mode 100644
index 28eb07c..0000000
--- a/FSF-2020/calculus/series-and-transformations/Power Series/script1.py
+++ /dev/null
@@ -1,128 +0,0 @@
-from manimlib.imports import *
-
-
-def formFormula(coeff_list,variable_list):
- coeff_list=[TextMobject("${ a }_{ 0 }$"),TextMobject("${ a }_{ 1 }$"),TextMobject("${ a }_{ 2 }$")]
- variable_list=[TextMobject("+"),TextMobject("${ x }$+"),TextMobject("${ x }^{ 2 }$")]
- coeff_list[0].shift(2.2*UP+1.6*LEFT)
- for i in range(0,3):
- coeff_list[i].set_color(GOLD_A)
- variable_list[i].next_to(coeff_list[i],buff=0.1)
- if i!=2:
- coeff_list[i+1].next_to(variable_list[i],buff=0.1)
- dots=TextMobject("...")
- dots.next_to(variable_list[2])
- expansion=VGroup(coeff_list[0],coeff_list[1],coeff_list[2],variable_list[0],variable_list[1],variable_list[2],dots)
- expansion.scale(0.7)
- return expansion
-
-class pieChart(Scene):
- def construct(self):
- circle1=Circle(radius=3,color=BLUE)
- powerText=TextMobject("Power Series")
- powerText.scale(0.8)
- self.play(FadeIn(powerText))
- self.play(ShowCreation(circle1))
- self.wait(1)
-
- powerGroup=VGroup(circle1,powerText)
-
- self.play(ApplyMethod(powerGroup.scale,0.5))
- self.play(ApplyMethod(powerGroup.move_to,2.2*UP))
- self.wait(0.5)
- expansion_power_coeff=[]
- variables_power=[]
- expansion_power=formFormula(expansion_power_coeff,variables_power)
- self.play(ReplacementTransform(powerText,expansion_power))
- self.wait(1)
-
- circle2=Circle(radius=1.5)
- circle2.shift(2.2*UP)
- expansion_geo_coeff=[0]*3
- variables_geo=[0]*3
- arrow1_2=Line(start=0.7*UP,end=2.5*LEFT)
- expansion_geo_coeff=[TextMobject("${ a }_{ 0 }$"),TextMobject("${ a }_{ 1 }$"),TextMobject("${ a }_{ 2 }$")]
- for i in range(0,3):
- expansion_geo_coeff[i].set_color(GOLD_A)
- variables_geo=[TextMobject("+"),TextMobject("${ x }$+"),TextMobject("${ x }^{ 2 }$")]
- expansion_geo_coeff[0].shift(2.2*UP+1.6*LEFT)
- for i in range(0,3):
- variables_geo[i].next_to(expansion_geo_coeff[i],buff=0.1)
- if i!=2:
- expansion_geo_coeff[i+1].next_to(variables_geo[i],buff=0.1)
- dots=TextMobject("...")
- dots.next_to(variables_geo[2])
- expansion_geo=VGroup(expansion_geo_coeff[0],expansion_geo_coeff[1],expansion_geo_coeff[2],variables_geo[0],variables_geo[1],variables_geo[2],dots)
- expansion_geo.scale(0.7)
-
- self.play(ApplyMethod(circle2.shift,4*LEFT+2.5*DOWN),ApplyMethod(expansion_geo.shift,4*LEFT+2.5*DOWN))
- self.add(arrow1_2)
- self.wait(1)
-
- ones=[TextMobject("1"),TextMobject("1"),TextMobject("1")]
- for i in range(0,3):
- ones[i].set_color(GOLD_A)
- ones[0].shift(0.3*DOWN,5*LEFT)
- ones[1].next_to(ones[0],buff=0.5)
- ones[2].next_to(ones[1],buff=0.7)
- self.play(ReplacementTransform(expansion_geo_coeff[0],ones[0]),ReplacementTransform(expansion_geo_coeff[1],ones[1]),ReplacementTransform(expansion_geo_coeff[2],ones[2]))
- self.wait(1)
- expansion_geo=VGroup(ones[0],ones[1],ones[2],variables_geo[0],variables_geo[1],variables_geo[2],dots)
-
- expansion_geo_final=TextMobject("$1+x+{ x }^{ 2 }..$")
- expansion_geo_final.scale(0.8)
- expansion_geo_final.shift(0.3*DOWN+4*LEFT)
- self.play(ReplacementTransform(expansion_geo,expansion_geo_final))
- self.wait(1)
-
- circle3=Circle(radius=1.5,color=GREEN)
- circle3.shift(2.2*UP)
- expansion_taylor_coeff=[0]*3
- variables_taylor=[0]*3
- arrow1_3=Line(start=0.7*UP,end=DOWN*0.3)
- expansion_taylor_coeff=[TextMobject("${ a }_{ 0 }$"),TextMobject("${ a }_{ 1 }$"),TextMobject("${ a }_{ 2 }$")]
- for i in range(0,3):
- expansion_taylor_coeff[i].set_color(GOLD_A)
- variables_taylor=[TextMobject("+"),TextMobject("${ x }$+"),TextMobject("${ x }^{ 2 }$")]
- expansion_taylor_coeff[0].shift(2.2*UP+1.6*LEFT)
- for i in range(0,3):
- variables_taylor[i].next_to(expansion_taylor_coeff[i],buff=0.1)
- if i!=2:
- expansion_taylor_coeff[i+1].next_to(variables_taylor[i],buff=0.1)
- dots=TextMobject("...")
- dots.next_to(variables_taylor[2])
- expansion_taylor=VGroup(expansion_taylor_coeff[0],expansion_taylor_coeff[1],expansion_taylor_coeff[2],variables_taylor[0],variables_taylor[1],variables_taylor[2],dots)
- expansion_taylor.scale(0.7)
-
- self.play(ApplyMethod(circle3.shift,4*DOWN),ApplyMethod(expansion_taylor.shift,4*DOWN))
- self.add(arrow1_3)
- self.wait(1)
-
- differentials=[TextMobject("$f(0)$"),TextMobject("${ f'\left( 0 \\right) }$"),TextMobject("$\\frac { f''\left( 0 \\right) }{ 2! }$")]
- for i in range(0,3):
- differentials[i].set_color(GOLD_A)
- differentials[0].shift(1.8*DOWN+1.15*LEFT)
- differentials[1].shift(1.8*DOWN+0.45*LEFT)
- differentials[2].shift(1.8*DOWN+0.45*RIGHT)
- differentials[0].scale(0.35)
- differentials[1].scale(0.35)
- differentials[2].scale(0.35)
- self.play(ReplacementTransform(expansion_taylor_coeff[0],differentials[0]),ReplacementTransform(expansion_taylor_coeff[1],differentials[1]),ReplacementTransform(expansion_taylor_coeff[2],differentials[2]))
- self.wait(2)
- expansion_taylor_final=VGroup(differentials[0],differentials[1],differentials[2],variables_taylor[0],variables_taylor[1],variables_taylor[2],dots)
-
- self.play(FadeOut(expansion_geo_final),FadeOut(expansion_taylor_final))
- geoText=TextMobject("Geometric Series")
- geoText.scale(0.7)
- geoText.shift(4*LEFT+0.3*DOWN)
- taylorText=TextMobject("Taylor Series")
- taylorText.scale(0.7)
- taylorText.shift(1.8*DOWN)
- self.play(FadeIn(geoText),FadeIn(taylorText))
- self.wait(1)
-
- soOntext=TextMobject("So on..!")
- soOntext.shift(4*RIGHT)
- soOntext.scale(0.8)
- self.play(FadeIn(soOntext))
- self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/script2.py b/FSF-2020/calculus/series-and-transformations/Power Series/video1_convergence_Intuition.py
index 72356c6..66f48f9 100644
--- a/FSF-2020/calculus/series-and-transformations/Power Series/script2.py
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/video1_convergence_Intuition.py
@@ -11,23 +11,36 @@ class convergence(Scene):
self.play(ApplyMethod(originalFormula.shift,2.7*UP))
self.wait(1)
- terms=["$a_{ 0 }$","$a_{ 1 }x$","$a_{ 2 }x^{ 2 }$","$a_{ 3 }x^{ 3 }$","$a_{ 4 }x^{ 4 }$","$a_{ 5 }x^{ 5 }$","$a_{ 6 }x^{ 6 }$","$a_{ 7 }x^{ 7 }$","$a_{ 8 }x^{ 8 }$","$a_{ 9 }x^{ 9 }$","$a_{ 10 }x^{ 10 }$","$a_{ 11 }x^{ 11 }$"]
+ colors=[PURPLE_E,PURPLE_D,MAROON_D,RED_E,RED_D,RED_C,ORANGE,YELLOW_E,YELLOW_D,YELLOW_B]
+ terms=["$a_{ 0 }$","$a_{ 1 }x$","$a_{ 2 }x^{ 2 }$","$a_{ 3 }x^{ 3 }$","$a_{ 4 }x^{ 4 }$","$a_{ 5 }x^{ 5 }$","$a_{ 6 }x^{ 6 }$","$a_{ 7 }x^{ 7 }$","$a_{ 8 }x^{ 8 }$","$a_{ 9 }x^{ 9 }$"]
termsTogetherString="+".join(terms)
- termsTogether=TextMobject(termsTogetherString+"...")
+ #termsTogether=TextMobject(termsTogetherString+"...")
+ termsTogether=TextMobject("$a_{ 0 }$","+","$a_{ 1 }x$","+","$a_{ 2 }x^{ 2 }$","+","$a_{ 3 }x^{ 3 }$","+","$a_{ 4 }x^{ 4 }$","+","$a_{ 5 }x^{ 5 }$","+","$a_{ 6 }x^{ 6 }$","+","$a_{ 7 }x^{ 7 }$","+","$a_{ 8 }x^{ 8 }$","+","$a_{ 9 }x^{ 9 }$","+..")
+ termsTogether.set_color_by_tex_to_color_map({"$a_{ 0 }$":colors[0],
+ "$a_{ 1 }x$":colors[1],
+ "$a_{ 2 }x^{ 2 }$":colors[2],
+ "$a_{ 3 }x^{ 3 }$":colors[3],
+ "$a_{ 4 }x^{ 4 }$":colors[4],
+ "$a_{ 5 }x^{ 5 }$":colors[5],
+ "$a_{ 6 }x^{ 6 }$":colors[6],
+ "$a_{ 7 }x^{ 7 }$":colors[7],
+ "$a_{ 8 }x^{ 8 }$":colors[8],
+ "$a_{ 9 }x^{ 9 }$":colors[9]})
termsTogether.scale(0.8)
termsTogether.shift(2.7*UP)
self.play(ReplacementTransform(originalFormula,termsTogether))
self.wait(1)
- termMobjectRect=[0]*12
- termMobject=TextMobject(terms[0])
+ termMobjectRect=[0]*10
+ termMobject=TextMobject(terms[0]).set_color(colors[0])
termMobject.shift(2.7*UP+6.2*LEFT)
- for i in range(1,13):
+ for i in range(1,11):
termMobjectOld=termMobject
termMobjectOld.scale(0.8)
- if(i<12):
+ if(i<10):
termMobject=TextMobject(terms[i])
- termMobject.next_to(termMobjectOld)
+ termMobject.set_color(colors[i])
+ termMobject.next_to(termMobjectOld,buff=0.5)
if(i==1):
rectDefine=TextMobject("Here","each rectangle","represents the","value of the term")
rectDefine.set_color_by_tex_to_color_map({"each rectangle":BLUE,"value of the term":YELLOW})
@@ -50,7 +63,7 @@ class convergence(Scene):
self.play(ReplacementTransform(ratio,inequality))
self.wait(1)
#self.play(ApplyMethod(termMobjectOld.move_to,(2-0.3*i)*DOWN+RIGHT*0.2*i))
- termMobjectRect[i-1]=Rectangle(height=0.1,width=(5-0.4*i))
+ termMobjectRect[i-1]=Rectangle(height=0.1,width=(4.2-0.4*i),color=colors[i-1])
termMobjectRect[i-1].move_to((2-0.2*i)*DOWN+RIGHT*0.2*i)
#rectangles[p] = termMobjectRect
#p+=1
@@ -58,8 +71,8 @@ class convergence(Scene):
uparrow=TextMobject("$\\uparrow$")
uparrow.set_color(GREEN)
- uparrow.scale(6)
- uparrow.shift(4*RIGHT+0.5*DOWN)
+ uparrow.scale(5)
+ uparrow.shift(4*RIGHT+0.7*DOWN)
self.play(ShowCreation(uparrow))
self.wait(1)
@@ -72,9 +85,9 @@ class convergence(Scene):
self.play(FadeOut(converges),FadeOut(uparrow),FadeOut(inequality))
self.wait(0.5)
- rect=VGroup(termMobjectRect[0],termMobjectRect[1],termMobjectRect[2],termMobjectRect[3],termMobjectRect[4],termMobjectRect[5],termMobjectRect[6],termMobjectRect[7],termMobjectRect[8],termMobjectRect[9],termMobjectRect[10],termMobjectRect[11])
+ rect=VGroup(termMobjectRect[0],termMobjectRect[1],termMobjectRect[2],termMobjectRect[3],termMobjectRect[4],termMobjectRect[5],termMobjectRect[6],termMobjectRect[7],termMobjectRect[8],termMobjectRect[9])
self.play(ApplyMethod(rect.scale,0.2))
- for i in range(0,12):
+ for i in range(0,10):
self.play(ApplyMethod(termMobjectRect[i].shift,i*0.04*DOWN+(11-(3-0.11*i)*i)*LEFT*0.3))
func=TextMobject("$\\approx$","$f(x)$")
func.set_color_by_tex_to_color_map({"$f(x)$":RED})
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/script3.py b/FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.py
index f710f42..8680792 100644
--- a/FSF-2020/calculus/series-and-transformations/Power Series/script3.py
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.py
@@ -69,10 +69,7 @@ class graphScene(GraphScene):
eqText[i].scale(0.6)
eqText[i].set_color(BLUE)
eqText[i].shift(ORIGIN+UP*2*y_each_unit+RIGHT*3.3*x_each_unit)
- eqTextTerm=TextMobject("And so on..!")
- eqTextTerm.set_color(BLUE)
- eqTextTerm.scale(0.6)
- eqTextTerm.shift(ORIGIN+UP*2*y_each_unit+3*RIGHT*x_each_unit)
+
equation1 = self.get_graph(lambda x : 1,color = RED,x_min = -8,x_max=8)
equation2 = self.get_graph(lambda x : 1-math.pow(x,2),color = RED,x_min = -1.7,x_max=1.7)
equation3 = self.get_graph(lambda x : 1-math.pow(x,2)+math.pow(x,4),color = RED,x_min = -1.6,x_max=1.6)
@@ -106,7 +103,7 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(equation3,equation4),ReplacementTransform(eqText[2],eqText[3]))
self.wait(0.3)
self.play(FadeOut(eqText[3]))
- self.play(FadeIn(eqTextTerm))
+ #self.play(FadeIn(eqTextTerm))
self.play(Write(textBtwAnim1),Write(textBtwAnim2))
self.play(FadeIn(textBtwAnim3))
self.play(ReplacementTransform(equation4,equation5))
@@ -122,7 +119,7 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(equation9,equation10))
self.wait(1)
- self.play(FadeOut(textBtwAnim1),FadeOut(textBtwAnim2),FadeOut(textBtwAnim3),FadeOut(equation10),FadeOut(eqTextTerm))
+ self.play(FadeOut(textBtwAnim1),FadeOut(textBtwAnim2),FadeOut(textBtwAnim3),FadeOut(equation10))
self.wait(1)
convergeLine=Line(start=ORIGIN+x_each_unit*LEFT,end=ORIGIN+x_each_unit*RIGHT,color=WHITE)
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/script4.py b/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py
index 412d20c..af4bdea 100644
--- a/FSF-2020/calculus/series-and-transformations/Power Series/script4.py
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py
@@ -3,7 +3,7 @@ import math
class intro(Scene):
def construct(self):
- introText1=TextMobject("Consider the","above","example..")
+ introText1=TextMobject("Consider the example","above",)
introText1.scale(0.8)
introText1.set_color_by_tex_to_color_map({"above":YELLOW})
self.play(Write(introText1))
@@ -24,12 +24,13 @@ class graphScene(GraphScene,MovingCameraScene):
"x_labeled_nums": range(-1, 2, 1),
"y_labeled_nums": range(0,2,1),
"y_axis_height":7,
- "x_axis_width":7
+ "x_axis_width":7,
}
def setup(self):
GraphScene.setup(self)
MovingCameraScene.setup(self)
+
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
@@ -74,15 +75,14 @@ class graphScene(GraphScene,MovingCameraScene):
radiusText=TextMobject("Radius of convergence")
radiusText.scale(0.14)
radiusText.shift(ORIGIN+RIGHT*x_each_unit*0.45+DOWN*y_each_unit*0.2)
-
+ #self.activate_zooming(animate=True)
self.play(Write(radiusText))
self.wait(0.6)
self.camera_frame.save_state()
- self.camera_frame.set_width(5.5)
- self.play(self.camera_frame.move_to, ORIGIN)
+ self.play(self.camera_frame.set_width,5.5)
self.wait(1)
- self.camera_frame.set_width(14)
+ self.play(self.camera_frame.set_width,14)
self.wait(1.3)
self.play(FadeOut(radiusText),FadeOut(circle),FadeOut(movingPoint))
@@ -101,8 +101,8 @@ class graphScene(GraphScene,MovingCameraScene):
self.wait(0.6)
self.camera_frame.save_state()
- self.camera_frame.set_width(5.5)
- self.play(self.camera_frame.move_to, ORIGIN)
+ self.play(self.camera_frame.set_width,5.5)
self.wait(1)
- self.camera_frame.set_width(14)
- self.wait(1.5)
+ self.play(self.camera_frame.set_width,14)
+ self.wait(1.3)
+
diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/script5.py b/FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.py
index e9681aa..b75da59 100644
--- a/FSF-2020/calculus/series-and-transformations/Power Series/script5.py
+++ b/FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.py
@@ -3,19 +3,15 @@ import math
class uniformlyConvergent(Scene):
def construct(self):
- introText1=TextMobject("Again consider the","above","example")
introText2=TextMobject("Let","$g(x)=\\frac { 1 }{ 1+{ x }^{ 2 } }$","and","x=0.5 $\in$(-1,1)")
introText3=TextMobject("Lets analyse..","!")
- introText1.scale(0.8)
+
introText2.scale(0.7)
introText3.scale(0.9)
introText3.shift(DOWN)
- introText1.set_color_by_tex_to_color_map({"above":YELLOW})
+
introText2.set_color_by_tex_to_color_map({"$g(x)=\\frac { 1 }{ 1+{ x }^{ 2 } }$":BLUE,"x=0.5 $\in$(-1,1)":YELLOW})
introText3.set_color_by_tex_to_color_map({"!":GREEN})
- self.play(Write(introText1))
- self.wait(0.5)
- self.play(FadeOut(introText1))
self.play(Write(introText2))
self.play(FadeIn(introText3))
self.wait(2)
@@ -45,7 +41,7 @@ def makeLines(x,numPoints,x_each_unit,y_each_unit):
lines[i]=Line(start=ORIGIN+RIGHT*x_each_unit*i+UP*y_each_unit*y,end=ORIGIN+RIGHT*x_each_unit*(i+1)+UP*y_each_unit*y_next,color=RED)
return lines
-class graphScene(GraphScene,MovingCameraScene):
+class graphScene(GraphScene,ZoomedScene):
CONFIG = {
"x_min": -6,
"x_max": 6,
@@ -58,12 +54,15 @@ class graphScene(GraphScene,MovingCameraScene):
"y_axis_label": "$f(\\frac{1}{2})_k$",
"exclude_zero_label": True,
"x_axis_width":7,
- "y_axis_height":7
+ "y_axis_height":7,
+ "zoomed_camera_frame_starting_position": 0.5*UP+0.5*RIGHT,
+ "zoom_factor": 0.4,
}
def setup(self):
GraphScene.setup(self)
- MovingCameraScene.setup(self)
+
+ ZoomedScene.setup(self)
def construct(self):
@@ -87,6 +86,14 @@ class graphScene(GraphScene,MovingCameraScene):
makeSeries(0.5,points,x_each_unit,y_each_unit)
lines=makeLines(0.5,6,x_each_unit,y_each_unit)
+ func1=TextMobject("$g(x)=\\frac { 1 }{ 1+{ x }^{ 2 } }$")
+ func2=TextMobject("x=0.5 $\in$(-1,1)")
+ func1.scale(0.4)
+ func2.scale(0.4)
+ func1.shift(5.3*LEFT+3.3*UP)
+ func2.shift(5.3*LEFT+2.9*UP)
+ self.add(func1)
+ self.add(func2)
self.add(sequence)
self.add(formula)
@@ -95,22 +102,14 @@ class graphScene(GraphScene,MovingCameraScene):
self.add(fLineText)
for p in points:
self.add(p)
+ self.setup()
+ self.activate_zooming(animate=True)
for p in range(0,5):
self.play(Write(lines[p]))
- self.wait(0.5)
- self.camera_frame.save_state()
- self.camera_frame.set_width(0.6)
- self.play(self.camera_frame.move_to, points[0])
- self.wait(0.4)
- self.play(self.camera_frame.move_to, points[1])
- self.wait(0.4)
- self.play(self.camera_frame.move_to, points[2])
- self.wait(0.3)
- self.play(self.camera_frame.move_to, points[3])
- self.wait(1)
- self.play(self.camera_frame.move_to,ORIGIN)
- self.camera_frame.set_width(14)
+
+
self.wait(1)
+ self.get_zoomed_display_pop_out_animation()
explanation1=TextMobject("Since the series","converges","to")
explanation1.set_color_by_tex_to_color_map({"converges":YELLOW})
diff --git a/FSF-2020/calculus/series-and-transformations/README.md b/FSF-2020/calculus/series-and-transformations/README.md
index 4747205..0ca6397 100644
--- a/FSF-2020/calculus/series-and-transformations/README.md
+++ b/FSF-2020/calculus/series-and-transformations/README.md
@@ -4,10 +4,9 @@ GitHub Handle: <a href="https://github.com/GSri30/">GSri30</a>
Sub-Topics Covered:
<ul>
- <li>Power Series
- <li>Taylor Series
- <li>Laplace Transformation
- <li>Fourier Transformation
- <li>z-Transform
- <li>Constant-Q transform
+ <li><a href="https://math.animations.fossee.in/contents/series-and-transformations/series/taylor-series">Taylor Series</a>
+ <li><a href="https://math.animations.fossee.in/contents/series-and-transformations/series/power-series">Power Series</a>
+ <li><a href="https://math.animations.fossee.in/contents/series-and-transformations/transformations/fourier-transform">Fourier Transformation</a>
+ <li><a href="https://math.animations.fossee.in/contents/series-and-transformations/transformations/laplace-transform">Laplace Transformation</a>
+ <li><a href="https://math.animations.fossee.in/contents/series-and-transformations/transformations/z-transform">Z-Transform</a>
</ul>
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md b/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md
new file mode 100644
index 0000000..88eb772
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md
@@ -0,0 +1,11 @@
+#### Example of Taylors expansion
+![GIF1](gifs/file1_Example_TaylorExpansion.gif)
+
+#### Taylor Series GeneralForm
+![GIF2](gifs/file2a_TaylorExpansionGeneralForm.gif)
+
+#### Radius Of Convergence
+![GIF3](gifs/file3_radiusOfConvergence.gif)
+
+#### Divergence of a Remainder
+![GIF4](gifs/file4_DivergentRemainder.gif)
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf b/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
index 2096f52..46d46e1 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif
new file mode 100644
index 0000000..4272d84
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif
new file mode 100644
index 0000000..33dfa81
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif
new file mode 100644
index 0000000..33dfa81
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif
new file mode 100644
index 0000000..9e53cfb
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif
new file mode 100644
index 0000000..0bc8b65
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py
index e83eff8..a0c7176 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py
@@ -31,7 +31,7 @@ class intro(Scene):
self.wait(0.7)
self.play(FadeOut(equation),FadeOut(text))
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -45,10 +45,25 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
+ equation.scale(0.55)
+ equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
+ text=TextMobject("$a=0$")
+ text.scale(0.55)
+
+ equation.shift(3.39*UP+5*LEFT)
+ text.shift(2.9*UP+5*LEFT)
+
+ self.add(equation)
+ self.add(text)
+
generalized_eq_coeff=[]
variables_eq=[]
eq,generalized_eq_coeff=formFormula(generalized_eq_coeff,variables_eq)
@@ -58,7 +73,7 @@ class graphScene(GraphScene):
trTextGrup.scale(0.5)
trTextGrup.to_corner(UP+RIGHT)
self.play(Write(trTextGrup))
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
fx=TextMobject("${ e }^{ -x^{ 2 } }$")
fx.scale(0.5)
@@ -66,18 +81,20 @@ class graphScene(GraphScene):
mainfunction=self.get_graph(lambda x:math.exp(-1*pow(x,2)),color=RED,x_min=-8,x_max=8)
self.play(ShowCreation(mainfunction))
self.play(FadeIn(fx))
- self.wait(1.4)
+ self.wait(1)
coeff=[TextMobject("$1$"),TextMobject("$f'(x)$"),TextMobject("$\\frac { f''(x) }{ 2! } $")]
coeff[0].shift(3.39*UP+4.88*RIGHT)
coeff[0].scale(0.5)
- coeff[1].shift(3.39*UP+5.3*RIGHT)
+ coeff[1].shift(3.39*UP+5.4*RIGHT)
coeff[1].scale(0.275)
- coeff[2].shift(3.39*UP+5.98*RIGHT)
+ coeff[2].shift(3.39*UP+6*RIGHT)
coeff[2].scale(0.28)
for obj in coeff:
obj.set_color(GOLD_A)
+ group=VGroup(coeff[0],coeff[1],coeff[2])
+
firstApprox=[self.get_graph(lambda x:1,color=BLUE)]
secondApprox=[self.get_graph(lambda x:1,color=BLUE),
@@ -124,16 +141,37 @@ class graphScene(GraphScene):
bottomText8.scale(0.5)
bottomText1.shift(4.5*RIGHT+2.5*DOWN)
- bottomText2.shift(4.5*RIGHT+2.5*DOWN)
- bottomText3.shift(4.5*RIGHT+2.5*DOWN)
- bottomText4.shift(4.5*RIGHT+2.5*DOWN)
- bottomText5.shift(4.5*RIGHT+2.5*DOWN)
- bottomText6.shift(4.5*RIGHT+2.5*DOWN)
- bottomText7.shift(4.5*RIGHT+2.5*DOWN)
- bottomText8.shift(4.5*RIGHT+2.5*DOWN)
+ bottomText2.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText3.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText4.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText5.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText6.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText7.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText8.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+
+ bottomText2.scale(0.7)
+ bottomText3.scale(0.7)
+ bottomText4.scale(0.7)
+ bottomText5.scale(0.7)
+ bottomText6.scale(0.7)
+ bottomText7.scale(0.7)
+ bottomText8.scale(0.7)
self.play(Write(bottomText1))
- self.wait(1)
+ self.wait(0.8)
+ #self.activate_zooming(animate=True)
+ self.camera_frame.save_state()
+ group.move_to(4*y_each_unit*UP+4.6*RIGHT*x_each_unit).scale(0.7)
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, x_each_unit*UP,
+ ApplyMethod(trTextGrup.move_to,4*y_each_unit*UP+4.1*RIGHT*x_each_unit),
+ ApplyMethod(bottomText1.move_to,3.4*RIGHT*x_each_unit+2.5*DOWN*y_each_unit),
+ ApplyMethod(equation.shift,1.39*DOWN+2*RIGHT),
+ ApplyMethod(text.shift,1.39*DOWN+2*RIGHT),)
+ self.play(ApplyMethod(text.scale,0.5),ApplyMethod(equation.scale,0.5),ApplyMethod(bottomText1.scale,0.6),ApplyMethod(trTextGrup.scale,0.7))
+ self.play(ApplyMethod(text.shift,0.3*UP))
+ self.wait(0.6)
+
self.play(ShowCreation(firstApprox[0]),ReplacementTransform(bottomText1,bottomText2))
#change coeff in tn(x)
self.play(ReplacementTransform(generalized_eq_coeff[0],coeff[0]))
@@ -170,10 +208,12 @@ class graphScene(GraphScene):
self.wait(2)
textFinal=TextMobject("And so on..!")
- textFinal.scale(0.7)
- textFinal.shift(4.5*RIGHT+2.5*DOWN)
+ textFinal.scale(0.35)
+ textFinal.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
self.play(ReplacementTransform(bottomText8,textFinal))
- self.wait(2.5)
+ self.wait(1)
+ self.play(FadeOut(equation),FadeOut(text))
+ self.play(self.camera_frame.set_width, 15)
finalFormula=TextMobject("Hence","$T_{ n }(x)$","=","$f(0)+f'(0)x+\\frac { f''(0) }{ 2! }x^2+..+\\frac { { f }^{ n }(0) }{ n! } { x }^{ n }$")
finalFormula.scale(0.8)
@@ -182,16 +222,7 @@ class graphScene(GraphScene):
self.play(FadeOut(self.axes),FadeOut(textFinal),FadeOut(secondGraph),FadeOut(trTextGrup),FadeOut(mainfunction),FadeOut(fx),FadeOut(coeff[0]),FadeOut(coeff[1]),FadeOut(coeff[2]))
self.play(Write(finalFormula))
self.wait(2)
- # self.play(ReplacementTransform(secondApprox[2],secondApprox[3]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[3],secondApprox[4]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[4],secondApprox[5]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[0],secondApprox[0]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[0],secondApprox[0]))
- # self.wait(0.5)
+
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py
index b5d0a53..5be336b 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py
@@ -7,7 +7,7 @@ class intro(Scene):
equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
equation.scale(2)
equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
- text=TextMobject("at $a=1$")
+ text=TextMobject("about $x=1$")
text.scale(0.7)
text.shift(DOWN)
@@ -41,7 +41,7 @@ def formFormula(coeff_list,variable_list):
return expansion,coeff_list
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -55,10 +55,25 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
+ equation.scale(0.55)
+ equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
+ text=TextMobject("about $x=1$")
+ text.scale(0.55)
+ equation.shift(3.39*UP+5*LEFT)
+ text.shift(3*UP+5*LEFT)
+
+ self.add(equation)
+ self.add(text)
+
+
generalized_eq_coeff=[]
variables_eq=[]
eq,generalized_eq_coeff=formFormula(generalized_eq_coeff,variables_eq)
@@ -68,7 +83,7 @@ class graphScene(GraphScene):
trTextGrup.scale(0.5)
trTextGrup.to_corner(UP+RIGHT)
self.play(Write(trTextGrup))
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
fx=TextMobject("${ e }^{ -x^{ 2 } }$")
fx.scale(0.5)
@@ -79,29 +94,29 @@ class graphScene(GraphScene):
self.wait(1.4)
coeff=[TextMobject("$e^{-1}$"),TextMobject("$f'(x)$"),TextMobject("$\\frac { f''(x) }{ 2! } $")]
- coeff[0].shift(3.33*UP+3.65*RIGHT)
- coeff[0].scale(0.45)
- coeff[1].shift(3.33*UP+4.13*RIGHT)
- coeff[1].scale(0.275)
- coeff[2].shift(3.33*UP+5.36*RIGHT)
- coeff[2].scale(0.28)
+ coeff[0].shift(4.1*y_each_unit*UP+5.15*RIGHT*x_each_unit)
+ coeff[0].scale(0.3)
+ coeff[1].shift(4*y_each_unit*UP+5.7*RIGHT*x_each_unit)
+ coeff[1].scale(0.2)
+ coeff[2].shift(4*y_each_unit*UP+7.3*RIGHT*x_each_unit)
+ coeff[2].scale(0.18)
for obj in coeff:
obj.set_color(GOLD_A)
- firstApprox=[self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)]
- secondApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5),
- self.get_graph(lambda x:math.exp(-1)+3*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5),
- self.get_graph(lambda x:math.exp(-1)-4*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)]
- thirdApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-0.1*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+0.5*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5)]
+ firstApprox=[self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-3,x_max=4)]
+ secondApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4),
+ self.get_graph(lambda x:math.exp(-1)+3*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4),
+ self.get_graph(lambda x:math.exp(-1)-4*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4)]
+ thirdApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-0.1*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+0.5*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3)]
- firstGraph=self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)
- secondGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)
- thirdGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5)
+ firstGraph=self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-3,x_max=4)
+ secondGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4)
+ thirdGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3)
bottomText1=TextMobject("Apply","$f(1)=T_{n}(1)$")
bottomText2=TextMobject("This gives","$a_{ 0 }=e^{-1}$")
@@ -135,16 +150,35 @@ class graphScene(GraphScene):
bottomText8.scale(0.5)
bottomText1.shift(4.5*RIGHT+2.5*DOWN)
- bottomText2.shift(4.5*RIGHT+2.5*DOWN)
- bottomText3.shift(4.5*RIGHT+2.5*DOWN)
- bottomText4.shift(4.5*RIGHT+2.5*DOWN)
- bottomText5.shift(4.5*RIGHT+2.5*DOWN)
- bottomText6.shift(4.5*RIGHT+2.5*DOWN)
- bottomText7.shift(4.5*RIGHT+2.5*DOWN)
- bottomText8.shift(4.5*RIGHT+2.5*DOWN)
+ bottomText2.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText3.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText4.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText5.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText6.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText7.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText8.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+
+ bottomText2.scale(0.7)
+ bottomText3.scale(0.7)
+ bottomText4.scale(0.7)
+ bottomText5.scale(0.7)
+ bottomText6.scale(0.7)
+ bottomText7.scale(0.7)
+ bottomText8.scale(0.7)
self.play(Write(bottomText1))
- self.wait(1)
+ self.wait(0.8)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, x_each_unit*UP+x_each_unit*2*RIGHT,
+ ApplyMethod(trTextGrup.move_to,4*y_each_unit*UP+6.1*RIGHT*x_each_unit),
+ ApplyMethod(bottomText1.move_to,5.4*RIGHT*x_each_unit+2.5*DOWN*y_each_unit),
+ ApplyMethod(equation.shift,1.39*DOWN+2*RIGHT+RIGHT*x_each_unit*2),
+ ApplyMethod(text.shift,1.39*DOWN+2*RIGHT+RIGHT*x_each_unit*2),)
+ self.play(ApplyMethod(text.scale,0.5),ApplyMethod(equation.scale,0.5),ApplyMethod(bottomText1.scale,0.6),ApplyMethod(trTextGrup.scale,0.7))
+ self.play(ApplyMethod(text.shift,0.25*UP))
+ self.wait(0.6)
+
self.play(ShowCreation(firstApprox[0]),ReplacementTransform(bottomText1,bottomText2))
#change coeff in tn(x)
self.play(ReplacementTransform(generalized_eq_coeff[0],coeff[0]))
@@ -154,8 +188,6 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(firstApprox[0],secondApprox[1]))
self.wait(0.5)
self.play(ReplacementTransform(secondApprox[1],secondApprox[2]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[2],secondApprox[0]))
self.wait(1)
self.play(ReplacementTransform(bottomText3,bottomText4),FadeOut(secondApprox[2]))
self.wait(1)
@@ -167,8 +199,6 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(secondGraph,thirdApprox[0]))
self.wait(0.6)
self.play(ReplacementTransform(thirdApprox[0],thirdApprox[1]))
- # self.wait(0.6)
- # self.play(ReplacementTransform(thirdApprox[1],thirdApprox[2]))
self.wait(0.6)
self.play(ReplacementTransform(thirdApprox[1],thirdApprox[3]))
self.wait(0.6)
@@ -181,10 +211,13 @@ class graphScene(GraphScene):
self.wait(2)
textFinal=TextMobject("And so on..!")
- textFinal.scale(0.7)
- textFinal.shift(4.5*RIGHT+2.5*DOWN)
+ textFinal.scale(0.35)
+ textFinal.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
self.play(ReplacementTransform(bottomText8,textFinal))
- self.wait(2.5)
+ self.wait(1)
+ self.play(FadeOut(equation),FadeOut(text))
+ self.play(self.camera_frame.set_width, 15,
+ self.camera_frame.move_to, 0)
finalFormula=TextMobject("Hence","$T_{ n }(x)$","=","$f(1)+f'(1)(x-1)+\\frac { f''(1) }{ 2! }(x-1)^2+..+\\frac { { f }^{ n }(1) }{ n! } { (x-1) }^{ n }$")
finalFormula.scale(0.8)
@@ -192,4 +225,4 @@ class graphScene(GraphScene):
self.play(FadeOut(self.axes),FadeOut(textFinal),FadeOut(thirdGraph),FadeOut(trTextGrup),FadeOut(mainfunction),FadeOut(fx),FadeOut(coeff[0]),FadeOut(coeff[1]),FadeOut(coeff[2]))
self.play(Write(finalFormula))
- self.wait(2) \ No newline at end of file
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py
index a2870d4..52f07bb 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py
@@ -2,7 +2,7 @@ from manimlib.imports import*
import math
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -16,12 +16,15 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
lnx=self.get_graph(lambda x:math.log2(x),color=RED,x_min=0.01,x_max=8)
@@ -98,14 +101,23 @@ class graphScene(GraphScene):
circle=Circle(radius=ORIGIN+x_each_unit*2,color=PURPLE_E)
circle.shift(ORIGIN+RIGHT*x_each_unit*2)
- radiusLine=Line(start=ORIGIN+x_each_unit*RIGHT*2,end=ORIGIN+x_each_unit*4*RIGHT,color=PURPLE_E)
+ radiusLine=Line(start=ORIGIN+x_each_unit*RIGHT*2,end=ORIGIN+x_each_unit*2*RIGHT+y_each_unit*3*UP,color=PURPLE_E)
radius=TextMobject("$R$")
radius.set_color(RED)
radius.scale(0.5)
- radius.shift(ORIGIN+RIGHT*x_each_unit*2.45+DOWN*y_each_unit*0.6)
+ radius.shift(ORIGIN+RIGHT*x_each_unit*2.45+UP*y_each_unit*2.2)
+ rText=TextMobject("R",":","Radius of Convergence").scale(0.3).shift(x_each_unit*RIGHT*2+UP*y_each_unit*3.3).set_color_by_tex_to_color_map({"R":RED,"Radius of Convergence":YELLOW})
self.play(FadeOut(equations[6]),Write(circle))
self.wait(0.6)
self.play(Write(radiusLine))
self.play(FadeIn(radius))
- self.wait(2) \ No newline at end of file
+ self.wait(0.7)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, y_each_unit*UP+x_each_unit*2*RIGHT)
+ self.play(Write(rText))
+ self.wait(1)
+ self.play(self.camera_frame.set_width, 15,
+ self.camera_frame.move_to,0)
+ self.wait(2) \ No newline at end of file
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py
index 1f41c97..6b368da 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py
@@ -43,7 +43,6 @@ class graphScene(GraphScene):
bottomText1=TextMobject("$R_{n}(x)=\\frac { d }{ dx } ($","area bounded","$)$")
bottomText1.set_color_by_tex_to_color_map({"area bounded":ORANGE})
- #bottomText2.set_color_by_tex_to_color_map({"area bounded":BLUE})
arrow=TextMobject("$\downarrow$")
arrow.scale(2.5)
arrow.shift(ORIGIN+x_each_unit*RIGHT*9.5+UP*y_each_unit)
@@ -56,12 +55,8 @@ class graphScene(GraphScene):
increasingText.scale(0.4)
bottomText1.scale(0.5)
- #bottomText2.scale(0.5)
- #bottomText3.scale(0.5)
bottomText1.shift(3.5*LEFT+2*DOWN)
- #bottomText2.shift(3.5*LEFT+2.4*DOWN)
- #bottomText3.shift(3.5*LEFT+2.8*DOWN)
dline=DashedLine(start=ORIGIN+8*y_each_unit*UP,end=ORIGIN+8*y_each_unit*DOWN)
dline.shift(ORIGIN+x_each_unit*4*RIGHT)
@@ -72,11 +67,9 @@ class graphScene(GraphScene):
self.play(Write(dline))
self.wait(0.5)
self.play(ShowCreation(area1),ShowCreation(area2),Write(bottomText1))
- # self.play(Write(bottomText2))
- # self.play(FadeIn(bottomText3))
self.play(Write(arrow))
self.wait(0.7)
self.play(Write(increasingText))
self.play(FadeIn(followupText))
self.wait(2)
- \ No newline at end of file
+
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/README.md b/FSF-2020/calculus/series-and-transformations/Z-Transform/README.md
new file mode 100644
index 0000000..c626bdf
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/README.md
@@ -0,0 +1,9 @@
+#### Sampling
+![GIF1](gifs/file1.gif)
+
+#### Z Transform of a delta function
+![GIF2](gifs/file2.gif)
+
+#### Region of convergence
+![GIF3](gifs/file3.gif)
+
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file1.gif b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file1.gif
new file mode 100644
index 0000000..d21aa59
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file1.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file2.gif b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file2.gif
new file mode 100644
index 0000000..203be8d
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file2.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file3.gif b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file3.gif
new file mode 100644
index 0000000..0f100f1
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/gifs/file3.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/video1_Sampling.py b/FSF-2020/calculus/series-and-transformations/Z-Transform/video1_Sampling.py
new file mode 100644
index 0000000..47615e3
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/video1_Sampling.py
@@ -0,0 +1,81 @@
+from manimlib.imports import *
+import math
+
+def func(x):
+ return math.pow(x,3)-2*math.pow(x,2)-x+3
+
+class graphScene(GraphScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 3,
+ "y_min": -4,
+ "y_max": 4,
+ "x_tick_frequency": 0.2,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$f(t)$",
+ "exclude_zero_label": True,
+ "x_labeled_nums": range(-3, 4, 1),
+ "y_axis_height": 5,
+ "x_axis_width": 9,
+ }
+
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ fx=TextMobject("$f(t) = { t }^{ 3 }{ -2t }^{ 2 }-t+3$").set_color(RED).to_corner(UP+RIGHT).scale(0.4)
+ self.setup_axes(animate=True,scalee=1)
+ function=self.get_graph(lambda x:math.pow(x,3)-2*math.pow(x,2)-x+3,color=RED,x_min=-1,x_max=2)
+ functionArea=self.get_riemann_rectangles(function,x_min=-1,x_max=2,dx=0.01,start_color=GREEN,end_color=YELLOW,stroke_color=GREEN,fill_opacity=0.8)
+ functionDot=Dot(point=self.graph_origin,radius=0.065,color=WHITE)
+ aboveText1=TextMobject("Continuous","Time Function").shift(4*RIGHT+2*UP).scale(0.4).set_color_by_tex_to_color_map({"Continuous":YELLOW,"Time Function":BLUE})
+ aboveText2=TextMobject("Discrete","Time Function").shift(4*RIGHT+2*UP).scale(0.4).set_color_by_tex_to_color_map({"Time Function":BLUE,"Discrete":YELLOW})
+
+ bottomText1=TextMobject("Instead of considering the","function","over the","entire $t$,").shift(4.5*RIGHT+3*DOWN).scale(0.4).set_color_by_tex_to_color_map({"entire $t$,":RED,"function":YELLOW})
+ bottomText2=TextMobject("We consider only at","certain $t$").shift(4.5*RIGHT+3*DOWN).scale(0.4).set_color_by_tex_to_color_map({"certain $t$":RED})
+
+ self.play(ShowCreation(function),Write(fx),FadeIn(aboveText1))
+ self.wait(0.7)
+ self.play(Write(bottomText1))
+ self.play(ShowCreation(functionArea),MoveAlongPath(functionDot,function))
+ self.wait(0.7)
+ self.play(FadeOut(bottomText1))
+ self.play(Write(bottomText2),FadeOut(aboveText1))
+
+ dots=[Dot(radius=0.05) for i in range(10)]
+ dotShifts=[-1,-0.7,-0.4,0,0.3,0.6,1,1.3,1.6,2]
+ lines=[]
+ for x in dotShifts:
+ lines.append(Line(start=(x*x_each_unit,func(x)*y_each_unit,0),end=(x*x_each_unit,0,0),color=GREEN))
+ for i in range(10):
+ dots[i].shift(ORIGIN+RIGHT*x_each_unit*dotShifts[i]+y_each_unit*UP*func(dotShifts[i]))
+ updatedGraph=VGroup(dots[0],
+ dots[1],
+ dots[2],
+ dots[3],
+ dots[4],
+ dots[5],
+ dots[6],
+ dots[7],
+ dots[8],
+ dots[9])
+ updatedGraph1=VGroup(
+ lines[0],
+ lines[1],
+ lines[2],
+ lines[3],
+ lines[4],
+ lines[5],
+ lines[6],
+ lines[7],
+ lines[8],
+ lines[9])
+
+ self.play(FadeOut(functionDot))
+ self.play(FadeOut(function),FadeIn(updatedGraph))
+ self.play(FadeOut(functionArea),FadeIn(updatedGraph1))
+ self.play(FadeOut(bottomText2),FadeIn(aboveText2))
+ self.wait(2) \ No newline at end of file
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/video2_ZTransformOfDelta.py b/FSF-2020/calculus/series-and-transformations/Z-Transform/video2_ZTransformOfDelta.py
new file mode 100644
index 0000000..3063aa6
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/video2_ZTransformOfDelta.py
@@ -0,0 +1,121 @@
+from manimlib.imports import *
+import numpy as np
+import math
+
+class deltaTransformation(GraphScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 3,
+ "y_min": -5,
+ "y_max": 5,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$t$",
+ "y_axis_label": "$f(t)$",
+ "x_labeled_nums": range(-3, 4, 1),
+ # "y_axis_height": 4,
+ # "x_axis_width": 6,
+ }
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ self.setup_axes(animate=True,scalee=0.8)
+ function=TextMobject("$f(t) = 2{ \delta }_{ 0 }(t)+3{ \delta }_{ 1 }(t)+4{ \delta }_{ 2 }(t)$").scale(0.4).shift(5*RIGHT+3*UP).set_color(RED)
+ self.play(FadeIn(function))
+ twoDGraph=[
+ Line(start=(0,0,0),end=(0,2*y_each_unit,0),color=GREEN),
+ Line(start=(1*x_each_unit,0,0),end=(x_each_unit,3*y_each_unit,0),color=GREEN),
+ Line(start=(2*x_each_unit,0,0),end=(2*x_each_unit,4*y_each_unit,0),color=GREEN)
+ ]
+ groupGraph=VGroup(twoDGraph[1],twoDGraph[2],self.axes,twoDGraph[0])
+ self.play(Write(twoDGraph[0]),ShowCreation(twoDGraph[1]),ShowCreation(twoDGraph[2]))
+ self.wait(1.2)
+ self.play(ApplyMethod(groupGraph.scale,0.7))
+ self.play(ApplyMethod(groupGraph.shift,5*LEFT),ApplyMethod(function.move_to,5*LEFT+3*UP))
+ self.graph_origin=2*RIGHT+2.5*DOWN
+ self.x_axis_width=6
+ self.x_axis_label="$|z|$"
+ self.y_axis_label="$|F(t)|$"
+ self.x_min=-3
+ self.x_max=6
+ self.y_min=-1
+ self.y_max=7
+ self.x_labeled_nums=range(-3,7,1)
+ self.setup_axes(animate=True,scalee=0.6)
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ rightSideGraphs=[
+ self.get_graph(lambda x:2,x_min=0,x_max=6,color=GREEN),
+ self.get_graph(lambda x:2+3/x,x_min=0.6,x_max=6,color=GREEN),
+ self.get_graph(lambda x:2+(3/x)+(4/x**2),x_min=1.24,x_max=6,color=GREEN)
+ ]
+ graphCoeff=[
+ TextMobject("$2$").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit*2+DOWN*y_each_unit*0.5).set_color(RED),
+ TextMobject("$2+\\frac { 3 }{ |z| }$").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*3+UP*y_each_unit*2).set_color(RED),
+ TextMobject("$2+\\frac { 3 }{ |z| } +\\frac { 4 }{ { |z| }^{ 2 } } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*3.5+UP*y_each_unit*2).set_color(RED)
+ ]
+ self.play(ReplacementTransform(twoDGraph[0],rightSideGraphs[0]),FadeIn(graphCoeff[0]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[0]),ReplacementTransform(twoDGraph[1],rightSideGraphs[1]),ReplacementTransform(graphCoeff[0],graphCoeff[1]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[1]),ReplacementTransform(twoDGraph[2],rightSideGraphs[2]),ReplacementTransform(graphCoeff[1],graphCoeff[2]))
+
+ self.wait(2)
+
+
+class graphCont(GraphScene,MovingCameraScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 6,
+ "y_min": -1,
+ "y_max": 7,
+ "graph_origin": 2*RIGHT+2.5*DOWN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$|z|$",
+ "y_axis_label": "$|F(t)|$",
+ "exclude_zero_label": True,
+ "x_labeled_nums": range(-3, 7, 1),
+ "x_axis_width": 6,
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ coeff=TextMobject("$2+\\frac { 3 }{ |z| } +\\frac { 4 }{ { |z| }^{ 2 } } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*3.5+UP*y_each_unit*2).set_color(RED)
+ self.setup_axes(scalee=0.6)
+ graph=self.get_graph(lambda x:2+(3/x)+(4/x**2),x_min=1.24,x_max=6,color=GREEN)
+ xAxis=self.get_graph(lambda x:0,x_min=1.24,x_max=6).shift(3*LEFT)
+ self.add(graph)
+ self.add(coeff)
+ self.play(ApplyMethod((self.axes).shift,3*LEFT),ApplyMethod(coeff.shift,3*LEFT),ApplyMethod(graph.shift,3*LEFT))
+ topText=TextMobject("Here we get","output","for","any value of $|z|$").scale(0.4).shift(3*UP+3*RIGHT).set_color_by_tex_to_color_map({"output":YELLOW,"any value of $|z|$":BLUE})
+ topText1=TextMobject("Except for $|z|=0$").scale(0.7).shift(2.5*UP+3*RIGHT).set_color(RED)
+ dot1=Dot(color=WHITE,radius=0.06)
+ dot2=Dot(color=WHITE,radius=0.06)
+ self.play(Write(topText))
+ self.play(MoveAlongPath(dot1,graph),MoveAlongPath(dot2,xAxis),run_time=2)
+ self.play(Write(topText1))
+ self.play(FadeOut(dot1),FadeOut(dot2))
+ self.wait(0.5)
+ path=self.get_graph(lambda x:2+(3/x)+(4/x**2),x_min=1.24,x_max=0.8)
+ path1=self.get_graph(lambda x:0,x_min=1.24,x_max=0.8)
+ graphUpdated=self.get_graph(lambda x:2+(3/x)+(4/x**2),x_min=0.8,x_max=6,color=GREEN)
+ self.camera_frame.save_state()
+ self.play(FadeOut(graph),Write(graphUpdated))
+ self.play(self.camera_frame.set_width, 30,
+ MoveAlongPath(dot1,path),MoveAlongPath(dot2,path1),run_time=2)
+ self.wait(1)
+
+ self.play(FadeOut(dot1),FadeOut(dot2),FadeOut(graphUpdated),FadeIn(graph),self.camera_frame.set_width,15)
+ self.wait(1)
+
+
+
+
+
diff --git a/FSF-2020/calculus/series-and-transformations/Z-Transform/video3_RegionOfConvergence.py b/FSF-2020/calculus/series-and-transformations/Z-Transform/video3_RegionOfConvergence.py
new file mode 100644
index 0000000..bdfd8b3
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Z-Transform/video3_RegionOfConvergence.py
@@ -0,0 +1,144 @@
+from manimlib.imports import *
+import numpy as np
+import math
+
+class graph1(GraphScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 5,
+ "y_min": -1,
+ "y_max": 1,
+ "graph_origin": ORIGIN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$n$",
+ "y_axis_label": "$x(n)$",
+ "x_labeled_nums": range(-3, 6, 1),
+ "y_axis_height": 7,
+ "y_tick_frequency": 0.1,
+ }
+ def func(self,x,n):
+ summ=0
+ for i in range(n+1):
+ summ+=(1/(math.pow(x,i)))
+ return summ
+
+ def finalFunc(self,x):
+ if(x!=0):
+ return 1/(1-(1/(2*x)))
+
+
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ self.setup_axes(animate=True,scalee=0.8)
+ function=TextMobject("$X(t)=\sum _{ n=0 }^{ \infty }{ { (0.5) }^{ n }{ z }^{ -n } }$").scale(0.4).shift(5*RIGHT+3*UP).set_color(RED)
+ self.play(FadeIn(function))
+ twoDGraph=[]
+ for i in range(5):
+ twoDGraph.append(Line(start=(i*x_each_unit,0,0),end=(i*x_each_unit,math.pow(0.5,i)*y_each_unit,0),color=GREEN))
+
+ groupGraph=VGroup(self.axes,twoDGraph[0],twoDGraph[1],twoDGraph[2],twoDGraph[3],twoDGraph[4])
+ self.play(Write(twoDGraph[0]),ShowCreation(twoDGraph[1]),ShowCreation(twoDGraph[2]),ShowCreation(twoDGraph[3]),ShowCreation(twoDGraph[4]))
+ self.wait(1.2)
+
+ self.play(ApplyMethod(groupGraph.scale,0.7))
+ self.play(ApplyMethod(groupGraph.shift,6*LEFT),ApplyMethod(function.move_to,5*LEFT+3*UP))
+
+ someText1=TextMobject("Since it is a","summation","of","infinite terms",", it might").shift(2*RIGHT+2*UP).scale(0.5).set_color_by_tex_to_color_map({"summation":YELLOW,"infinite terms":BLUE})
+ someText2=TextMobject("Converge","or","Diverge").shift(2*RIGHT+0.5*DOWN+2*UP).scale(0.7).set_color_by_tex_to_color_map({"Converge":GREEN,"Diverge":RED})
+ someText3=TextMobject("depending upon","$|z|$").shift(2*RIGHT+UP).scale(0.5).set_color_by_tex_to_color_map({"$|z|$":YELLOW})
+ self.play(Write(someText1))
+ self.play(FadeIn(someText2))
+ self.play(Write(someText3))
+ self.wait(1)
+ self.play(FadeOut(someText1),FadeOut(someText2),FadeOut(someText3))
+
+ self.graph_origin=2*RIGHT+DOWN
+ self.x_axis_width=6
+ self.y_axis_height=5
+ self.y_tick_frequency=1
+ self.x_axis_label="$|z|$"
+ self.y_axis_label="$|X(n)|$"
+ self.x_min=-3
+ self.x_max=5
+ self.y_min=-1
+ self.y_max=5
+ self.x_labeled_nums=range(-3,6,1)
+ self.setup_axes(animate=True,scalee=0.6)
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ rightSideGraphs=[]
+ xmins=[0,0.25,0.65,0.9,1]
+ for i in range(5):
+ rightSideGraphs.append(self.get_graph(lambda x:self.func(x,i),x_min=xmins[i],x_max=5,color=GREEN))
+ rightSideGraphs.append(self.get_graph(lambda x:1/(1-(1/(2*x))),x_min=0.63,x_max=5,color=GREEN))
+
+ graphCoeff=[
+ TextMobject("$1$").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+0.65*UP*y_each_unit*2+DOWN*y_each_unit*0.5).set_color(RED),
+ TextMobject("$1+\\frac { 1 }{ 2|z| }$").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED),
+ TextMobject("$1+\\frac { 1 }{ 2|z| } +\\frac { 1 }{ { 2|z| }^{ 2 } } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED),
+ TextMobject("$1+\\frac { 1 }{ 2|z| } +\\frac { 1 }{ { (2|z|) }^{ 2 } } +\\frac { 1 }{ { (2|z|) }^{ 3 } }$").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED),
+ TextMobject("$1+\\frac { 1 }{ 2|z| } +\\frac { 1 }{ { (2|z|) }^{ 2 } } +\\frac { 1 }{ { (2|z|) }^{ 3 } } +\\frac { 1 }{ (2|z|)^{ 4 } } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED),
+ TextMobject("$\\frac { 1 }{ (1-\\frac { 1 }{ 2z } ) } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED)
+ ]
+
+ self.play(ReplacementTransform(twoDGraph[0],rightSideGraphs[0]),FadeIn(graphCoeff[0]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[0]),ReplacementTransform(twoDGraph[1],rightSideGraphs[1]),ReplacementTransform(graphCoeff[0],graphCoeff[1]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[1]),ReplacementTransform(twoDGraph[2],rightSideGraphs[2]),ReplacementTransform(graphCoeff[1],graphCoeff[2]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[2]),ReplacementTransform(twoDGraph[3],rightSideGraphs[3]),ReplacementTransform(graphCoeff[2],graphCoeff[3]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[3]),ReplacementTransform(twoDGraph[4],rightSideGraphs[4]),ReplacementTransform(graphCoeff[3],graphCoeff[4]))
+ self.wait(0.5)
+ self.play(FadeOut(rightSideGraphs[4]),ShowCreation(rightSideGraphs[5]),ReplacementTransform(graphCoeff[4],graphCoeff[5]))
+
+ self.wait(2)
+ # #self.play(FadeOut(self.axes),FadeOut(function),FadeOut(twoDGraph[0]),FadeOut(twoDGraph[1]),FadeOut(twoDGraph[2]))
+
+
+class graphCont(GraphScene,MovingCameraScene):
+ CONFIG = {
+ "x_min": -3,
+ "x_max": 5,
+ "y_min": -1,
+ "y_max": 5,
+ "graph_origin": 2*RIGHT+DOWN,
+ "function_color": RED,
+ "axes_color": BLUE,
+ "x_axis_label": "$|z|$",
+ "y_axis_label": "$|X(n)|$",
+ "x_labeled_nums": range(-3, 6, 1),
+ "x_axis_width": 6,
+ "y_axis_height": 5
+ }
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
+
+ def construct(self):
+ x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
+ y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+
+ coeff=TextMobject("$\\frac { 1 }{ (1-\\frac { 1 }{ 2z } ) } $").scale(0.4).shift(self.graph_origin+x_each_unit*RIGHT*2+UP*y_each_unit).set_color(RED)
+ self.setup_axes(scalee=0.6)
+ graph=self.get_graph(lambda x:1/(1-(1/(2*x))),x_min=0.63,x_max=5,color=GREEN)
+
+ self.add(graph)
+ self.add(coeff)
+
+ self.play(ApplyMethod((self.axes).shift,3*LEFT),ApplyMethod(coeff.shift,3*LEFT),ApplyMethod(graph.shift,3*LEFT))
+ self.wait(1)
+
+ dashLine=DashedLine(start=self.graph_origin+3*LEFT+0.5*x_each_unit*RIGHT,end=self.graph_origin+3*LEFT+0.5*x_each_unit*RIGHT+y_each_unit*UP*5,color=YELLOW)
+ pt=TextMobject("0.5").scale(0.3).shift(self.graph_origin+3*LEFT+0.5*x_each_unit*RIGHT+DOWN*y_each_unit*0.3)
+ self.play(Write(dashLine))
+ self.play(Write(pt))
+ self.wait(0.6)
+ rectRegion=Rectangle(height=y_each_unit*5,width=x_each_unit*5,fill_color=WHITE,fill_opacity=0.3,opacity=0.3,color=BLACK).shift(1.6*RIGHT*x_each_unit+0.5*DOWN*y_each_unit+1.5*UP)
+ self.play(ShowCreation(rectRegion))
+ text=TextMobject("Region Of Convergence!").scale(0.4).shift(4.6*RIGHT+1.5*UP).set_color(GREEN)
+ self.play(FadeIn(text))
+ self.wait(2)