diff options
Diffstat (limited to 'FSF-2020/calculus/series-and-transformations')
20 files changed, 116 insertions, 166 deletions
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md b/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md index c5d8389..2fa4e04 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/README.md @@ -7,9 +7,12 @@ ### Applying the same on Graphs  -### Fourier series for non-periodic functions +### Fourier series for non-periodic functions-a  +### Fourier series for non-periodic functions-b + + ### Fourier Series of Square pulse  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 Binary files differindex 533368b..de94810 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gif +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file3.gif 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 Binary files differnew file mode 100644 index 0000000..de94810 --- /dev/null +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file6.gif 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 Binary files differnew file mode 100644 index 0000000..ab4eed8 --- /dev/null +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/gifs/file7.gif 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 index 39db6d8..fdb8719 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py @@ -1,13 +1,6 @@ from manimlib.imports import* import numpy as np -# def func(t,n): -# s=0 -# for i in range(1,n+1): -# s+=((-2/(i*np.pi))*((-1)**i)*np.sin(2*np.pi*i*t)) -# return s - - class intro(GraphScene): CONFIG = { "x_min": -3, 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 index 8f3706b..c87e58e 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py @@ -101,27 +101,27 @@ class divideColors(GraphScene): 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.y_axis_label="$\\frac { 2 }{ \pi } sin(2\pi t)$" + 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.y_axis_label="$\\frac { -1 }{ \pi } sin(4\pi t)$" + 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.y_axis_label="$\\frac { 2 }{ 3\pi } sin(6\pi t)$" + 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.y_axis_label="$\\frac { -1 }{ 2\pi } sin(8\pi t)$" + 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.y_axis_label="$\\frac { 2 }{ 5\pi } sin(10\pi t)$" + 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.y_axis_label="$\\frac { -1 }{ 3\pi } sin(12\pi t)$" + 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) @@ -132,9 +132,7 @@ class divideColors(GraphScene): self.play(ShowCreation(graphs[0])) self.play(Write(coeff[0])) self.wait(1) - # self.play(ApplyMethod(axes[0].scale,0.4),ApplyMethod(graphs[0].scale,0.4),ApplyMethod(axes[1].scale,0.4), - # ApplyMethod(axes[2].scale,0.4),ApplyMethod(axes[3].scale,0.4), - # ApplyMethod(axes[4].scale,0.4),ApplyMethod(axes[5].scale,0.4),ApplyMethod(axes[6].scale,0.4)) + 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])) @@ -142,24 +140,7 @@ class divideColors(GraphScene): 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.play(ReplacementTransform(graphs[0],graphs[1]),ApplyMethod(groups[0].shift,3*LEFT)) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - - + self.wait(2) - # self.play(ReplacementTransform(function,const)) - # self.play(ShowCreation(sinx),ShowCreation(cosx)) - # self.play(ShowCreation(sin2x),ShowCreation(cos2x)) - # self.play(ShowCreation(sin3x),ShowCreation(cos3x)) - # self.play(ShowCreation(sin4x),ShowCreation(cos4x)) - # sintext=TextMobject("Infinite","sines").shift(5*RIGHT).set_color_by_tex_to_color_map({"Infinite":[YELLOW,RED],"sines":BLUE}) - # costext=TextMobject("Infinite","cosines").shift(5*LEFT).set_color_by_tex_to_color_map({"Infinite":[YELLOW,RED],"cosines":BLUE}) - # sintext.scale(0.6) - # costext.scale(0.6) - # self.play(FadeIn(sintext),FadeIn(costext)) - # self.wait(2)
\ No newline at end of file + 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 index f23e54f..d35f8bf 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py @@ -1,7 +1,7 @@ from manimlib.imports import * import numpy as np -class compare(GraphScene): +class compare(GraphScene,MovingCameraScene): CONFIG = { "x_min": -3, "x_max": 3, @@ -14,6 +14,9 @@ class compare(GraphScene): "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) @@ -58,7 +61,7 @@ class compare(GraphScene): 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) + 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), @@ -77,7 +80,13 @@ class compare(GraphScene): 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])) @@ -85,6 +94,9 @@ class compare(GraphScene): 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)) @@ -93,6 +105,7 @@ class compare(GraphScene): 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) @@ -101,10 +114,10 @@ class compare(GraphScene): 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.3).shift(4.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.3).shift(4.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.3).shift(4.5*RIGHT+1.5*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.3).shift(4.5*RIGHT+1.5*UP).set_color(YELLOW), + 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])) @@ -112,22 +125,5 @@ class compare(GraphScene): 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])) - # coeffResult=[ - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 1 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 4 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 10 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # 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.3).shift(4.5*RIGHT+1.5*UP), - # ] - # result2a=self.returnPartResult(2,1) - # result2b=self.returnPartResult(2,4) - # result2c=self.returnPartResult(2,10) - # result2d=self.returnPartResult(2,20) - - # self.play(ReplacementTransform(partFunction2,result2a),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2a,result2b),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2b,result2c),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2c,result2d),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.wait(0.5) - - self.wait(2)
\ No newline at end of file + 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 index 5d33fbe..fdf4bb3 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video4_FourierSeriesOfSquarePulse.py @@ -33,9 +33,9 @@ class fourierSeries(GraphScene,MovingCameraScene): 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.4) + 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) + 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) @@ -87,6 +87,11 @@ class fourierSeries(GraphScene,MovingCameraScene): 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) - self.wait(1) - self.play(self.camera_frame.set_width,14,self.camera_frame.move_to,0) + 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/Power Series/README.md b/FSF-2020/calculus/series-and-transformations/Power Series/README.md index 6885837..2fd400d 100644 --- a/FSF-2020/calculus/series-and-transformations/Power Series/README.md +++ b/FSF-2020/calculus/series-and-transformations/Power Series/README.md @@ -11,4 +11,4 @@  #### Uniform Convergence - + 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 Binary files differnew file mode 100644 index 0000000..e284b83 --- /dev/null +++ b/FSF-2020/calculus/series-and-transformations/Power Series/gifs/file4a_UniformConvergence.gif diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.py b/FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.py index 19b8b8b..8680792 100644 --- a/FSF-2020/calculus/series-and-transformations/Power Series/video2_convergence_of_a_function.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) diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py b/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py index f35fea8..af4bdea 100644 --- a/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py +++ b/FSF-2020/calculus/series-and-transformations/Power Series/video3_radius_and_intervalOfConvergence.py @@ -105,9 +105,4 @@ class graphScene(GraphScene,MovingCameraScene): self.wait(1) self.play(self.camera_frame.set_width,14) self.wait(1.3) - # self.camera_frame.save_state() - # self.camera_frame.set_width(5.5) - # self.play(self.camera_frame.move_to, ORIGIN) - # self.wait(1) - # self.camera_frame.set_width(14) - # self.wait(1.5) + diff --git a/FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.py b/FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.py index 1f3e26c..b75da59 100644 --- a/FSF-2020/calculus/series-and-transformations/Power Series/video4_UniformConvergence.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) @@ -65,7 +61,7 @@ class graphScene(GraphScene,ZoomedScene): def setup(self): GraphScene.setup(self) - #MovingCameraScene.setup(self) + ZoomedScene.setup(self) @@ -110,19 +106,7 @@ class graphScene(GraphScene,ZoomedScene): 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() 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 index ce3b088..88eb772 100644 --- a/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md +++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md @@ -2,7 +2,7 @@  #### Taylor Series GeneralForm - + #### Radius Of Convergence  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 Binary files differindex e6d9171..33dfa81 100644 --- 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 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 Binary files differnew file mode 100644 index 0000000..33dfa81 --- /dev/null +++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py index b132811..a0c7176 100644 --- a/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py +++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py @@ -95,7 +95,6 @@ class graphScene(GraphScene,MovingCameraScene): obj.set_color(GOLD_A) group=VGroup(coeff[0],coeff[1],coeff[2]) - #group.shift(2*LEFT+2*DOWN) firstApprox=[self.get_graph(lambda x:1,color=BLUE)] secondApprox=[self.get_graph(lambda x:1,color=BLUE), @@ -142,13 +141,6 @@ class graphScene(GraphScene,MovingCameraScene): 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) @@ -230,16 +222,7 @@ class graphScene(GraphScene,MovingCameraScene): 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/video2_TaylorExpansionGeneralForm.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py index c177ab4..5be336b 100644 --- a/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.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,6 +55,9 @@ 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) @@ -62,7 +65,7 @@ class graphScene(GraphScene): 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=1$") + text=TextMobject("about $x=1$") text.scale(0.55) equation.shift(3.39*UP+5*LEFT) text.shift(3*UP+5*LEFT) @@ -80,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) @@ -91,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}$") @@ -147,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])) @@ -166,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) @@ -179,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) @@ -193,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) @@ -204,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/video4_DivergentRemainder.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/video4_DivergentRemainder.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 + |